N
news.microsoft.com
c++:
extern "C"
__declspec(dllexport)
int myHWGetPhrase(WORD lpInFileName, WORD* lpOutFileName,int sta[2])
{
if (lpInFileName==111)
{
WORD SM[]={1111,2222};
lpOutFileName=SM;
int YM[]={1,2};
sta=YM;
return 21;
}
return 23;
}
----------------------------------------------------------------------------
c#:
[DllImport("HWLX.dll", EntryPoint="myHWGetPhrase", SetLastError=true)]
internal static extern int myHWGetPhrase(ushort lpInFileName, ushort[]
lpOutFileName,int[] sta);
private void button1_Click(object sender, System.EventArgs e) {
ushort[] b=new ushort[2] ;
int[] c=new int[2];
ushort z=111;
int a=myHWGetPhrase(z,b,c);
Console.Write(a.ToString());
}
When it run , a return 21, but b and c , no returned value .
extern "C"
__declspec(dllexport)
int myHWGetPhrase(WORD lpInFileName, WORD* lpOutFileName,int sta[2])
{
if (lpInFileName==111)
{
WORD SM[]={1111,2222};
lpOutFileName=SM;
int YM[]={1,2};
sta=YM;
return 21;
}
return 23;
}
----------------------------------------------------------------------------
c#:
[DllImport("HWLX.dll", EntryPoint="myHWGetPhrase", SetLastError=true)]
internal static extern int myHWGetPhrase(ushort lpInFileName, ushort[]
lpOutFileName,int[] sta);
private void button1_Click(object sender, System.EventArgs e) {
ushort[] b=new ushort[2] ;
int[] c=new int[2];
ushort z=111;
int a=myHWGetPhrase(z,b,c);
Console.Write(a.ToString());
}
When it run , a return 21, but b and c , no returned value .