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!
Request clarification before answering.
http://sqlanywhere.blogspot.ca/2008/11/refactoring-foxhound-series.html Refactoring Foxhound: The Series
http://sqlanywhere.blogspot.ca/2009/02/get-mac-addresses-via-sql.html Get MAC Addresses Via SQL
http://sqlanywhere.blogspot.ca/2011/02/loading-32-bit-versus-64-bit-dlls.html Loading 32-bit Versus 64-bit DLLs
http://sqlanywhere.blogspot.ca/2011/02/loading-32-bit-versus-64-bit-dlls_16.html Loading 32-bit Versus 64-bit DLLs [revisited]
http://sqlanywhere.blogspot.ca/2012/12/calling-getopenfilename-from-sql.html Calling GetOpenFileName() From SQL
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.