Solved

Writing some code in the constructor of a COM component?

Posted on 2004-10-14
2
199 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
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 pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

867 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

17 Experts available now in Live!

Get 1:1 Help Now