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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SAFEARRAY problem

Status
Not open for further replies.

BorlandDave

Programmer
Jun 13, 2005
86
GB
I've got two blocks of data (data and data2). I'm trying to copy both blocks of data back-to-back into a SAFEARRAY. The first block copies ok, but what should the parametres be in the second memcpy function?

Code:
SAFEARRAYBOUND bound={dsize+dsize2,0};
psa = SafeArrayCreate(VT_UI1, 1, &bound);

if (psa == NULL)
	return E_OUTOFMEMORY;

memcpy(psa->pvData, &data, dsize);      //copy first block

memcpy(?, &data2, dsize2);    		//copy second block
 
Without thinking about it much, wouldn't it be psa->pvData + the size of data (dsize)?


James P. Cottingham
-----------------------------------------
[sup]I'm number 1,229!
I'm number 1,229![/sup]
 
When I try that I get the error:

"Size of the type 'void' is unknown or zero
 
Just as an exercise, type printing out the location of psa->pvData and the size of dsize just to see what you get. It's been awhile since I've used memcpy.


James P. Cottingham
-----------------------------------------
[sup]I'm number 1,229!
I'm number 1,229![/sup]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top