Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CopyDataStruct

Status
Not open for further replies.

webpager

Programmer
Mar 27, 2001
166
GB
I have downloaded some information on CopyDataStruct written by Karl Nilsson but I am unable to work out the commands required:-
This is part of Karl`s code (unfortunately in VB).

Dim cds As COPYDATASTRUCT
cds.dwData = waAddFile
' = 100 (IPC_PLAYFILE)
cds.lpData = lstrcpy(filename, filename)
' Copies filename to itself. Nothing happens,
' but returns the address for the pointer to the string!
cds.cbData = Len(filename) + 1
' Reserve space for filename plus trailing null char

RetVal = CopyDataSendMessage(hWndWinamp, WM_COPYDATA, 0&, cds)

Converting to VFP is causing me a problem.
Does anyone know how to create the `CDS` part of the command line which consists of 3 seperate items of data?
 
Taking this a stage further I need to pass the following info in the CDS part of the function.
1. - 100
2. - Pointer to the string I want to send.
3. - Length of the string I want to send

I assume I use LPARAMETERS to combine the result.

I have values 1 and 3 as numbers but how do I get the pointer value?
 
Hi WP,

Unfortunately VFP does not natively support user defined types, or structs. However, since structs are simply contiguous blocks of allocated memory, it is still possible to pass/receive the memory and parse appropriately.

I'd recommend you download Christof Lange's Struct class and read the documentation:
Jon Hawkins

The World Is Headed For Mutiny,
When All We Want Is Unity. - Creed
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top