Click here to Skip to main content
16,016,501 members
Home / Discussions / COM
   

COM

 
GeneralRe: Netmeeting 3 -- help! Pin
aniel15-Oct-01 8:15
aniel15-Oct-01 8:15 
GeneralCWnd inside a COleControl does'nt work Pin
Remi Morin12-Oct-01 5:38
Remi Morin12-Oct-01 5:38 
GeneralDCOMCNFG and InstallShield Pin
Firoz12-Oct-01 3:03
Firoz12-Oct-01 3:03 
GeneralRe: DCOMCNFG and InstallShield Pin
Tim Smith12-Oct-01 3:11
Tim Smith12-Oct-01 3:11 
GeneralRe: DCOMCNFG and InstallShield Pin
Firoz14-Oct-01 19:26
Firoz14-Oct-01 19:26 
QuestionHOWTO: Pass VB string into VC++ created ATL Object? Pin
Tim Rymer11-Oct-01 10:31
Tim Rymer11-Oct-01 10:31 
AnswerRe: HOWTO: Pass VB string into VC++ created ATL Object? Pin
Chris Losinger11-Oct-01 10:33
professionalChris Losinger11-Oct-01 10:33 
GeneralCOM client structure Pin
Peter Molnar11-Oct-01 8:29
Peter Molnar11-Oct-01 8:29 
Sirs,

this is my first COM adventure so I need your advise.
I have an in process server with lots of interfaces and even more methods in it.
The manufacturer of the dll provides a sample code snippet of how to get pointers to all the interfaces:

//First object
HRESULT hr = ::CoCreateInstance(... 
if ( !FAILED( hr ) ) {

   //First interface
   hr = pIUnknown->QueryInterface(... 
   if ( !FAILED( hr ) ) {
        
      //Second interface
      hr = pIUnknown->QueryInterface(...
      if ( !FAILED( hr ) ) {

         //Third interface
         hr = pIUnknown->QueryInterface(...
         if ( !FAILED( hr ) ) {
            ...
            //Here comes the code that uses the interfaces
            ...
         } else {
            ...//Third interface failed
         }
      } else {
         ...//Second interface failed
      }
   } else {
      ...//First interface failed
   }
} else {
...//CreateInstance failed
} 


Why are the QI calls NESTED? I tried putting them after each other but the same code taken from the nested structure didn't work (Runtime library: abnormal program termination) although all interfaces were succesfully created.
I would like to create the appropriate interfaces in my dialogs' OnInitdialogs and release in the OnDestroyWindow. Is that possible? Any sugggestions?

Thanks for your help in advance.



Bunburry

A subject that is beautiful in itself gives no suggestion to the Artist. It lacks imperfection. (O.Wilde)
GeneralRe: COM client structure Pin
Amit Dey13-Oct-01 6:21
Amit Dey13-Oct-01 6:21 
GeneralRe: COM client structure Pin
Michael Dunn13-Oct-01 7:56
sitebuilderMichael Dunn13-Oct-01 7:56 
QuestionWhere I have to call CoUnInitialize function if I have COM interfaces in (MFC) application main class? Pin
Rula Ghabbiesh11-Oct-01 5:42
Rula Ghabbiesh11-Oct-01 5:42 
AnswerRe: Where I have to call CoUnInitialize function if I have COM interfaces in (MFC) application main class? Pin
Shadi Al-Kahwaji12-Oct-01 9:05
Shadi Al-Kahwaji12-Oct-01 9:05 
AnswerRe: Where I have to call CoUnInitialize function if I have COM interfaces in (MFC) application main class? Pin
Michael Dunn12-Oct-01 16:06
sitebuilderMichael Dunn12-Oct-01 16:06 
GeneralRe: Where I have to call CoUnInitialize function if I have COM interfaces in (MFC) application main class? Pin
Rula Ghabbiesh14-Oct-01 22:00
Rula Ghabbiesh14-Oct-01 22:00 
GeneralRe: Where I have to call CoUnInitialize function if I have COM interfaces in (MFC) application main class? Pin
Michael Dunn14-Oct-01 22:05
sitebuilderMichael Dunn14-Oct-01 22:05 
GeneralPassing a COM interface to an out of process COM object Pin
Jeremy Pullicino11-Oct-01 3:33
Jeremy Pullicino11-Oct-01 3:33 
GeneralRe: Passing a COM interface to an out of process COM object Pin
John Smith11-Oct-01 5:06
John Smith11-Oct-01 5:06 
GeneralRe: Passing a COM interface to an out of process COM object Pin
Shadi Al-Kahwaji11-Oct-01 5:30
Shadi Al-Kahwaji11-Oct-01 5:30 
GeneralRe: Passing a COM interface to an out of process COM object Pin
Marc Britten11-Oct-01 7:08
Marc Britten11-Oct-01 7:08 
GeneralRe: Passing a COM interface to an out of process COM object Pin
Jeremy Pullicino11-Oct-01 21:13
Jeremy Pullicino11-Oct-01 21:13 
GeneralRe: Passing a COM interface to an out of process COM object Pin
Jeremy Pullicino11-Oct-01 22:44
Jeremy Pullicino11-Oct-01 22:44 
GeneralRe: Passing a COM interface to an out of process COM object Pin
13-Oct-01 15:39
suss13-Oct-01 15:39 
GeneralSysFreeString Pin
10-Oct-01 23:10
suss10-Oct-01 23:10 
GeneralRe: SysFreeString Pin
13-Oct-01 15:41
suss13-Oct-01 15:41 
GeneralDCOM security on XP Pin
Tim Smith9-Oct-01 13:02
Tim Smith9-Oct-01 13:02 

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.