L
lifencheng
Unregistered / Unconfirmed
GUEST, unregistred user!
C:<br>HANDLE hMenu;<br>hMenu = GlobalAlloc(GMEM_MOVEABLE,sizeof(XLOPER)*5*4);<br>px = pxMenu = (LPXLOPER) GlobalLock(hMenu);<br>for (i=0; i<4; i++) {<br>for (j=0; j<5; j++) {<br>px->xltype = xltypeStr;<br>px->val.str = g_rgMenu[j];<br>px++;}<br>上面这句delphi如何写?我是这样写的,不知对否<br>delphi:<br>var hmenu:thandle;px,pxmenu:LPXLOPER;//LPXLOPER为^xloper,xloper在delphi中是record类型,可以确定的是从C中改写的数据类型是没有错的,就是以下的不明白 <br>hMenu := GlobalAlloc(GMEM_MOVEABLE,sizeof(XLOPER)*5*4);//sizeof(XLOPER)能不能取到真正的大小。<br>pxMenu := GlobalLock(hMenu);//这句是这样吗?<br>px:=pxmenu;<br>for i:=0 to 3 do<br> for j:=0 to 4 do<br> begin<br> px.str:=''; <br> inc(px);<br> end;