When making a dll, how do i make one int variable accesable all the time. Instead of a different one for each app?
Posted on 2002-09-17 14:10:35 by ChimpFace9000
Add a segment to your code



syshook SEGMENT
hKeyHook DWORD ?
syshook ENDS


Now when you link add a param like "/SECTION:syshook,rws"
Posted on 2002-09-17 15:06:32 by Fordy
How would i do that in c?
Posted on 2002-09-17 16:53:21 by ChimpFace9000
>>How would i do that in c?

Depends on the compiler I'm afraid....

IE for Visual C++, you would;


#pragma data_seg(".syshook") //Set shareable segment
HHOOK hKeyHook = NULL; //Handle to my hook
#pragma data_seg()
#pragma comment(linker, "/section:.syshook,rws")
Posted on 2002-09-18 01:20:13 by Fordy
Would you happen to know how to do it in mingw?
Posted on 2002-09-19 17:17:28 by ChimpFace9000
AFAIK declaring a section as sharable works in Win9x only and you have to declare all sections (.text, .data,...)as shareable. Im not quite sure, though.
Posted on 2002-09-20 02:19:34 by japheth
I'm sorry I dont know how to do that in Mingw....


AFAIK declaring a section as sharable works in Win9x only and you have to declare all sections (.text, .data,...)as shareable. Im not quite sure, though.


No...it works AOK in Win 2K & XP
Posted on 2002-09-20 03:29:47 by Fordy

No...it works AOK in Win 2K & XP



"AOK"?
Posted on 2002-09-20 03:32:29 by bazik
LOL....Sorry...britishness shines through

The way I feel today it very well could be "Asleep On Keyboard", but more likely;

AOK == All Is Okay

I think..... :alright:
Posted on 2002-09-20 03:36:11 by Fordy