I have written WIN32 ( Non MFC ) dll using VC++ 6.0 visual studio. The
exported functions are called by another application which returns
shared variable defined in pragma. This works correctly on my PC.
I have copied the EXE and dll on another PC. The application runs
without any errors but the values returned from the functions are not
correct. Mostly the intialised values are returned (i.e. if boolean is
initialised to TRUE , the it is only returned , if int is intialised
to 0 then 0 is returned)
I put a messagebox to display the values in dll function. It displays
correct values in my PC but 'initialised values' in other PC.
Both PCs have same operating system as Win2K.
Do I have to do something else so that functions behave correcly on
all the machine ?
rgds
Rajesh
Very difficult to resolve without going over the code in the project.
Are you running the same builds on both computers (debug, release)? Are builds for an exe and dll modules the same?
How did you set linker options?
There are only 10 types of people in the world: Those who understand binary and those who do not.
Thanks JohnCz,
I have complied release of the dll. The dll and exe are different.
In fact exe is built in SQLWINDOWS.
Actually multiple applications shall be hooked .
function getMyTime and getMyFlag are used to send the shared variable to third application
You have made several mistakes; find all doing comparison. I have also added dialog to demonstrate how process hook messages.
Most significant export, and setting thread ID.
Hook should notify application about events by posting (important!) messages should application act on certain messages. DLL should perform needed filtering itself.
I have defined couple of messages for that reason. You could use RegisterWindowMessage but since we know what window messages are sent I do not think that would be necessary.
There are only 10 types of people in the world: Those who understand binary and those who do not.
Thanks JohnCz.
I think I can build on ur advise.
Actually I have 20 exes to hook, and 21st exe to send the message to depending on the first 20 exes.
thanks and rgds
Rajesh
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.