Update: UltraVNC 1.4.3.6 and UltraVNC SC 1.4.3.6: viewtopic.php?t=37885
Important: Please update to latest version before to create a reply, a topic or an issue: viewtopic.php?t=37864

Join us on social networks and share our announcements:
- Website: https://uvnc.com/
- GitHub: https://github.com/ultravnc
- Mastodon: https://mastodon.social/@ultravnc
- Facebook: https://www.facebook.com/ultravnc1
- X/Twitter: https://twitter.com/ultravnc1
- Reddit community: https://www.reddit.com/r/ultravnc
- OpenHub: https://openhub.net/p/ultravnc

C# 1SCDLL.dll Server

Post Reply
miramax281
Posts: 5
Joined: 2007-01-11 15:48

C# 1SCDLL.dll Server

Post by miramax281 »

Can anyone provide any assistance in using the 1SCDLL.dll within a C# application? I am told there are ways to use legacy DLL's with C# applications, but I cant seem to find any info on that or the various internal parts of 1SCDLL.dll. I know its closed source... but can anyone slap an example of how to use the 1SCDLL.dll as a server in C#?
If nobody here are C# savvy, I will just shoot it off to rentacoder.com :wink:
Thanks in advance fellas! :D
User avatar
Rudi De Vos
Admin & Developer
Admin & Developer
Posts: 6832
Joined: 2004-04-23 10:21
Contact:

Re: C# 1SCDLL.dll Server

Post by Rudi De Vos »

I don't know c#, but is should be exacly the same as importing any
other function from a DLL.

C++

Code: Select all

///dll import
typedef void (/*__declspec(dllimport)*/ *Start_server_fn)(char *,char *,char *,int,char *,bool,char *,bool);
typedef void (/*__declspec(dllimport)*/ *Stop_server_fn)(void);

Start_server_fn Start_server=NULL;
Stop_server_fn Stop_server=NULL;
HMODULE hDLL=NULL;

bool
ImportDLL_functions()
{
	hDLL = LoadLibrary ("1SCDLL.dll");
	if (!hDLL) return 0;
	Start_server = (Start_server_fn) GetProcAddress(hDLL,"Start_server");
	Stop_server = (Stop_server_fn) GetProcAddress(hDLL,"Stop_server");
	if (!Start_server || !Stop_server)
	{	
		// handle the error
		FreeLibrary(hDLL);
		return 0;		   
	}
	return 1;
}

void
Free_DLL_functions()
{
	if (hDLL)
		FreeLibrary(hDLL);
}

Usage: Start_server(G_IDCODE, G_CHARADRESS,G_CHARADRESS,G_PORT,Passwd,proxy,"PcHelpWare Connection",false);
miramax281
Posts: 5
Joined: 2007-01-11 15:48

Re: C# 1SCDLL.dll Server

Post by miramax281 »

Excellent! I will do a bit of trial and error and report back with my findings :)
linoter
8
8
Posts: 27
Joined: 2007-01-02 11:17
Location: Switzerland

Re: C# 1SCDLL.dll Server

Post by linoter »

I don't know how far you got. But here the code that should work:

Code: Select all

using System.Runtime.InteropServices;

class xyz
{
[DllImport("1SCVDLL.dll")] private static extern void Start_viewer(StringBuilder strID, StringBuilder strRepeaterAddr, int intListenPort, int intRepeaterPort, StringBuilder strPasswd, bool blDebug, bool blProxy, byte bytBandwidth, bool blUseDirectx);

.......
}
Thereby, the dll has to be in the same place as the exe.
Post Reply