Solved

calling an method in an activeX from itself

Posted on 1998-10-22
2
164 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
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.
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

895 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