Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2008-01

Where to find WinProcs or equivalent unit

4 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Cleverson

Hi,

Using FreePascal, I'm trying to compile an open source project written originally in Delphi 6.

Some units require Winprocs, for accessing
functions such as GetPrivateProfileString. I didn't find it amongst FreePascal's installed units. I searched it in Google and got a WinProcs unit from the following adress, but FPC gives lots of errors while trying to compile it:
http://inf.unisul.br/~osmarjr/download/delphi/units/winprocs.zip

Where can I get either WinProcs or something equivalent for FreePascal ?

Many thanks
Cleverson

Giuliano Colla
to Cleverson

Cleverson ha scritto:

Show quoted text 14 lines
Hi, Using FreePascal, I'm trying to compile an open source project written originally in Delphi 6. Some units require Winprocs, for accessing functions such as GetPrivateProfileString. I didn't find it amongst FreePascal's installed units. I searched it in Google and got a WinProcs unit from the following adress, but FPC gives lots of errors while trying to compile it: http://inf.unisul.br/~osmarjr/download/delphi/units/winprocs.zip Where can I get either WinProcs or something equivalent for FreePascal ?

The function GetPrivateProfileString is in the fpc Windows32 API Library. A quick look to Winprocs shows that also other functions defined there should be in the windows unit.
A "uses windows" clause in place of "uses Winprocs" should solve your problem (hopefully :-) )

A hint. Even if you're not using GUI, you may take advantage of Lazarus to help you in may ways. Lazarus IDE has:

a powerful "Find in files" tool, which makes it possible to quickly locate the units you need (it was a matter of seconds to locate the function you required)

a powerful editor: you just pass the cursor over a string and a pop-up will tell you where the variable/function/object is defined. Right click and you may "find declaration": it'll open the file for you positioned at the definition. Right click again and "jump to procedure", etc etc.

You may use Lazarus IDE to set your project options, your compiler options, to create clean packages which include all the relevant information

Giuliano

Giuliano Colla Whenever people agree with me, I always feel I must be wrong (O. Wilde)
Marco van de Voort
to Cleverson: Using FreePascal, I'm trying to compile an open source project written originally in…
Show quoted text 11 lines
Using FreePascal, I'm trying to compile an open source project written originally in Delphi 6. Some units require Winprocs, for accessing functions such as GetPrivateProfileString. I didn't find it amongst FreePascal's installed units. I searched it in Google and got a WinProcs unit from the following adress, but FPC gives lots of errors while trying to compile it: http://inf.unisul.br/~osmarjr/download/delphi/units/winprocs.zip Where can I get either WinProcs or something equivalent for FreePascal ?

WinProcs is a Windows 3.1x (TPW/D1) compability unit. Later versions alias it to the windows unit as far as I know. FPC never supported 16-bit backwards compat, so then it finally has to be updated :-)

More windows functions can be found in the jwa* units, and other units in the "winunits" package(s).

Cleverson
Giuliano wrote 5 lines
The function GetPrivateProfileString is in the fpc Windows32 API Library. A quick look to Winprocs shows that also other functions defined there should be in the windows unit. A "uses windows" clause in place of "uses Winprocs" should solve your problem (hopefully :-) )

Thank you. I'm still with some small problems but my unit have compiled successfully. Thanks for the hint on Lazarus too. I'll give it a try.

Cleverson