Solved

VC++ 6.0 - Delete a simple object from an ATL project.

Posted on 2004-04-08
2
341 Views
Last Modified: 2013-11-25
Is there a way to remove a simple object from an ATL project?

Currently I delete the .cpp & .h files and then cut the code from the .idl file.

Is there an easier way? Perhaps a reverse "New ATL Object" wizard.

Thanks
0
Comment
Question by:mmouer
2 Comments
 
LVL 14

Expert Comment

by:wayside
Comment Utility
I don't know of an easier way.

It's a difficult task in general to automate, because you'd have to parse the code looking for all the references and somehow divine what to do. For example, if I have a function that takes a pointer to a class as an argument, and I delete the class, how do I automagically modify this function to still work? I don't think it is possible.

0
 
LVL 15

Accepted Solution

by:
lakshman_ce earned 500 total points
Comment Utility
No automatic way to remove it.

If you don't want that object to be used from client side you can change the attributes of an ATL-based COM object so that the automation client cannot directly create the object. In this case, the object would be returned via a method call on another object rather than created directly.

To make an object noncreatable

Remove the OBJECT_ENTRY for the object from the ATL object map.
Add the noncreatable attribute to the co-class. For example:
[
uuid(A1992E3D-3CF0-11D0-826F-00A0C90F2851),
helpstring(MyObject),
  noncreatable
]
coclass MyObject
{
[default] interface IMyInterface;
}

-Lakshman
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

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…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
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.

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

10 Experts available now in Live!

Get 1:1 Help Now