作者:
ab710912 (Leanne)
2020-06-11 12:55:14簡單說呢..就是教授最近拿出一個古老學長寫得的程式然後是C++寫的
要我把阿改成C# 怎麼改啊!!!!
第一個是 這個
typedef void (__stdcall *fp_ABFL1dllTYPE)(double &,double &,double *,long
&,double &,double &,double &,double &,double &,double &,long &,char*,long );
fp_ABFL1dllTYPE ABFL1dll;
好像是在自定型別?
但是C#自訂型別好像是Class或是struct
但是都要先先給他一個命名?
public struct newtype
{
public int x, y;
public newtype(int p1, int p2)
{
x = p1;
y = p2;
}
}
C++好像沒有這個?
還有我看不懂 double &和 double * 是什麼
第二個是
HINSTANCE RefpropdllInstance;
RefpropdllInstance = LoadLibrary(L"./refprop.dll");
ABFL1dll = (fp_ABFL1dllTYPE) GetProcAddress(RefpropdllInstance,"ABFL1dll");
好像是在引用dll 但是好像C#沒辦法用他的dll...
另外問 是用dllImport嗎?
作者:
s4300026 (s4300026)
2020-06-13 13:11:00第一個是delegate, newtype可以用point, &對應是c# 的ref, c#對class 的傳遞是用*, double* 可以用陣列[], c#dll import 我不會,我都用c++/clr直接把c++的東西包一層