各位高手,我在VC中定义了一个结构,通过消息发给Delphi,Delphi中也定义了一个结构接收,可是接收到字符串总是开头少1个字符,为什么???给分!!!VC:
typedef struct MYMIN
{
char CodeName[10];
LONG l_time;
float m_fPrice;
} MyMin ;Delphi 中如何定义接收的结构啊?
typedef struct MYMIN
{
char CodeName[10];
LONG l_time;
float m_fPrice;
} MyMin ;Delphi 中如何定义接收的结构啊?
codename:array [0..9] of char;
l_time:integer;
m_fprice:real;
end;
typedef struct MYMIN
{
char CodeName[10];
LONG l_time;
float m_fPrice;
} MyMin,*PMyMin ;MyMin tMyMin;将tMyMin赋值以后,用 PostMessage(thWnd,WM_APP + 1,MyMsg,(LPARAM)(PMyMin)&tMyMin);发给delphi,delphi接收时的结构如何定义?
我的定义如下:可是就是得到的数据不正常:mymin=record
codename:array [0..9] of char;
l_time:integer;
m_fprice:real;
end;为什么?
type
Pmymin = ^mymin;
mymin=record
codename:array [0..9] of char;
l_time:integer;
m_fprice:single;
end;var
PHearder : Pmymin;
begin
PHearder := Pmymin(Msg.LParam);
showmessage(PHearder.codename);
end;其中显示的codename为乱码,为什么???
高手救急呀!!!
type
Pmymin = ^mymin;
mymin=record
codename: string[0..9] of char;
l_time: integer;
m_fprice: single;
end;
如果是一个进程的话应该无很大问题
然后,codename[10] := #0;
不知道可行,你试试。