Click here to Skip to main content
15,916,463 members
Home / Discussions / COM
   

COM

 
AnswerRe: How to SendMessage to a windowless Ctrl Pin
MartinOrtiz31-Jul-03 12:24
MartinOrtiz31-Jul-03 12:24 
GeneralCOM+ / MSMQ Pin
sam_jr24-Jul-03 17:05
sam_jr24-Jul-03 17:05 
GeneralRe: COM+ / MSMQ Pin
ICBM25-Jul-03 15:02
ICBM25-Jul-03 15:02 
GeneralClosing document in Word under Automation Pin
Dave Loeser24-Jul-03 4:52
Dave Loeser24-Jul-03 4:52 
Generalword automation Pin
Jason Henderson23-Jul-03 10:06
Jason Henderson23-Jul-03 10:06 
GeneralArrays of IUnknown.. Pin
ICBM22-Jul-03 0:27
ICBM22-Jul-03 0:27 
GeneralRe: Arrays of IUnknown.. Pin
valikac22-Jul-03 8:56
valikac22-Jul-03 8:56 
GeneralRe: Arrays of IUnknown.. Pin
first_sandy25-Jul-03 3:40
first_sandy25-Jul-03 3:40 
Hi Ian,

You can create a safe array of variants and then put the array in the variant and pass to the client.
Like :
SAFEARRAY *pSA =NULL;
SAFEARRAYBOUND sabound;
sabound.cElements = nCount; //Array size.
sabound.lLbound = 0;

pSA = SafeArrayCreate(VT_VARIANT, 1, sabound);
long nIterator = 0;
//in a loop put the values.
hr = SafeArrayPutElement(pSA, nIterator, (void *)&vaPutValue);
VARIANT vaResult;
VariantInit(&vaResult);

V_VT(&vaResult) = VT_ARRAY | VT_VARIANT;
V_ARRAY(&vaResult) = pSA;

return vaResult;

At client side, you can write it like:

Dim vaDocList as Variant

vaDocList = m_pClass.GetArray() 'm_pClass is the reference to co-class.
get bounds like
nUBound = UBound(vaDocList)
nLBound = LBound(vaDocList)

in a loop get values in the variables as per ur requirement.
i feel it will help you.

Blush | :O

sandy

Last night i realized, i was seeing a dream in my dream.
GeneralRe: Arrays of IUnknown.. Pin
ICBM25-Jul-03 13:44
ICBM25-Jul-03 13:44 
QuestionHow to prevent binding a Type library to a ATL Attributed DLL ? Pin
talhalfon21-Jul-03 22:39
talhalfon21-Jul-03 22:39 
GeneralIE plugin Pin
nettrinity20-Jul-03 17:04
nettrinity20-Jul-03 17:04 
GeneralRe: IE plugin Pin
ashxly21-Jul-03 18:41
ashxly21-Jul-03 18:41 
GeneralRe: IE plugin Pin
nettrinity21-Jul-03 21:35
nettrinity21-Jul-03 21:35 
GeneralRe: IE plugin Pin
ashxly21-Jul-03 18:41
ashxly21-Jul-03 18:41 
GeneralOCX issue Pin
carb18-Jul-03 9:58
carb18-Jul-03 9:58 
GeneralGetting an Explorer history item URL Pin
yarp18-Jul-03 0:06
yarp18-Jul-03 0:06 
GeneralCOM Support in new Windows OS Pin
Paul Roullier17-Jul-03 2:58
Paul Roullier17-Jul-03 2:58 
GeneralRe: COM Support in new Windows OS Pin
Michael P Butler22-Jul-03 4:38
Michael P Butler22-Jul-03 4:38 
GeneralDisplay name of components Pin
first_sandy16-Jul-03 21:14
first_sandy16-Jul-03 21:14 
GeneralRe: Display name of components Pin
Vi216-Jul-03 21:23
Vi216-Jul-03 21:23 
GeneralRe: Display name of components Pin
first_sandy16-Jul-03 22:27
first_sandy16-Jul-03 22:27 
GeneralRe: Display name of components Pin
Vi216-Jul-03 22:52
Vi216-Jul-03 22:52 
GeneralRe: Display name of components Pin
first_sandy16-Jul-03 23:00
first_sandy16-Jul-03 23:00 
GeneralRe: Display name of components Pin
Vi217-Jul-03 18:03
Vi217-Jul-03 18:03 
GeneralRe: Display name of components Pin
Mil1017-Jul-03 18:47
Mil1017-Jul-03 18:47 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.