Could someone please send me the src for a dll file that they have made, and tell me how to access it in my programs??
Printable View
Could someone please send me the src for a dll file that they have made, and tell me how to access it in my programs??
there are two articles in the activex topic section that explain a simple dll and how to use them... they are towards the end... the articles are about working with objects... they will show you how to creat a dll object... then how to use them...
thanks heaps
//all necessary includes
//standard entry point of any Win dll
BOOL WINAPI DllMain(HANDLE hModule,DWORD ul_reson_for_call,
LPVOID lpReserved)
{
switch(ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
break;
case DLL_PROCESS_DETACH:
break;
}
return(TRUE);
}
//C++ implementation
extern "C"
{
//your declarations go here
extern__declspec( dllexport) long YOURFUNCTIONNAME(YOURPARAMETERS);
}
long YOURFUNCTIONNAME(YOURPARAMETERS)
{
//your code goes here
return 0;
}
then from your vb application do:
Declare Function YOURFUNCTIONNAME lib "YOURDLLNAME.dll"(YOURPARAMETERS) as long
and then
call YOURFUNCTIONNAME(YOURPARAMETERS)
thanks, but i was kind of thinking along the line of vb code and not c, but it doesn't matter, i have made a dll now :)