I have an ActiveX control which I need to render to a report. The control has a method which accepts a device context handle. So I think I can do this using the PRP_GetDC() function of PSHR170.DLL, something like this;
long ll_printjob
ulong lul_hdc
ll_printjob = PrintOpen( "Print Test" )
lul_hdc = PRP_GetDC( ll_printjob )
ole_map.OutputMap( lul_hdc, ... )
PrintClose( ll_printjob )
However when I test this, the print-page is rendered blank.
My declaration of PRP_GetDC() is this;
FUNCTION ulong PRP_GetDC (long printjob) library "PBSHR170.dll"
I have attempted to render a bitmap using StretchBlt() to the print page based on code that I know works, and that also seems to be rendered blank. So at this point I suspect that my hDC value is not valid, or the way I am using it is not valid. However the value is non-zero, and reasonable values seem to be returned by from calls to get attributes of the hDC using GetDeviceCaps() e.g.
constant long LOGPIXELSX = 88
long LOGPIXELSY = 90
GetDeviceCaps( lul_hdc ,LOGPIXELSX)
Does anyone have any pointers on getting this working?
(I am using Powerbuilder 2017R3)
I think that answers my question and I can crack on with what I actually need to do.