
ATL and Base Class Pointers in COM
Hii Group,
I would like to create 2 DLLs. The first DLL will export a handful of Random Number
Generators. The second DLL will allow a client to use the RNG.
I'm having problems with getting the sematics correct in the RNG DLL, so that the
second DLL can take an interface to the 'base class' DLL as an argument.
Here's what I want:
Base Class: PRNG (and interface IPRNG)
Derived: X917C, BBS, LCG, Sequence (and interface IX917C, etc)
In the second DLL, I would like a method such as:
SetRNG( IPRNG* newRNG );
Does anyone have sample code posted? I have not been able to get past a clean compile
on the RNG DLL. I think the problem is with my philosophy - and hence my
implementation. Pure virtuals in the PRNG ATL class cause COM errors. The ATL PRNG
base class in the first DLL compiles OK (but does nothing). When I try to derive from
it (for example, a simple Sequence), a lot of things break. This is after commenting
out a lot of the derived ATL code.
I've looked through a few of my books (Curland's VB book, Box's essential COM), but
neither really talk about - or I have not found a discussion of it. Google has not
lead me to anything useful either (but I probably have not found the proper key words
at this point).
Thanks in advance,
Jeff