Solved

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

Posted on 2004-04-08
2
353 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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Need a complete list of ASP.NET page load events 3 72
"Video DataSource is Offline or not responding"  - why? 1 169
C# LINQ ForEach() question 6 115
C++ Code Issue 4 48
Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
With most software applications trying to cater to multiple user needs nowadays, the focus is to make them as configurable as possible. For e.g., when creating Silverlight applications which will connect to WCF services, the service end point usuall…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

738 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