Solved

Writing some code in the constructor of a COM component?

Posted on 2004-10-14
2
200 Views
Last Modified: 2010-04-01
Hi,
  I created a COM component using theATL wizard. I added an interface IX. I implemented this interace in a class CIX. I added a member variable to CIX...this is actually a _ConnectionPtr object. Now, I wrote some code in the constructor of CIX to initialize the connection object.
  But my CoCreate instance is failing now! If I comment out the code in the constructor things work fine! Wats the matter?

0
Comment
Question by:manoj_johar
2 Comments
 
LVL 30

Expert Comment

by:Axter
ID: 12306317
Please post your code.

Post the complete constructor code, and exactly what you're commenting out.
0
 
LVL 12

Accepted Solution

by:
OnegaZhang earned 250 total points
ID: 12306722
may be your code generate exception in the constructor, use try/catch and debug it.
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now