Click to See Complete Forum and Search --> : How to cerate a C++ DLL that can be called from VB 6?


anatoli
November 5th, 1999, 04:51 PM
People, if some one has experience in creating C++ or C non MFC DLLs in VC++ 6 so that they can be accessed later from VB 6 ActiveX DLL as an access to a regular API, please give me a small example or send me a link on a Web.
All suggestions are most welcomed.
I can't find any good example in MSDN.
Thanks

ATM
November 5th, 1999, 06:43 PM
May be this help:
http://www.tair.freeservers.com
see for VC++/Keyboard Hook.

jinnu
November 5th, 1999, 10:30 PM
Go to Visual Studio envi. and select new Project 'Win32 DLL' and then 'an Empty DLL' in next tab and proceed.
write the source file as in example below. word 'CALLBACK' is important here.
Then create a .def file to export the desired functions as shown below.
<vbcode>
//in the source file. xyz.c
int CALLBACK GetCount(void);
int CALLBACK GetCount(void)
{
// write your implementation here
}

//Create a .def file with same name as .c file // added in same workspace. add following code.

EXPORTS

GetCount @1

//if you have multiple functions just increase //the count @2 , @3 and so on.
</vbcode>

Onc