COleSafeArray
C / C++ / MFC
1
Posts
1
Posters
1
Views
1
Watching
-
Hi, I have trouble with this type, need help. Consider this function declaration:
SCODE SetData(VARIANT FAR* pData)
What I have is a sample code which reads in data from a file and works just fine. A COleSafeArray is passed to the function as follows:
COleSafeArray osa;
SAFEARRAYBOUND sab;
sab.cElements = file.GetLength();
sab.lLbound = 0;
osa.Create(VT_UI1, 1, &sab);void* buffer;
osa.AccessData(&buffer);
file.Read(buffer, file.GetLength());
osa.UnaccessData();SetData(osa);
I want to pass a string to this function and can't figure it out how. Please help. Bunburry