|
-
Apr 9th, 2002, 05:19 AM
#1
Thread Starter
Lively Member
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.
Last edited by markmyb; Apr 9th, 2002 at 05:24 AM.
Confusios say "Man who run in front of car get tired."
-
Apr 9th, 2002, 08:07 AM
#2
you must add a .def file:
Code:
LIBRARY
myDLL
EXPORTS
CVDDLL_Main
Then I think you don't even need the extern "C"
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Apr 9th, 2002, 08:08 AM
#3
And you need APIENTRY on both declarations.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Apr 9th, 2002, 08:15 AM
#4
Thread Starter
Lively Member
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
Confusios say "Man who run in front of car get tired."
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|