Click here to Skip to main content
15,894,343 members
Home / Discussions / COM
   

COM

 
GeneralRe: IZoneIdentifier interface? Pin
dandy7225-Nov-04 5:11
dandy7225-Nov-04 5:11 
GeneralRe: IZoneIdentifier interface? Pin
geo_m26-Nov-04 3:11
geo_m26-Nov-04 3:11 
GeneralRe: IZoneIdentifier interface? Pin
dandy7226-Nov-04 5:36
dandy7226-Nov-04 5:36 
QuestionHow to return a vector or an array? Pin
tpndtbk18-Nov-04 2:59
tpndtbk18-Nov-04 2:59 
AnswerRe: How to return a vector or an array? Pin
User 21559718-Nov-04 18:46
User 21559718-Nov-04 18:46 
GeneralRe: How to return a vector or an array? Pin
Steve S18-Nov-04 23:23
Steve S18-Nov-04 23:23 
GeneralRe: How to return a vector or an array? Pin
User 21559718-Nov-04 23:39
User 21559718-Nov-04 23:39 
GeneralRe: How to return a vector or an array? Pin
Steve S19-Nov-04 0:14
Steve S19-Nov-04 0:14 
Good resource would be "Essential IDL" written by Martin Gudgin, or "Essential COM" by Don Box.

If you write

HRESULT getList([out]SAFEARRAY(BSTR)*ppsa);

in your IDL for the interface method, in your C++ you have

STDMETHOD(getList)(SAFEARRAY**ppsa);

as a definition, and

STDMETHODIMP class::getList(SAFEARRAY**ppsa)
{
...
}
as your implementation. In IDL, the array type is known (and can be a simple type, like 'long' or 'DATE', or even a user defined type (structure)).

One issue is that if you're using the MIDL that came with VC++6, you might want to upgrade by downloading the Platform SDK.

In your implementation, you need to create a SAFEARRAY, and fill in the pointer properly. There must be loads of code out there, google for "SAFEARRAY IDL SOURCE" or look here[^] for some examples of more complicated stuff...

Steve S
Developer for hire
GeneralRe: How to return a vector or an array? Pin
Akshay Dave19-Nov-04 0:13
Akshay Dave19-Nov-04 0:13 
GeneralRe: How to return a vector or an array? Pin
User 21559719-Nov-04 1:21
User 21559719-Nov-04 1:21 
GeneralRe: How to return a vector or an array? Pin
Steve S19-Nov-04 8:40
Steve S19-Nov-04 8:40 
GeneralWORD Pin
Stgt16-Nov-04 22:59
Stgt16-Nov-04 22:59 
GeneralBROTHER! Pin
Jörgen Sigvardsson17-Nov-04 11:37
Jörgen Sigvardsson17-Nov-04 11:37 
GeneralRe: BROTHER! Pin
Anonymous17-Nov-04 21:05
Anonymous17-Nov-04 21:05 
GeneralRe: WORD Pin
Steve S18-Nov-04 23:26
Steve S18-Nov-04 23:26 
GeneralRe: WORD Pin
Anonymous19-Nov-04 0:49
Anonymous19-Nov-04 0:49 
GeneralRe: WORD Pin
Steve S19-Nov-04 1:07
Steve S19-Nov-04 1:07 
GeneralRe: WORD Pin
Anonymous19-Nov-04 1:54
Anonymous19-Nov-04 1:54 
GeneralUrgent!!!How to pass an array in Event in ATL/COM DLL Pin
Akshay Dave16-Nov-04 18:36
Akshay Dave16-Nov-04 18:36 
GeneralMaking MFC Doc/view COM EXE Pin
Ro_land15-Nov-04 19:25
Ro_land15-Nov-04 19:25 
GeneralMaking MFC Doc/view COM EXE Pin
Ro_land15-Nov-04 19:25
Ro_land15-Nov-04 19:25 
Generalhtml->doc conversion Pin
DavidNohejl15-Nov-04 11:35
DavidNohejl15-Nov-04 11:35 
GeneralHelp needed with extracting text and parsing word document with OLE objects Pin
Member 152066115-Nov-04 10:09
Member 152066115-Nov-04 10:09 
GeneralNeed help with WebBrowser events Pin
webboxxx115-Nov-04 5:32
webboxxx115-Nov-04 5:32 
GeneralDelphi creates empty propput procedures when it imports my DLL Pin
Gary Chapman15-Nov-04 4:59
Gary Chapman15-Nov-04 4:59 

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.