Solved

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

Posted on 2004-04-08
2
359 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
[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 14

Expert Comment

by:wayside
ID: 10785738
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
ID: 10786846
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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

For a while now I'v been searching for a circular progress control, much like the one you get when first starting your Silverlight application. I found a couple that were written in WPF and there were a few written in Silverlight, but all appeared o…
A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

622 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