ふらっとC#,C♯,C#( ..
545:デフォルトの名無しさん
08/04/05 12:17:31
アンマネージドのC++で作ったDLLの関数をC#で使いたいのですが
DLL 'testdll.dll' の 'f'' というエントリ ポイントが見つかりません。
と例外が出てしまいます。
やり方が間違っているのでしょうか?
DLL側は
class c
{
public:
static __declspec(dllexport) int f();
};
int c::f()
{
return 777;
}
C#側は
using System.Runtime.InteropServices;
using System;
namespace ConsoleApplication1
{
class Program
{
[DllImport("testdll.dll")]
public static extern int f();
static void Main(string[] args)
{
Console.WriteLine(f());
}
}
}
こんな感じになってます。
testdll.dllとtestdll.libはC#側のフォルダに入れてます。
次ページ続きを表示1を表示最新レス表示スレッドの検索類似スレ一覧話題のニュースおまかせリスト▼オプションを表示暇つぶし2ch
4346日前に更新/161 KB
担当:undef