ref 不知道行不行,你试一下吧
解决方案 »
- Gridview 自动导出Excel问题
- 获取页面title的问题~~~
- 哪位帮我改下存储过程,就是除数为零时,怎么处理下,谢谢 急求!!
- 请问如何让DataGrid中绑定的DropDownList在编辑时选择默认的选项?
- 我是一个ASP.NET新手,向大家请教一个问题
- 在线求助:多文件上传后改名问题!
- 正则,解决了立即给分
- 在一个论坛的DATAGRID里的主题行前怎么做一个按钮展开回复记录
- 怎么根据数据库中的路径下载文件
- HTTP Error 403.14 - Forbidden Web 服务器被配置为不列出此目录的内容
- 在请教一个菜鸟问题--如何在弹出消息后,转向别的页面(或者重新load本页)
- 失业了!希望找一份工作
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\binto see the real entry pointdumpbin -exports YourDLL.dlllook at an example here to see how to call stdcall method:http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&selm=uuNaNF2BCHA.2768%40cpmsftngxa08
or try1. TestDll.cpp://compile with a command like
//vsvars32
//cl /LD TestDll.cpp
#include <iostream>
using namespace std;extern "C" {
__declspec(dllexport) int __stdcall TestSTDCALL(char* s1, char* s2)
{
cout << "Hello World TestSTDCALL with externc C" << endl;
cout << "argument 1:" << s1 << endl;
cout << "argument 2:" << s2 << endl;
return 1;
}
}
__declspec(dllexport) int __stdcall TestSTDCALL_CPP(char* s1, char* s2)
{
cout << "Hello World TestSTDCALL_CPP" << endl;
cout << "argument 1:" << s1 << endl;
cout << "argument 2:" << s2 << endl;
return 2;
}2. TestCpp.cs:
//use
//dumpbin -exports TestDll.dll
//to find out the real function entry pointusing System;
using System.Runtime.InteropServices;class Class1
{
[STAThread]
static void Main(string[] args)
{
Console.WriteLine("Starting...");
Console.WriteLine(TestSTDCALL("1st", "2nd"));
Console.WriteLine(TestSTDCALL_CPP("first", "second")); Console.Write("\n\nHit Enter Key to Quit...");
Console.Read();
}
[DllImport("testDLL.Dll",
CallingConvention=CallingConvention.StdCall)]
public static extern int TestSTDCALL(string s1, string s2); [DllImport("testDLL.Dll", EntryPoint="?TestSTDCALL_CPP@@YGHPAD0@Z",
CallingConvention=CallingConvention.StdCall)]
public static extern int TestSTDCALL_CPP(string s1, string s2);
}