Drawing ActiveX window
-
How do we draw ActiveX window (visible ActiveX) on to a window using "win32 SDK"(I mean not using Microsoft Foundation Classes !)? Thanks and Best regards, Deepu:rolleyes:
Hi, Probably you mean you want to host ActiveX control in your Win32 Application. Right? Hosting a control without support of MFC is very hard to implement. Try to search PATRON sample from MSDN. It's a sample used in book "Inside OLE" by Kraig. It has no reliability to any librarys like MFC or ATL. Cause of the purpose of the sample, it has little support as a container. BTW, if you don't mind using ATL, try to use CAxWindow or something like that. That control hosting support class template. It's very useful to host a control. IMHO ATL which has very readable source compared to MFC, is something worth to work on as a Windows programmer. Essentially about ATL, I recommend to read the book "ATL Internals" by Chris Sells. Hope this helps. Regards, Ryan :rolleyes:
-
How do we draw ActiveX window (visible ActiveX) on to a window using "win32 SDK"(I mean not using Microsoft Foundation Classes !)? Thanks and Best regards, Deepu:rolleyes:
first call OleInitialize(NULL) (but off course you know that) Then create the Object and get its LPDISPATCH, or it's interface pointer. If necesary, Invoke any method of the interface for loading documents or initializing. Query the OleInPlaceObject interface and set the object rectagular. RECT Pos={0,0,500,400},Clip={0,0,500,400}; OleInPlaceObject->SetObjectRects(&Pos,&Clip); When you want to paint it , query the IViewObject interface and call the 'draw' method. RECTL rectl={0,0,250,200}; ViewObject->Draw(DVASPECT_CONTENT,-1,0,0,0,(HDC)hdcDraw,&rectl,0,0,0); I use this in a CGI i am making where i just want to take a quick snapshot of Adobe's SVG control. I will generate SVG files using CF or ASP, then renter them using SVG control, encode them to JPG using CGI+ and sent them to the client! In the same pattern you can use a control founded in Corel draw that generates barcodes. - - - - - - - - - - - - - - - - - - Memory leaks is the price we pay \0 01234567890123456789012345678901234