problem with thunking of dlls
i am using the concept of thunking of dll's in win-95. i have written a function which return an int in the thunk script. i have compiled the thunk script and have made two .obj files one for 32-bit dll and other for 16-bit dll.
i used borland c for making 16-bit dll and in this i have used the function which i used in the thunk script and this function returns an int.
for aking 32-bit dll i have used vc++ 6 and have used a function whic also returns an int. this function in turns call the function used in the 16-bit dll.
buit on LoadLibrary(32bit.dll) the project is giving an error.
can anyone help me out.
final project is made in vc++6 and it call the 32-bit dll, whic in turn calls 16-bit dll.
# 1 Re: problem with thunking of dlls
I have never thunked so I can't help much with that.
There are potential incompatibilities with use of an application written using VC and a DLL developed using something other than VC. Right? So I would attempt to eliminate that as a possibility. Have you written a test application using Borland C to test the 16-bit dll written using Borland C? Does everything work when all the programs are written using Borland C? If so then the problem could be an incompatibilty problem. If so then perhaps there are solutions to the incompatibilty problem and perhaps another forum is more likely to help.
However I sure am not sure about any of this so if none of this seems relevant then ignore it.
# 2 Re: problem with thunking of dlls
Does the 32-bit dll access the 16-bit through a LoadLibrary or directly through its IAT? The latter seems very unlikely, but sometimes I have to ask these questions, because I've seen similar attempts. More importantly, though, is the LoadLibrary (if it IS there) in the 32 bit DLL inside the DLLMain for process attachment? Because, I think your problem may occur when the 32bit is gaining access to the 16bit, and not just the loading of the 32bit (which is often not a problem except for possible coding errors). Anyway, this is just a hunch, but if you post the relevant loading codes for both dlls (I mean FROM the modules that load them) it might be clearer. Also, as Sam points out, there are sometimes dll inconsistencies across compilers (particularly in the days and OS versions you are working with), but I figured if you were building thunks (to get proper addressing down to/up from devices), that type of knowledge was already known to you...
# 3 Re: problem with thunking of dlls
dear gurus,
i thank u for the prompt reply to my question. u r correct when u tell that the problem is not in loading 32-bit dll with the use of LoadLibrary but when this 32-bit dll tries to gain access of the 16-birt dll. actually i had not marked the 16-bit dll as version 4.o so the problem was occuring. i have fixed the problem . thanks again.