|
-
Oct 29th, 2000, 07:51 PM
#1
Thread Starter
Lively Member
Hello World,
Is it possible for anyone to make his own function library
using Turbo C++ and make it available for VB projects?
In fact, i have a serial port communication program which
i wrote in Turbo C++. Thank God it is working, and i want
to use some of its funcs in VB. How can I, if possible?
Thank in advance.
While YourAge<=40
Live(YourLife)
Wend
-
Oct 30th, 2000, 03:47 PM
#2
Monday Morning Lunatic
To make a DLL, there are linker options for it. However, you need to tell it what to export. Firstly, the function must use the stdcall calling convention (check your manual - try __stdcall or stdcall), and there must be a .def file. For example:
testdll.cpp
Code:
long __stdcall exportfunc(long x) {
return x * x;
}
testdll.def
Code:
LIBRARY "TESTDLL.DLL"
EXPORTS
exportfunc
Then, to use in VB, just make a declare for 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
|