Converting Delphi 5 code to Delphi 2010 Code Part III ?

DelphiRulez
DelphiRulez used Ask the Experts™
on
I am converting Delphi 5 code over to Delphi 2010 code.


Question 1:

I get the following error:

There is no overloaded version of 'DocumentProperties' that can be called with these arguments

on this call:

ExtDevCode := DocumentProperties (0, DrvHandle, FDevice,
                                      FDeviceMode^, FDeviceMode^,
                                      DM_IN_BUFFER or DM_UPDATE);

:

DrvHandle:    THandle;
FDevice:     PChar;
FDeviceMode: PDeviceModeA;


Question 2:


I get the following error:


Incompatible types: 'PDeviceModeW' and 'PDeviceModeA' (PDiviceModeA from windows.pas)

on the following call:

FNumBins := DeviceCapabilities (FDevice, FPort, DC_Bins,
                                     nil, FDeviceMode);


    FDeviceMode: PDeviceModeA;
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Freddy1990Software Engineer

Commented:
1 -
Replace DocumentProperties with DocumentPropertiesA and FDevice has to be PAnsiChar

2 -
Replace DeviceCapabilities with DeviceCapabilitiesA

Author

Commented:
No, this doesn't work

Commented:
Change
FDeviceMode: PDeviceModeA;

to

FDeviceMode: PDeviceMode;
or
FDeviceMode: PDeviceModeW;




Author

Commented:
pucko:

just do your changes, or your changes as well as those described above you?
Commented:
Just change to FDeviceMode : PDeviceMode;  

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial