News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

far pascal call

Started by solar_max, January 06, 2008, 08:28:24 PM

Previous topic - Next topic

solar_max

Hi,

I try to use some functions coming from a DLL, but my problem is the "far pascal" call. Like this :

Header file
typedef short far pascal (* TMEX_GET_VERSION)          (char far *);
extern TMEX_GET_VERSION            Get_Version ;
...
*.cpp
Get_Version = (TMEX_GET_VERSION) (GetProcAddress (hMainDLL, "Get_Version"));

this give me the following error

"far does not name a type"


Without the "far pascal" it's ok for the compiler and the linker ... but crash at execution time.




stahta01

I suggest asking this on a programming language forum, I am guessing C Language; might look for one that supports your compiler what ever it is.

Tim S
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

severach

Sounds like you have a Win16 DLL since the pascal calling sequence is next to impossible to get in Win32 compilers. "far" disappeared in Win32 and pascal was banished.

calling conventions

You could try to hand code in assembly a call to the function that follows pascal rules but if it were that easy I'd be able to find something about calling Win16 DLL from Win32 on Google. It appears that Win32s was the last platform that is able to call a 16 bit dll. Find a compiler that makes Win32s executables.

Get a new DLL or try Digital Mars and OpenWatcom for Win32s or work backwards through old versions until you find the pascal calling sequence.