You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
i have created a dll with 3rd library: Rabbitmq.Client(.dll)
if a function return something without facilities reference to rabbitmq . everything goes well,but when i use some function from rabbitmq.client.dll; the function can't not run as expect;
example code:
[return: MarshalAs(UnmanagedType.LPWStr)]
[DllExport]
public static string test_string([MarshalAs(UnmanagedType.LPWStr)]string content)
{
//var factory = new ConnectionFactory() { HostName = "localhost", UserName = "test", Password = "test" }; // here is the question, if i comment it , it can return content as expect,but uncomment,the exported dll will crash.
return content + "----from-c_sharp-----no--problem!";
}
anybody can give me some tips ,why this occurs? how to solve this? many thanks!
The text was updated successfully, but these errors were encountered:
your problem may be exactly from logic of using your mentioned "the Neural Networks" library: incorrect initialization, invalid data, or even null and the related unhandled exception from managed side, stack corruption, stack overflow, and lot of other bugs.
Also note, for stack problems you need to check required calling convention and try to start from basic signature without marshaling. Usually, I recommend only IntPtr because of more control. Well, it's my prefer.
But in general, your ConnectionFactory can do anything like "Neural Networks" library from #84.
Also try to isolate or catch something (about exceptions, start here #85). How about to reproduce an invoking from your trivial unmanaged side? C++ complete example see in related repo.
@3F
sorry for late reply.
In my case,after debugging, i found the reason was that i should copy the 3rd dlls to some special place, and the it worked;
thanks for this library man!!!
i have created a dll with 3rd library: Rabbitmq.Client(.dll)
if a function return something without facilities reference to rabbitmq . everything goes well,but when i use some function from rabbitmq.client.dll; the function can't not run as expect;
example code:
anybody can give me some tips ,why this occurs? how to solve this? many thanks!
The text was updated successfully, but these errors were encountered: