|
-
Feb 17th, 2001, 05:46 PM
#1
I forget If I asked this before or not, but I'm having trouble writing a C++ DLL for use in VB...The VB error I'm getting is something like "Cannot find point of entry for DLL" or something like that, it's been a few days since I last tried it...Any help woulld be appreciated...
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
-
Feb 17th, 2001, 08:12 PM
#2
use this style function declaration:
Code:
int _stdcall add(int one, int two)
{
return one + two;
}
-
Feb 17th, 2001, 08:15 PM
#3
thanks Dennis, I don't need a DEF file or something like that, or do I??
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
-
Feb 17th, 2001, 08:31 PM
#4
still a problem...
here is the code that VC++ generated, the code I wrote is in bold:
Code:
#include "stdafx.h"
float _GetMiddle(float pointA, float pointB);
BOOL APIENTRY DllMain( HANDLE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
return TRUE;
}
float _GetMiddle(float pointA, float pointB)
{
float result;
result = (pointA + pointB)/2;
return result;
}
the error I get in VB is : "Can't find entry point GetMiddle in test". test is the name I gave the DLL. I haven't used C++ in a while, and this is the first DLL I'm writing, so try to dumb down your reponse if you like to use techno-babble...
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
-
Feb 17th, 2001, 08:50 PM
#5
Sorry, yes you do need a DEF file.
Code:
LIBRARY "test.dll"
EXPORTS
add
-
Feb 17th, 2001, 08:53 PM
#6
Sorry for the ignorance, but How do I tie that in with the project, do you know?
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
-
Feb 17th, 2001, 09:00 PM
#7
Click on the 'source files' folder, and go to the file menu, and click 'new', then chose 'text file', name the file 'test.def'
the name doesn't matter much, but just make sure it has a *.def ending.
-
Feb 17th, 2001, 09:00 PM
#8
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
-
Feb 21st, 2001, 03:14 PM
#9
Monday Morning Lunatic
VC++ automatically sends it to the linker if there's one in the project. If you ever need the command line for it, there's docs on MSDN as to how to do it.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
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
|