I am trying to get in contact with the MATLAB-engine-dll (libeng.dll).
It seemes to be a strange dll.
First i tried this (with the function engOpen):
No luck.
Then i tried:
No luck. LoadLibrary returned 0.
Then i tried this:
This is a litle better. hEngineModule and lpfnengOpen are positive and the function returns a positive value.
But the overall functioning of the functions are not correct.
Observe the - 1 in the GetProcAddress-line.
If i dont add this i get a gpf.
Anybody got a clue?
Regards
Peter
------------------
[This message has been edited by Peter Stephensen (edited July 05, 2000).]
It seemes to be a strange dll.
First i tried this (with the function engOpen):
Code:
declare function engOpen cdecl lib "libeng.dll" alias "engOpen"(s as asciiz) as dword
Then i tried:
Code:
global hEngineModule as long declare function ProtoType_engOpen cdecl (s as asciiz) as dword function engOpen(startcmd as string) as long static lpfnengOpen as dword local ret as long local zstartcmd as asciiz*128 : zstartcmd = startcmd if hEngineModule = 0 then hEngineModule = LoadLibrary($MATLAB & "\libeng.dll") if hEngineModule = 0 then exit function if lpfnengOpen = 0 then lpfnengOpen = GetProcAddress(hEngineModule, "engOpen") if lpfnengOpen = 0 then exit function call dword lpfnengOpen using ProtoType_engOpen(zstartcmd) to ret function = ret end function
Then i tried this:
Code:
%DONT_RESOLVE_DLL_REFERENCE = &H000001 global hEngineModule as long declare function ProtoType_engOpen cdecl (s as asciiz) as dword function engOpen(startcmd as string) as long static lpfnengOpen as dword local ret as long local zstartcmd as asciiz*128 : zstartcmd = startcmd if hEngineModule = 0 then hEngineModule = LoadLibraryEx($MATLAB & "\libeng.dll", 0, %DONT_RESOLVE_DLL_REFERENCE) if hEngineModule = 0 then exit function if lpfnengOpen = 0 then lpfnengOpen = GetProcAddress(hEngineModule, "engOpen") - 1 if lpfnengOpen = 0 then exit function call dword lpfnengOpen using ProtoType_engOpen(zstartcmd) to ret function = ret end function
But the overall functioning of the functions are not correct.
Observe the - 1 in the GetProcAddress-line.
If i dont add this i get a gpf.
Anybody got a clue?
Regards
Peter
------------------
[This message has been edited by Peter Stephensen (edited July 05, 2000).]
Comment