: Hello ,
:
: I am developing application using COM interface. in that
: application i created 2 class.
: Now i want to convert that application in dll.
: But i don't know how to create Class DLL in vc++ and use that
: DLL in VB.
:
: plase tell me how to create class DLL and how to use in vb.
: send me source code if possile or tell me the steps.
:
: waiting for +ve response.
:
: Regards,
: Rajesh
First create a DLL project with the two classes in.
This is what I do:
class foo
{
Create ();
};
// DLLs follow the C calling convention, so there
//is no standard way to export classes directly. MSVC
// provides a nonstandard way though.
extern "C"
{
_declspec (dllexport) int InitDLLInterface (foo** obj)
{
*obj=new foo;
return 0;
}
_declspec (dllexport) void ShutdownDLLInterface (foo** obj)
{
delete obj;
}
}
If you link in the DLL's *.lib file, the OS will
automatically load the DLL at startup. Or you could
load it via MSVC ::LoadLibrary().
Sorry, dont know how to link DLLs with VB though.
Good Luck!