ふらっとC#,C♯,C#(初心者用) Part26at TECHふらっとC#,C♯,C#(初心者用) Part26 - 暇つぶし2ch■コピペモード□スレを通常表示□オプションモード□このスレッドのURL■項目テキスト558:デフォルトの名無しさん 08/04/05 14:10:40 >>554 C:\>type test.cpp extern "C" __declspec(dllexport) int f() { return 777; } C:\>type test.cs using System; using System.Runtime.InteropServices; namespace Test { class Test { [DllImport("test", CallingConvention=CallingConvention.Cdecl)] static extern int f(); static void Main() { Console.WriteLine(f()); } } } C:\>cl /LD /nologo test.cpp test.cpp ライブラリ test.lib とオブジェクト test.exp を作成中 C:\>csc /nologo test.cs C:\>test 777 559:545 08/04/05 16:14:51 >>558 /nologoと付けたら出来ましたが、IDEからビルドすると例外エラーです。 皆さんはアンマネージドのC++でDLLを作ってC#とかから呼び出したりしないんですか? 次ページ最新レス表示レスジャンプ類似スレ一覧スレッドの検索話題のニュースおまかせリストオプションしおりを挟むスレッドに書込スレッドの一覧暇つぶし2ch