Crash app in C# .NET 4.X

Developers may discuss here.

Crash app in C# .NET 4.X

Postby romigrabarz » 2016-08-09 06:36

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
romigrabarz
 
Posts: 1
Joined: 2016-08-09 06:13

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

Postby Rudi De Vos » 2016-08-09 22:20

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
Rudi De Vos
Admin & Developer
Admin & Developer
 
Posts: 5370
Joined: 2004-04-23 10:21

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

Postby shsouza » 2016-11-14 18:49

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

Postby shsouza » 2016-11-23 17:36

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.
shsouza
 
Posts: 2
Joined: 2016-11-14 18:39


Return to Developer discussions (mainly user-mode)

Who is online

Users browsing this forum: No registered users and 1 guest

cron