Prev: ADO-VO
Next: Phantom errors
From: James Martin on
I downloaded the RP214 file and installed it into C:\RP214. Then I imported
the AEFs into VO8 and they don't conpile as they are. I needed to add some
returns but the following function does not work:

method GetTextLength(cText) class RpPrinter

// This method returns the length of a string based on the current font. The
value is returned

// in the current unit of measure.

local nLength as float

local lpSize is _WINSIZE

if self:lInExport .or. self:lInPrint .or. self:lInPreview // make sure we
are in a print mode

GetTextExtentPoint32(self:hPrinterDC, String2Psz(cText), slen(cText),
@lpSize) // This line doesn't work

nLength := lpSize.cx

nLength:=self:_xLateHLogical2UnitofMeasure(nLength)

endif

return nLength

The error is: overflow or loss of data possible converting DWORD -> LONGINT:
51422

What should I do?

James


From: Carlos Vazquez on
James,

I don't have those issues with the latest rp214d1.exe file.

Having said that, take a look at the prototype of GetTextExtentPoint32(SELF:hPrinterDC, String2Psz(cText), SLen(cText), @lpSize)
and you'll see that the third parameter has to be an INT. SLen() returns a DWORD, so put an INT() around Slen() and that's it.

James Martin wrote:

> I downloaded the RP214 file and installed it into C:\RP214. Then I imported the AEFs into VO8 and they don't conpile as they are. I needed to add some returns but the following function does not work:
>
> method GetTextLength(cText) class RpPrinter
>
> // This method returns the length of a string based on the current font. The value is returned
>
> // in the current unit of measure.
>
> local nLength as float
>
> local lpSize is _WINSIZE
>
> if self:lInExport .or. self:lInPrint .or. self:lInPreview // make sure we are in a print mode
>
> GetTextExtentPoint32(self:hPrinterDC, String2Psz(cText), slen(cText), @lpSize) // This line doesn't work
>
> nLength := lpSize.cx
>
> nLength:=self:_xLateHLogical2UnitofMeasure(nLength)
>
> endif
>
> return nLength
>
> The error is: overflow or loss of data possible converting DWORD -> LONGINT: 51422
>
> What should I do?
>
> James



--
--
Carlos Vazquez
cva(a)NOSPAMtelefonica.net
From: James Martin on
OK. It compiles without error, but I didn't get it checked yet. I have a lot
of work before I get it checked. The 2.7 and before classes that I used to
access MS Access are full of methods without returns.

Thanks.

James

"Carlos Vazquez" <cva(a)NOSPAM~telefonica.net> wrote in message
news:xn0f6k0jhopr75000(a)news.individual.net...
James,

I don't have those issues with the latest rp214d1.exe file.

Having said that, take a look at the prototype of
GetTextExtentPoint32(SELF:hPrinterDC, String2Psz(cText), SLen(cText),
@lpSize)
and you'll see that the third parameter has to be an INT. SLen() returns a
DWORD, so put an INT() around Slen() and that's it.

James Martin wrote:

> I downloaded the RP214 file and installed it into C:\RP214. Then I
> imported the AEFs into VO8 and they don't conpile as they are. I needed to
> add some returns but the following function does not work:
>
> method GetTextLength(cText) class RpPrinter
>
> // This method returns the length of a string based on the current font.
> The value is returned
>
> // in the current unit of measure.
>
> local nLength as float
>
> local lpSize is _WINSIZE
>
> if self:lInExport .or. self:lInPrint .or. self:lInPreview // make sure we
> are in a print mode
>
> GetTextExtentPoint32(self:hPrinterDC, String2Psz(cText), slen(cText),
> @lpSize) // This line doesn't work
>
> nLength := lpSize.cx
>
> nLength:=self:_xLateHLogical2UnitofMeasure(nLength)
>
> endif
>
> return nLength
>
> The error is: overflow or loss of data possible converting DWORD ->
> LONGINT: 51422
>
> What should I do?
>
> James



--
--
Carlos Vazquez
cva(a)NOSPAMtelefonica.net


 | 
Pages: 1
Prev: ADO-VO
Next: Phantom errors