Article View: comp.windows.ms.programmer
Article #2861Dynamic Run-Time import with C++
From: Ian McDonald
Date: Mon, 27 May 1991 00:39
Date: Mon, 27 May 1991 00:39
19 lines
1424 bytes
1424 bytes
I'm trying to call a DLL routine dynamically (ie using a LoadLibrary) but I am having difficulty because of C++ type checking. In C you can go : (*lpFunc) ((LPSTR) Buffer,512); for example if lpFunc is of type FARPROC. (This is taken from page 20-33 of the SDK Guide to Programming). With C++ it will not let me do this because of the type checking. I have tried (and failed) to make a typedef to do this although I am not too experienced with typedef. Could somebody help me out by showing me a way to have a typedef equivalent to FARPROC but allows parameters (defined in advannce) or do a typecast to use FARPROC properly. -- ------------------------------------------------------------------------- Ian McDonald | 52 Cook Street| / /\ /\ Hamilton | This space free for advertising !! / / \/ \ New Zealand | / / \ +64-71-563438 | I can receive mail but can't reply to it.
Technical Details
Message-ID:
<1991May27.123911.3813@waikato.ac.nz>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!waikato.ac.nz!iamShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!waikato.ac.nz!iam From: iam@waikato.ac.nz (Ian McDonald) Newsgroups: comp.windows.ms.programmer Subject: Dynamic Run-Time import with C++ Message-ID: <1991May27.123911.3813@waikato.ac.nz> Date: 27 May 91 00:39:11 GMT Organization: University of Waikato, New Zealand Lines: 19