DLL Import Errors

Hello,

I’m really new to Unity and I try to load a c++ .dll into my unity script.

Heres my Problem.

The C++ Projekt have one Method in the .cpp:

    	bool Connect(string c_szAddr) {
    		return true;
    }

And thats the .h Part:

extern "C" { __declspec(dllexport) bool Connect(string c_szAddr); }

Now I load the dll and try to pass a string value to my C++ Method:

       [DllImport("LoginRess")]
        private static extern bool Connect(string c_szAddr);
    
        public void __cplusplusconnect(string name, string password)
        {
            Debug.Log(Connect(CONFIG.IP));
        }

If I use this function…I get a strange error:
75133-unity-2016-07-30-13-12-37.png

And the Unity Editor Dies after this^^. The Strange Thing is, when I use my Method without any param…theres no error.
Thank you for any help.

I have found the problem

         bool Connect(string c_szAddr) {
             return true;
     }

I don’t know why, but it CAN’T get the param as a string. Here it must be const char*…