ふらっとC#,C♯,C#(初心者用) Part26at TECH
ふらっとC#,C♯,C#(初心者用) Part26 - 暇つぶし2ch545:デフォルトの名無しさん
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