PDA

Click to See Complete Forum and Search --> : dll no workie


nabeels786
Jan 1st, 2002, 05:11 PM
VB keeps saying "cannot find entry point", even when there is one!


heres the code


// fileshredderDLL.cpp : Defines the entry point for the DLL application.
//

#include "stdafx.h"
#include "fileshredderDLL.h"

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;
}

// This is the constructor of a class that has been exported.
// see fileshredderDLL.h for the class definition
CFileshredderDLL::CFileshredderDLL()
{

}
int CFileshredderDLL::test(){
return 1;
}

int TEST2(){
return 1;
}


// This is an example of an exported variable
FILESHREDDERDLL_API int nFileshredderDLL=0;

// This is an example of an exported function.
FILESHREDDERDLL_API int fnFileshredderDLL(void)
{
return 42;
}


i try calling test(), TEST2(), and fnFileshredderDLL(void) from VB, and from each of there, it doesnt work

another ? - do i put all of my functions in the CFileshredderDLL class, or outside of the class?


thanks alot -
nabeel

Zaei
Jan 1st, 2002, 06:07 PM
All of your functions need to be __stdcall to work in VB.

Might solve the problem, dunno =).

Z.

nabeels786
Jan 1st, 2002, 06:14 PM
nope didnt work :(

nabeels786
Jan 1st, 2002, 07:22 PM
i found a guide, and did it that way

the DLL is only 24kb :) :)


vs. the 100kb+ the other one was givin

CornedBee
Jan 6th, 2002, 10:05 AM
You can't use C++ classes in VB unless you implement them as COM objects, so much is sure.

And as Zaei said, all functions must be __stdcall.
Remove the FILESHREDDER_API, it helps you nothing for VB. Write a .def file instead.