Author Topic: far pascal call  (Read 4334 times)

Offline solar_max

  • Single posting newcomer
  • *
  • Posts: 6
far pascal call
« on: January 06, 2008, 08:28:24 pm »
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.




Offline stahta01

  • Lives here!
  • ****
  • Posts: 7590
    • My Best Post
Re: far pascal call
« Reply #1 on: January 07, 2008, 04:31:04 am »
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++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline severach

  • Multiple posting newcomer
  • *
  • Posts: 44
Re: far pascal call
« Reply #2 on: February 29, 2008, 03:34:43 am »
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.