Solved

calling an method in an activeX from itself

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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Add content to output file 4 63
notReplace  challenge 53 125
fizzArray  challenge 1 81
unix example issues 18 89
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: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
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.
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…

813 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

11 Experts available now in Live!

Get 1:1 Help Now