Hi Guys,
Here this is a very useful tip.
This is to call the VB DLL function in Visual C++ module.
DO the following code
// Add the following code in the StdAfx.h
#import "TestVBdll.dll"
using namespace TestVBdll;
// Add the following code in where you want to call the VB dll function
HRESULT hresult;
CLSID clsid;
CoInitialize(NULL); //initialize COM library
hresult=CLSIDFromProgID(OLESTR("TestVBdll.clsdll") ,&clsid);
_clsdll *t;
hresult=CoCreateInstance(clsid,NULL,CLSCTX_INPROC_ SERVER,__uuidof(_clsdll),(LPVOID *) &t);
if(FAILED(hresult))
{
//AfxMessageBox("Creation Failed");
return "failed";
}
t->TestVBFunction();
t->Release(); //call method
CoUninitialize(); //Unintialize the COM library
// End of the code
.......
bye
thanks
