Solved

calling an method in an activeX from itself

Posted on 1998-10-22
2
163 Views
Last Modified: 2013-11-20
i have an activeX control made with ATL. to make a long story short, their is a class inside it that i want to call a method in the control. i only want one instance of the control. is there any easy way to do this?
0
Comment
Question by:saperstein
2 Comments
 
LVL 2

Accepted Solution

by:
igroove earned 20 total points
ID: 1323721
Look in the ATL documentation about "singletons", or single-instance objects.  OR - the long way around - You could also create an instance of your object at app/dll startup, and whenever someone/thing goes to instance it in your class factory, just QueryInterface on it and put it in the interface pointer reference for the requested object.
0
 

Author Comment

by:saperstein
ID: 1323722
i made the class a member of the interface class. i have a method in the interface class to do some initialization and i pass in the this pointer. seems to work. the other way i was going to it was to pass in the LPDISPATCH.

the other problem/observation is that i added a destructor to the interface class. it didn't get called. am i missing something?

you can still have the points. thanks.
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

Suggested Solutions

Title # Comments Views Activity
MFC Dialog 9 47
Running shell command from Access 3 63
Turn a spreadsheet into a vba executable. 2 66
Sed question 2 49
In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This video discusses moving either the default database or any database to a new volume.

747 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

12 Experts available now in Live!

Get 1:1 Help Now