Posts: 842
Joined: Mon Oct 10, 2005 01:29 PM
Convert hb_parc() in LPTSTR
Posted: Tue Oct 21, 2008 10:13 AM
Antonio ,
The problem was in the conversion in TCAHR now I found the solution :
LPSTR pW ;
pW = hb_parc( 1 ) ;
int lenwName ;
lenwName = sizeof(pW) ;
TCHAR wName[sizeof(pW)];
MultiByteToWideChar( CP_ACP, 0 ,pW , -1 , wName, sizeof( wName ) / sizeof( wName[ 0 ] ) );
PDC_ExtTextOut(hPrDC,200,200, 0, NULL, wName, _tcslen(wName) , NULL);
Antonio, it is correct ?
About the DC :
There are not a function to release the DC but a function that close the process at the end .
So , It is better declare hPrDC static at the start or call every line ( every function)
hPrDC=PDC_GetPrinterDC()
what do you think .