Click to See Complete Forum and Search --> : Call 32 bit DLL in 16bit Vc++1.5
qiban
June 9th, 2003, 01:47 PM
I'm working on write a small program to call a DLL to R/W data into RS232. I use vc__1.5 editor.
OS show a "caused a General Protection Fault" while I run it.
I guess that because I used a 16bit editor to call 32bit Dll (If I’m wrong, don’t laugh at me).
Is there any way can fix this problem?
Thanks
Paul McKenzie
June 9th, 2003, 03:06 PM
Originally posted by qiban
I'm working on write a small program to call a DLL to R/W data into RS232. I use vc__1.5 editor.
OS show a "caused a General Protection Fault" while I run it.
I guess that because I used a 16bit editor to call 32bit Dll (If I’m wrong, don’t laugh at me).
Is there any way can fix this problem?
Thanks Why not create a 32-bit program? If the DLL is a 32-bit DLL, the easiest solution is to write a 32-bit application.
Regards,
Paul McKenzie
qiban
June 9th, 2003, 04:31 PM
Tnakhs for respond. I have to edit it with 16 bit editer. because this problem is part of a project. the whole project created by Vc++1.5. If I use vc++6.0, I should change a lot
ranjan_j
June 10th, 2003, 12:38 AM
Try thuking. Read material on Generic Thunks in MSDN for more help. Generic thunks provide a mechanism for 16-bit applications to call functions in Win32-based DLLs.
regards,
Ranjan
qiban
June 10th, 2003, 09:32 AM
Thank you, Ranjan, I will try it.
Thanks again
qiban
June 10th, 2003, 10:04 AM
Sorry, it's does not work. Vc++1.5 use windows 3.1 SDK.
ranjan_j
June 11th, 2003, 03:25 AM
What is ur os config and what problem are u facing using thunk functions ?
regards,
Ranjan
qiban
June 12th, 2003, 11:37 AM
I use Windows XP. and In vc1.5 , it's windows3.1 SDK. so I can not try using thunk functions. Is there other way?
Thanks,
ranjan_j
June 15th, 2003, 11:59 PM
Well this application that you want to write, does it have any restrictions on being a 32-bit application ? Else u can write a 16-bit application and call ur 16-bit dll from it.
qiban
June 16th, 2003, 09:14 AM
In this DLL, it used CreateFile() function. I think this is a 32-bit function.
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.