
Scaling Printer Device Context between Visual Basic 4.0 and Visual C++ Problem
Scaling Printer Device Context between Visual Basic 4.0 and Visual C++ Problem
-----------------------------------------------------------------------------------------------
After trying the following stuff, I realize that the specified scale was not used by the dll function
-------------------------------------
for the drawing of the rectangle.
VB: Declare Sub FctTestPrinter lib "test.dll" ( ByVal hdcPrinter As Long )
Printer.ScaleHeight=2000
Printer.ScaleWidth=2000
FctTestPrinter( Printer.hdc )
VC++: ( test.dll )
void FctTestPrinter( HDC hdcPrinter )
{ CDC *pDC=CDC::FromHandle(hdcPrinter);
pDC->StartDoc( ...);
pDC->StartPage();
pDC->Rectangle(500,500,1500,1500);
pDC->EndPage();
pDC->EndDoc();
}
It's the same when the scale is modified directly from VC++ ( SetWindowExt and SetViewPortExt ).
It's the same when the default printer is also get directly from VC++ ( EnumPrinters, createDC ... ).
When all printing is done with VC++ there is no problem ( test.dll called by an main C program ).
As soon as VB is involved, no more printing scalings and Pen type modifications are available !?
Did someone encounter such a problem or could solve it ?