Hi,
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,
Puja Bajaj
How to convert a wxClientDC to HDC? Topic is solved
-
- In need of some credit
- Posts: 5
- Joined: Sat Feb 02, 2008 8:47 am
- Location: Noida
I've never done it, but I believe you can just do this:
Code: Select all
HDC hdc = GetHdcOf(dc);
-
- In need of some credit
- Posts: 5
- Joined: Sat Feb 02, 2008 8:47 am
- Location: Noida
-
- In need of some credit
- Posts: 5
- Joined: Sat Feb 02, 2008 8:47 am
- Location: Noida
Hi,
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:
wxClientDC dc(this);
PrepareDC(dc);
this->PrepareDC(dc);
HDC hDC = GetDCOf(dc);
// call the 3rd party API here passing hDC
No effect
Please help.
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:
wxClientDC dc(this);
PrepareDC(dc);
this->PrepareDC(dc);
HDC hDC = GetDCOf(dc);
// call the 3rd party API here passing hDC
No effect
Please help.
Try
wxDC::GetHDC()
This works for me (Copy from a working PDF-Viewer):
wxDC::GetHDC()
This works for me (Copy from a working PDF-Viewer):
Code: Select all
HRESULT hr = PXCV_DrawPageToDC(doc, page, (HDC)dc.GetHDC(), &rp);