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

Crash app in C# .NET 4.X

Developers may discuss here
Post Reply
romigrabarz
Posts: 1
Joined: 2016-08-09 06:13

Crash app in C# .NET 4.X

Post by romigrabarz »

My code:

Code: Select all

[DllImport("1SCDLL.dll")]
        public static extern void Start_server(string strID, string strRepeaterAddr, string Hostname, int intPort, string strPasswd, bool blProxy);

        [DllImport("1SCDLL.dll")]
        public static extern void Stop_server();

        private void StartSrv_Click(object sender, RoutedEventArgs e)
        {
            Start_server("", "", "localhost", 5500, "", false);
        }

        private void StopSrv_Click(object sender, RoutedEventArgs e)
        {
            Stop_server();
        }
When I target framework to 4.0/4.5/4.6, my app crash while fire Start_server method.
But in .NET 3.5 throws DllNotFoundException: A dynamic link library (DLL) initialization routine failed. (Exception from HRESULT: 0x8007045A).
I have all depends dll on my bin folder:
- 1SCDLL.dll
- 1SCVDLL.dll
- 1CHATDLL.dll
- SCHook.dll
User avatar
Rudi De Vos
Admin & Developer
Admin & Developer
Posts: 6831
Joined: 2004-04-23 10:21
Contact:

Re: Crash app in C# .NET 4.X

Post by Rudi De Vos »

Check following links



http://forum.ultravnc.info/viewtopic.ph ... 4cb#p35927

http://www.mycsharp.de/wbb2/thread.php?postid=3714797


PCHelpware server-side DLL's wrapped in a C# application - uploaded here:

http://drunkardswalk.dk/Files/PCHW_Demo.zip

Features:
Will add itself to Windows Firewall Exception list.

Port, username, address etc can be specified in .exe.config and the app will launch using those settings.

Settings can also be specified on the command line, and will then override .exe.config.

If there are no settings specified in either .exe.config or command line, they can be specified using the GUI.

Bugs: Does not always disconnect automatically after failing to connect.

I have so far used it to provide support from Denmark to locations in:
Denmark, The Faroe Islands, Romania and Holland ;P
shsouza
Posts: 2
Joined: 2016-11-14 18:39

Re: Crash app in C# .NET 4.X

Post by shsouza »

Hi, the provided sample is not working on VS 2015, seems to be some incompatibility in 1SCDLL.dll... I have tried to run PcHelpware_SC code and the same problem occurs.

1SCVDLL.dll works fine.

Can you help? please
shsouza
Posts: 2
Joined: 2016-11-14 18:39

Re: Crash app in C# .NET 4.X

Post by shsouza »

I figured out what's going on, looks like 1SCDLL.dll is not compatible with DEP... turning DEP to "No (/NXCOMPAT:NO)" worked for me.
Post Reply