Click here to Skip to main content
15,903,012 members
Home / Discussions / COM
   

COM

 
QuestionHow to enter CLSID in registry? Pin
SanjaySMK30-Dec-08 22:10
SanjaySMK30-Dec-08 22:10 
AnswerRe: How to enter CLSID in registry? Pin
Garth J Lancaster30-Dec-08 23:07
professionalGarth J Lancaster30-Dec-08 23:07 
AnswerRe: How to enter CLSID in registry? Pin
Randor 3-Jan-09 12:01
professional Randor 3-Jan-09 12:01 
QuestionHow to catch CUT event of word file in windows xplorer? Pin
SNI25-Dec-08 22:24
SNI25-Dec-08 22:24 
AnswerRe: How to catch CUT event of word file in windows xplorer? Pin
PC Player26-Dec-08 8:58
PC Player26-Dec-08 8:58 
GeneralRe: How to catch CUT event of word file in windows xplorer? Pin
SNI28-Dec-08 19:11
SNI28-Dec-08 19:11 
QuestionQueryInterface Regarding.... Pin
ganesa moorthy19-Dec-08 4:31
ganesa moorthy19-Dec-08 4:31 
AnswerRe: QueryInterface Regarding.... Pin
Roger Stoltz19-Dec-08 5:07
Roger Stoltz19-Dec-08 5:07 
Unless the second object is aggregated in the COM sense, i.e. it's a server that lives inside another server, thou-shall-not-create-objects-with-QueryInterface!
QueryInterface has a well-defined purpose and functionality: you ask a COM object you already have an interface to for another interface, the object returns that interface if it implements it and fails with E_NOINTERFACE if it does not implement the requested interface.
If such functionality is desired you should create an interface function that clearly says it will create another COM object.

ganesa moorthy wrote:
if i am releasing the first object which i got using CreateInstance, then subsequently the objects which are created using that will be removed from memory right?


Not if the object still has clients, i.e. it's reference count has not reached zero.

It looks to me as you two objects are too tightly connected.
If you make them available in the same server (COM object) but perhaps reachable from different interfaces, you can use QueryInterface correctly.
Another alternative is to make the two objects less connected and actually have two different COM objects.


"It's supposed to be hard, otherwise anybody could do it!" - selfquote
"High speed never compensates for wrong direction!" - unknown


QuestionCOM and COM+ ? Pin
sajjadlashari18-Dec-08 17:35
sajjadlashari18-Dec-08 17:35 
AnswerRe: COM and COM+ ? Pin
CPallini23-Dec-08 2:58
mveCPallini23-Dec-08 2:58 
AnswerRe: COM and COM+ ? Pin
PC Player26-Dec-08 9:09
PC Player26-Dec-08 9:09 
AnswerRe: COM and COM+ ? Pin
guestcat29-Jan-09 5:50
guestcat29-Jan-09 5:50 
QuestionIssue with SysFreeString... Pin
ganesa moorthy17-Dec-08 17:54
ganesa moorthy17-Dec-08 17:54 
AnswerRe: Issue with SysFreeString... Pin
Jonathan Davies18-Dec-08 2:38
Jonathan Davies18-Dec-08 2:38 
GeneralRe: Issue with SysFreeString... Pin
ganesa moorthy18-Dec-08 2:42
ganesa moorthy18-Dec-08 2:42 
GeneralRe: Issue with SysFreeString... Pin
Jonathan Davies18-Dec-08 2:56
Jonathan Davies18-Dec-08 2:56 
AnswerRe: Issue with SysFreeString... Pin
GuimaSun29-Jan-09 8:50
GuimaSun29-Jan-09 8:50 
QuestionAn activex control to run VLC player from command line Pin
rajjesh16-Dec-08 15:03
rajjesh16-Dec-08 15:03 
QuestionObtaining COM DLL output with free tools Pin
Zeddan15-Dec-08 22:54
Zeddan15-Dec-08 22:54 
AnswerRe: Obtaining COM DLL output with free tools Pin
Baltoro27-Dec-08 7:51
Baltoro27-Dec-08 7:51 
QuestionDefining struct in IDL file Pin
KASR114-Dec-08 20:12
KASR114-Dec-08 20:12 
QuestionWhy COM DLL Fails in one system and working fine in another system? Pin
ganesa moorthy14-Dec-08 16:51
ganesa moorthy14-Dec-08 16:51 
QuestionWrite Speed supported by drive Pin
Kiren Mukherjee11-Dec-08 19:53
Kiren Mukherjee11-Dec-08 19:53 
QuestionWhy COM Pin
Varghese Paul M10-Dec-08 22:21
Varghese Paul M10-Dec-08 22:21 
AnswerRe: Why COM Pin
Fernando A. Gomez F.11-Dec-08 5:41
Fernando A. Gomez F.11-Dec-08 5:41 

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.