I am converting an application in C++ to VB.NET.
The C++ application uses ATL CAxWindow class, how do I convert this to VB.NET? I mean what is the equivalent of CAxWindow in VB.NET. Or how can I access the ATL CAxWindow class in VB.NET??
Basically I need to create a window in VB.NET windows service to host a LeadTools Control (third party tools).
This is the function I am trying to convert to VB.NET from C++
void
CreateLEADControl(CAxWindow& oWin){
try{
const char* LICENSE = "LEADTOOLS OCX Copyright (c) 1991-2001 LEAD Technologies, Inc.";_bstr_t strLicense = LICENSE;
AtlAxWinInit();
// Create an empty host windowRECT rect = {0,0,100,100};
oWin.Create(NULL,rect,
"",WS_OVERLAPPED);HRESULT hr;
IClassFactory2Ptr pCF;
IPersistStreamInitPtr pPSI;
// Get the class factory object for LEAD Toolshr = CoGetClassObject(LEAD::CLSID_LEAD,CLSCTX_ALL,NULL,IID_IClassFactory2,(
void**)&pCF); // Create the LEAD Main control using the licensehr = pCF->CreateInstanceLic(NULL,NULL,
__uuidof(LEAD::_DLead),strLicense,(void**)&mpLEAD);pCF.Release();
// Initialize the new objecthr = mpLEAD->QueryInterface(&pPSI);
hr = pPSI->InitNew();
pPSI.Release();
Create a host window interface pointer_COM_SMARTPTR_TYPEDEF(IAxWinHostWindow,IID_IAxWinHostWindow);
IAxWinHostWindowPtr pHost;
// Attach the new object to the host windowhr = oWin.AttachControl(mpLEAD,(IUnknown**)&pHost);
pHost.Release();
}
Thanks in advance,
Purnima.
Mahesh ChandPosted May 13, 2008, 11:30 AM