Article View: borland.public.cppbuilder.nativeapi
Article #10293linking to VC++ Dll's (_stdcall)
From: Kevin Johnson
Date: Thu, 22 Apr 2004 11:36
Date: Thu, 22 Apr 2004 11:36
29 lines
1887 bytes
1887 bytes
Hi all, just a quick question, I know it's been asked a million times before but I can seem to make it work. I'm trying to do some parallel port comms and I'm using a DLL called Inpout32.Dll from www.logix4u.net. I need to dynamically link to it at run-time and I'm having problems defining the typedef for the DLL's exported functions. I've get the source for the DLL the two functions are defined as: void _stdcall Out32(short PortAddress, short data); short _stdcall Inp32(short PortAddress); - the VC++ dll has and an export table that lists these two functions with there ordinal values. I've defined my typedefs as: typedef __declspec(dllimport) short Inp32(short PortAddress); typedef __declspec(dllimport) void Out32(short PortAddress, short data); Inp32 *Input; Out32 *Output; -I then call LoadLibrary and GetProcAddress with no problems. However when I call Output and get an "application-defined" exception (code 0c0000029) at 0x77fb1e0c. Does anyone have any idea? Kevin
Technical Details
Message-ID:
<408802ed$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,8a83c52dcba9336c,start X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2004-04-22 10:40:37 PST From: "Kevin Johnson" <kevjson@hotmail.com> Newsgroups: borland.public.cppbuilder.nativeapi Subject: linking to VC++ Dll's (_stdcall) Date: Thu, 22 Apr 2004 12:36:49 +0100 Lines: 31 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 NNTP-Posting-Host: 82.39.123.106 Message-ID: <408802ed$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1082655469 82.39.123.106 (22 Apr 2004 10:37:49 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail