-
Help!!!!!
I need to compile a dll for a vb app. what project type and complie options must I use!!!
Using Visual C++
the following header has being included:
#define CEEPROGS
extern "C" // need for 'C' & VB progs
{
#ifdef CEEPROGS
__declspec(dllexport) int CVDDLL_Main(char *Src,int Srclen,char *DestName,char *ErrorLog);
#define OURCALLING __declspec(dllexport)
#else
int APIENTRY CVDDLL_Main(char *Src,int Srclen,char *DestName,char *ErrorLog);
#define OURCALLING APIENTRY
#endif
}
the vb programmer has defined it as:
Public Declare Function CVDDLL_Main Lib "cvddllmain.dll" (ByVal sFile As String, _
ByVal iLen As Integer, _
ByVal sFileDesc As String, _
ByVal sErrorLog As String) As Integer
but it keeps give bad dll calling convention error.
-
you must add a .def file:
Code:
LIBRARY
myDLL
EXPORTS
CVDDLL_Main
Then I think you don't even need the extern "C"
-
And you need APIENTRY on both declarations.
-
Thanx CornedBee,
I managed to sort out the problem
added the following change to both apps.
Alias "_CVDDLL_Main@16" to the vb declaration and change the c++ declaration to include __stdcall
this way I don't have to export another file as well...
latter