例如:
s2k.dll中有个名为S2K_GetDataTableName的函数:
int S2K_GetDataTableName(char *DataBankName, long Index,int *Buffer_Count,
char *DataTableName);
其中 DataBankName data bank name
Index Reference pointer of data tables in the data bank
Buffer_Count Specifies the size of the buffer addressed by
DataTableName A pointer to the buffer area that receives the data table name
注意:
DataBankName cannot be more than 255 characters.
返回值:
Zero if the function completes successfully; > 0 otherwise.
请问:怎样在c#中调用这个dll,并执行该函数,特别是怎样传递参数,并获得dataTableName
s2k.dll中有个名为S2K_GetDataTableName的函数:
int S2K_GetDataTableName(char *DataBankName, long Index,int *Buffer_Count,
char *DataTableName);
其中 DataBankName data bank name
Index Reference pointer of data tables in the data bank
Buffer_Count Specifies the size of the buffer addressed by
DataTableName A pointer to the buffer area that receives the data table name
注意:
DataBankName cannot be more than 255 characters.
返回值:
Zero if the function completes successfully; > 0 otherwise.
请问:怎样在c#中调用这个dll,并执行该函数,特别是怎样传递参数,并获得dataTableName
public static extern int GetApiFunction(
string strParaA,
StringBuilder strParaB,
int intParaC,
out int intParaD,
bool blnParaE);C++数据类型和C#的部分对应关系:C++ 输入输出 C#
==================================
char chr[255] O StringBuilder
KCA_DIR I int
LPCSTR I string
int I int
LPSTR O StringBuilder
int* O out int
DWORD I int
DWORD* O out int
BOOL I bool
Rc_DBMgr I IntPtr
long* O out long
2,也可以把其他代码编写成DLL,然后在引用中加如就好了