Visual Basic Code , VB.NET Code, VB Code
  Home   :  Code   :  Forums   :  Submit   :  Mailing List   :  About   :  Contact


Calling C++ DLL from C#


Calling C++ DLL from C#

Author
Message
nicegal
nicegal
Forum God
Forum God (3.2K reputation)Forum God (3.2K reputation)Forum God (3.2K reputation)Forum God (3.2K reputation)Forum God (3.2K reputation)Forum God (3.2K reputation)Forum God (3.2K reputation)Forum God (3.2K reputation)Forum God (3.2K reputation)

Group: Forum Members
Posts: 11, Visits: 17
I have made a C++ DLL. Now I am calling it in my C# Code. I have written the following code:



using System;

using System.Collections.Generic;

using System.Text;

using System.Runtime.InteropServices; //For DllImport

namespace ExternCShar

{

class Program

{

[DllImport("MathFuncsDll.dll", CharSet = CharSet.Auto)]

public static extern double Add(double a, double b);



static void Main()

{



Console.WriteLine(Add(2.3, 4.5));

}

}

}







Now when I run this, the following error is generated:



Debug Error!



Program: ...



R6034

An application has made an attempt to load the C Runtime library without using a manifest.



This is an unsupported way to load Visual C++ DLLs. You need to modify your application to build with a manifest.



For more information, see the "Visual C++ Libraries as Shared Side-by-Side Assemblies" topic in the product documentation.











What should I do avoid this error?







Thanks.



Bina Khan.
GO



Similar Topics


Reading This Topic


Login
Existing Account
Email Address:


Password:


Social Logins

Select a Forum....

















A1VBCode Forums


Search