Possibly a dumb question, possibly not? 
Author Message
 Possibly a dumb question, possibly not?

Hi.  I've got a (hopefully) basic question about instancing within an
ActiveX DLL written in VC++ 5.0

The DLL contains one class, CExample, in two files, Example.h and
Example.cpp.  The DLL also has code in Shared.cpp, and this code isn't a
member of the class, it's just a collection of functions.

Now let's say that one of the functions of CExample is to subclass a window.
I don't know of a way to have it subclass using one of its own member
functions, so instead we'll use SharedWndProc(...), which can be found in
Shared.cpp.

So far, so good.

Now, let's say we create two instances of CExample in a program.  Do they
each have their "own" instance of SharedWndProc(...), or are they using the
same one?  If they aren't using the same one, do they each have their own
instance of everything in Shared.cpp (including variables)?  If they are
using the same one, how can I keep this from happening if I specifically
want them to have different instances (or can I)?

Since this really revolves around subclassing, is there a way to subclass
using a class' member function for the new WndProc (and making it a static
member function is not an option, as static member functions can only access
static member variables, making it pretty dang useless for subclassing)?

I hope someone out there has some ideas, I'm stumped.

Thanks,
  Steve DeLong



Mon, 02 Apr 2001 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. possibly the dumbest question ever?

2. findstring not working in CListBox, possibly due to too many lines

3. GNU preprocessor (possibly) question (semi-OT)

4. (surely) old question, (possibly) new phrasing

5. CStting initialization question (Possibly silly)

6. Possibly daft question but.....

7. Possibly My Final Bitmap Question

8. Possibly dumb question: when is a global not a global?

9. Intellisense problem (possibly)

10. Strange Databinding Behavior - Possibly a bug

11. HDI: call an arbitrary function with an arbitrary number of arguments (and possibly arbitrary types)

12. Possibly OT: Project !dea :)

 

 
Powered by phpBB® Forum Software