Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

C++ Dll From C#


  • Please log in to reply
No replies to this topic

#1 BinaK

BinaK

  • Members
  • 2 posts
  • OFFLINE
  •  
  • Local time:05:03 PM

Posted 25 December 2007 - 10:06 AM

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 :thumbsup:;

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.

Edit: Moved topic to the more appropriate forum. ~ Animal

BC AdBot (Login to Remove)

 





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users