Solved

Writing some code in the constructor of a COM component?

Posted on 2004-10-14
2
198 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
Comment Utility
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
Comment Utility
may be your code generate exception in the constructor, use try/catch and debug it.
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
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.

772 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

15 Experts available now in Live!

Get 1:1 Help Now