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:
01599921
Views:
67
>>>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.
>
>If Request.Dispose() fired unexpectedly then it's a sure sign that your code threw an uncaught exception - which was probably the failure to load the DLL.
>You should add your own try/catch block.

Here is my current code:
  internal String RestoreData(String columnValue, String convertCode)
        {   
            String result = "";
            String invoke = "gethash".MakeTag("func") + (convertCode + this.nClientNumber.ToString() + "SELECT version FROM metadata").MakeTag("data");
            String translate = "";
            try
            {
                translate = Invoke1(invoke);
                if (translate.Left(4) == "OK :")
                {
                    invoke = "decryptdata".MakeTag("func") + columnValue.MakeTag("data") + translate.Substring(4).MakeTag("key");
                    result = Invoke1(invoke);
                }
            }
            catch
            {
                Logging.Log(1, "Using ww_local.dll generated an exception...");
            }
            return result;
        }
As you see, I have try/catch here. But it's getting by-passed and I see a call of Dispose method of the Request class.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform