• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 210
  • Last Modified:

Writing some code in the constructor of a COM component?

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
manoj_johar
Asked:
manoj_johar
1 Solution
 
AxterCommented:
Please post your code.

Post the complete constructor code, and exactly what you're commenting out.
0
 
OnegaZhangCommented:
may be your code generate exception in the constructor, use try/catch and debug it.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Tackle projects and never again get stuck behind a technical roadblock.
Join Now