Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
C++ dll in C# code
Message
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Environment versions
Environment:
C# 4.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01599867
Message ID:
01599881
Views:
68
>>Your app. needs to be able to find this DLL. I usually add the DLL to the project (not as a reference, just to the project) then select it and set "Copy to Output Directory" to "Copy always".
>
>Do you know how should I figure out the problems? I've been debugging the test. When I come up to the Invoke1 line I saw a call to Request.Dispose method (request is a separate class that implements IDisposable interface) and then the test ended. So, I assume that this call somehow interrupted the whole thing.

I'd start with the basics - what are the dependencies of the C++ DLL - are they all available? Are you absolutely sure things like pathing is what you're expecting it to be (check, don't assume)? Does it access the network - are there permission issues?

If I had the C++ code (or at least PDBs for them), I'd enable native debugging in Visual Studio, add the project into my .NET project, then set a breakpoint in the native C++ code (there are other ways to do the same thing).

The other question I'd have is what type of strings does the C++ DLL expect? Default is BSTR. If it expects anything else, you would need to specify this in the DllImport / P/Invoke code.
-Paul

RCS Solutions, Inc.
Blog
Twitter
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform