-
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?
-
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.