Page 1 of 1
How to convert a wxClientDC to HDC?
Posted: Tue Jun 02, 2009 7:51 am
I am using a 3rd party library which expects me to pass an HDC parameter.
How can I convert the wxClientDC/wxDC object that I have to an HDC?
Thanks in advance,
Posted: Tue Jun 02, 2009 8:21 am
I've never done it, but I believe you can just do this:
Posted: Tue Jun 02, 2009 9:50 am
Thank You Timg,
Can you also provide me link where I can find documentation of this function.
Posted: Wed Jun 03, 2009 7:32 am
The hDC that I am using is of a 'wxFrame' class that is current;y displaying and has focus on a list view.
On a user action, I need to pass the hDC of wxFrame to a 3rd party library which should display an image on top. Everything works as expected,however, only the image does not display
Following is my code snippet:
HDC hDC = GetDCOf(dc);
// call the 3rd party API here passing hDC
Posted: Wed Jun 03, 2009 9:16 am
This works for me (Copy from a working PDF-Viewer):
Code: Select all
HRESULT hr = PXCV_DrawPageToDC(doc, page, (HDC)dc.GetHDC(), &rp);