cancel
Showing results for 
Search instead for 
Did you mean: 
Subscribe

Hi,

I am trying to call some Win32API external functions in kernel32.dll from within SQL Anywhere 12.0.1 database server. Everything works well on 32-bit Windows (XP and 7), but nothing works on 64-bit Windows (7 and 8).

When I declare a function WITHOUT the LANGUAGE clause on 32-bit Windows, the function executes normally. When I do the same on 64-bit Windows I get the following error message:
"Version 'V0' interface used by external function call 'FunctionName' is not supported for execution in the current context."

When I declare a function WITH the LANGUAGE clause (C___ESQL32 or C_ESQL64) the error message disappears, the function seems to execute, but "does nothing". I can't get any return value or OUT arguments, everything is NULL. Executing functions in the external context (with the LANGUAGE clause) doesn't work at all, even on 32-bit Windows.

I have installed the latest EBF, tried with database engine and server, disabled antivirus and firewall - nothing helps. I have tried several Win32API functions: GetVersion, GetCurrentDirectoryA, GetVolumeInformationA, MessageBoxA, ... but here is the simplest example with a function that has no arguments:

create function SFGetVersion ( )  
returns integer  
external name '[email protected]' language C_ESQL32 (or C_ESQL64 for 64-bit Win);

select SFGetVersion();

Where do I make mistake? Could anyone manage to get this function execute successfully in any context on 32-bit and 64-bit Windows? Is it possible at all to call Win32API functions from within SQL Anywhere server (I suppose it is - it works on 32-bit Win)?

Any help would be welcome. Thanks!

View Entire Topic
Breck_Carter
Participant
Former Member
0 Likes

Great links, thanks!