Yeah, with XSharpLoadLibrary() you can only load a .Net library, not Win32 ones. For your sample, simply declare a _DLL FUNC, specifying the dll in the declaration as you would do also in VO and the simply call the function normally, with a simple "StartFunction()".
You can still use LoadLibrary() and PCALL() etc, but there's really no point to, also with the _DLL statement the dll will be loaded only when needed anyway, and you will have in addition compile time checking.
Edit: Well the above is assuming you want to call a Win32 function indeed. Or maybe you just want to call another function written in X# in another library? If that's the case, again better just reference the dll and call the function directly. Again, the dll will be loaded in memory only when it will be actually needed.
All VO codes will be move to X#. I am done "porting" to X#, building it to become an app began yesterday and a lot of "errors" mostly on ADS API calls and missing "DEFINES"
Your comments below reminds me of something. The DLL that to be loaded on is "secure key" DLL. It could be VO or C but this time I might move it to X# to minimized problems but I need an "obfuscator". Do you something to recommend?
Chris wrote:Hi Rene,
Yeah, with XSharpLoadLibrary() you can only load a .Net library, not Win32 ones. For your sample, simply declare a _DLL FUNC, specifying the dll in the declaration as you would do also in VO and the simply call the function normally, with a simple "StartFunction()".
You can still use LoadLibrary() and PCALL() etc, but there's really no point to, also with the _DLL statement the dll will be loaded only when needed anyway, and you will have in addition compile time checking.
Edit: Well the above is assuming you want to call a Win32 function indeed. Or maybe you just want to call another function written in X# in another library? If that's the case, again better just reference the dll and call the function directly. Again, the dll will be loaded in memory only when it will be actually needed.