Solved

calling an method in an activeX from itself

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Change owner from userA to server Local Administrators 7 74
sum67 challenge 35 128
Problem to open Excel file 15 263
I could not set window to top 4 62
This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
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.

734 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