|
-
Feb 14th, 2003, 11:18 PM
#1
Thread Starter
Lively Member
DLL and API combine
How can I combine two MS Visual C sources with the following types of procedure into one source:
Source (A):
LRESULT CALLBACK KeyboardTracker(int code, WPARAM wParam, LPARAM lParam)
__declspec(dllexport) BOOL IdleTrackerInit()
int WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
Source (B):
BOOL APIENTRY DllMain( HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved )
CRYPTOFACILITY_API int _stdcall prngseed(unsigned long * rn1, unsigned long * rn2)
In fact, the "prngseed" is called by a VB main program with the following declaration:
Private Declare Function prngseed Lib "CryptoFacility" Alias "_prngseed@8" (ByRef rn1 As Long, ByRef rn2 As Long) As Integer
How can I call eliminate the "@8" in the VB declaration?
-
Feb 15th, 2003, 05:08 AM
#2
To get rid of the mangled names you must write a .def file. Search this forum, there's enough info already.
To merge the two files you need to figure out what exactly the two DllMain functions do (they are for initializing and de-initializing the DLL) and merge the functionality.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|