-
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.
-
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.