Online to find some answers, such as:
Instance variables: long il_menuDataPointer
Menuitemdata lpmenuitemdata
//the contents of the following code will lpmenuitemdata to blocks of memory il_menuDataPointer
Lpmenuitemdata. Hmenu=12345
Lpmenuitemdata. Level=1
Il_menuDataPointer=LocalAlloc//6 (0, 6)=sizeof (menuitemdata)
CopyMemory (il_menuDataPointer lpmenuitemdata, 6)
//so, if again from memory blocks to remove??
CopyMemory (lpmenuitemdata il_menuDataPointer, 6)//is very simple!
//now, I don't need this memory il_menuDataPointer
LocalFree (il_menuDataPointer)
But, this should be the first in LocalAlloc allocated memory, il_menuDataPointer this is address, again write content, and in my case structure has been in existence, and then want to get the address of the structure, masters, more action, please. Thank you,
CodePudding user response:
An estimated need pbni to solve,CodePudding user response:
__stdcall long getPointer (void * p)
{
Return (long) p;
}
Library function long GetPointer (ref structure p) "... "...
CodePudding user response:
If you don't use PBNI or don't do a DLL for this special words, such as LS as shown), you can use an intermediate memory to implement the data copy:Menuitemdata menuitemdata, ExistMenuItemData
Constant ulong cbSize=6//=sizeof (menuitemdata)
Ulong tempMem=LocalAlloc (0, cbSiz)
MenuItemData. Hmenu=12345
MenuItemData. Level=1
//copy to the temporary memory
CopyMemory (tempMem MenuItemData, cbSize)
//from the temporary memory kao out
CopyMemory (ExistMenuItemData tempMem, cbSize)
//Free Memory
LocalFree (tempMem)