Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Writing some code in the constructor of a COM component?

Posted on 2004-10-14
2
Medium Priority
?
206 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 500 total points
ID: 12306722
may be your code generate exception in the constructor, use try/catch and debug it.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
Article by: evilrix
Looking for a way to avoid searching through large data sets for data that doesn't exist? A Bloom Filter might be what you need. This data structure is a probabilistic filter that allows you to avoid unnecessary searches when you know the data defin…
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 be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.
Suggested Courses

636 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