how to implement atl.dll's function AtlAxAttachControl in freepascal? lazarus / 34-Windows ---------------------------------------------------------------------- zzsczz · 2011-12-20 15:31 AtlAxAttachControl  can create an interface from a coclass and show it on an windows. the atl's  code is : ATLINLINE ATLAPI AtlAxAttachControl(IUnknown* pControl, HWND hWnd, IUnknown** ppUnkContainer) {    AtlAxWinInit();    if (pControl == NULL)       return E_INVALIDARG;    CComPtr spUnkContainer;    HRESULT hr = CAxHostWindow::_CreatorClass::CreateInstance(NULL, __uuidof(IUnknown), (void**)&spUnkContainer);    if (SUCCEEDED(hr))    {       CComPtr spAxWindow;       hr = spUnkContainer->QueryInterface(&spAxWindow);       if (SUCCEEDED(hr))          hr = spAxWindow->AttachControl(pControl, hWnd);    }    if (ppUnkContainer != NULL)    {       *ppUnkContainer = SUCCEEDED(hr) ? spUnkContainer.Detach() : NULL;    }    return hr; } ---------------------------------------------------------------------- ludob · 2011-12-20 15:44 Are you looking for this http://lazarus.freepascal.org/index.php/topic,9311.15/topicseen.html? Drop a panel on the form, run the code and the ActiveX control will be displayed on the panel. The original demo at http://lists.lazarus.freepascal.org/pipermail/laz arus/2011-May/063491.html shows also how to sink events coming from the ActiveX control. ---------------------------------------------------------------------- zzsczz · 2011-12-20 17:02 Quote from: ludob on December 20, 2011, 04:44:43 pmAre you looking for this http://lazarus.freepascal.org/index.php/topic,9311.15/topicseen.html? Drop a panel on the form, run the code and the ActiveX control will be displayed on the panel. The original demo at http://lists.lazarus.freepascal.org/pipermail/laz arus/2011-May/063491.html shows also how to sink events coming from the ActiveX control. Function  AtlAxAttachControl  could be written by  freepascal to remove  the dependence of atl.dll  input args : 1 an interface of FactoryClass ( the  coClass) of the activex control 2 handle of the  window  to which the  activex control was attached to 3 ??nil ---------------------------------------------------------------------- ludob · 2011-12-20 17:25 Yes, please, do go ahead A good starting point is here http://doxygen.reactos.org/da/de4/atl__ax_8c_source.html. Don't forget that the implementation of IOleControlSite, IOleClientSite and IOleInPlaceSite is also missing. BTW. Have you found a windows version that doesn't come with atl.dll out of the box?