Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Developing U++ » U++ Developers corner » far pascal function pointer
far pascal function pointer [message #46609] Fri, 10 June 2016 12:08 Go to previous message
NilaT is currently offline  NilaT
Messages: 70
Registered: November 2011
Location: Austria
Member
Hello everyone,

I'm having troubles getting some functions of a loaded dll.
Important notice, I still use 2010 upp sources.

So, the problem is, I load a library using LoadLibraryEx.
After that I get the function pointers using GetProcAddress.

Now, when I want to call the functions, my program crashes with a "__report_gsfailure()" message to kernel32.dll.

Other dlls work fine, but one particular doesn't want to.
So, maybe it's because the functions in the dll are declared as "far pascal".
Here, take a look at the .h of the dll:
#ifdef __cplusplus
   extern "C" {
__declspec(dllimport) short pascal Get_Version(char *);
}
#else
extern short far pascal Get_Version(char far *);
#endif


I want to test that, but adding "far pascal" to the definition won't compile.
For example, the function:
short (*Get_Version)(char* ID_buf);

How do I add "far pascal" to it?!
Because
short far pascal (*Get_Version)(char* ID_buf);
won't work...

Maybe "far" is unnecessary, since 32 bit architecture don't need them anymore, but "pascal" could be the reason for the errors.
Or am I missing something here?!

Any help appreciated.
Thanks in advance.

[Updated on: Fri, 10 June 2016 12:32]

Report message to a moderator

 
Read Message
Read Message
Previous Topic: seems incompatible with mingw
Next Topic: StdDisplayClass - a very useful class. Expand for all fonts
Goto Forum:
  


Current Time: Fri Nov 27 03:47:21 CET 2020

Total time taken to generate the page: 0.00978 seconds