Making a DLL in C/C++ that I can use in VB |
black eyez
Hey! My friend has developped a directx wrapper-type lib for c++ (using classes). We would like to be able to somehow make a dll out of it so that it can be used from VB. Is this possible? How difficult would this be? Thanks,
Eric You'll have to have your
functions exportable,
BOOL WINAPI DllMain(HINSTANCE
hInstA, DWORD dwReason, LPVOID lpvReserved)
Your dll export should look
similar to this:
In your header file, you'll
have
And in your .def file, you'll setup the list of exported functions like this: EXPORTS
I hope that helps to point
you in the right direction.
black eyez Okay thanks... But, as I'm not the most experienced c++ programmer (I didn't personally write the wrapper), I'm still curious as to how I would use classes as defined in the c++ files. Is there any way to do this?
Eric In what way do you want to use classes? In a DLL, I don't think its possible. To my knowledge a DLL only conatain functions that can be access via other programs. If there are any classes inside a dll, I think they have to be encapsulated, otherwise it won't work. If that's not what you had in mind, you could always create an OCX, that might be usefull to you. I'm not very familiar with c++ either, so what i've said could very well be wrong. Eric |