VO Code Translate to X#

Public support forum for peer to peer support with related to the Visual Objects and Vulcan.NET products
Post Reply
User avatar
rjpajaron
Posts: 364
Joined: Fri Nov 06, 2015 12:01 am

VO Code Translate to X#

Post by rjpajaron »

Hello,

How to write this to X#:

Code: Select all

	hDll := _VOLoadLibrary("DLL.dll")
	
	IF hDll != NULL_PTR
		pProcAdr := GetProcAddress(hDll,PSZ("StartFunction"))
		IF pProcAdr != NULL_PTR
			PCALL(pProcAdr)
		ENDIF
	ELSE
		? "Could not load DLL.dll."+CRLF2;
					+"That's bad news..."
		
		hDll := NULL_PTR
	ENDIF

XSharpLoadLibrary return an Assembly.

Thanks a lot....

---

Rene
User avatar
Chris
Posts: 4562
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

VO Code Translate to X#

Post by Chris »

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.
Chris Pyrgas

XSharp Development Team test
chris(at)xsharp.eu
User avatar
rjpajaron
Posts: 364
Joined: Fri Nov 06, 2015 12:01 am

VO Code Translate to X#

Post by rjpajaron »

Hi Chris,

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.
User avatar
Chris
Posts: 4562
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

VO Code Translate to X#

Post by Chris »

Hi Rene,

Not myself. I have never used one, but I know several people here have been using obfuscators for a few years now, hopefully someone will step in!
Chris Pyrgas

XSharp Development Team test
chris(at)xsharp.eu
User avatar
vzeljko
Posts: 35
Joined: Wed Sep 28, 2016 8:02 pm

VO Code Translate to X#

Post by vzeljko »

I use neo-ConfuserEx obfuscator and for me it works fine.
It is free and open-source.
https://github.com/XenocodeRCE/neo-ConfuserEx

Zeljko
Post Reply