Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DLL entry point problem

Status
Not open for further replies.

Polkadot

Technical User
Jan 23, 2002
8
GB
I want to write some very simple functions, pack them into a DLL and call them from Excel (VB using DECLARE Function....). I have used VC application wizard to generate a Windows 32 DLL + exported that includes an exported function that does nothing more than return the integer 42. I have selected explicit linking. (I don't need MFC or automation)
Visual Basic reports an Error to the effect that it cannot find an entry point for the DLL. - I have used Show Dep(endencies) to view the exported functions - no problem here although I note that function DLLMain does not appear in the list of exports. What am I doing wrong ? - Why does Microsoft bother producing wizards that generate unuseable code?

Do I need to register the DLL before I can use it ?
DLLMain is defined by the wizard as doing nothing other than returning true Eg:

BOOL APIENTRY DllMain( HANDLE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:

case DLL_THREAD_ATTACH:
case DLL_THREAD_DETACH:
case DLL_PROCESS_DETACH:
break;
}
return TRUE;
}




 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top