V
Vince
Hello,
I have two classes FooA and FooB with exactly the same methods.
In my application I read a INI File and I am supposed to instantiate either
FooA or FooB.(Actually FooA and FooB
represents classes to control two differents smart card reader but with same
methods).
class FooA
{
int Init();
int Close();
}
class FooB
{
int Init();
int Close();
}
Myapp
-------
void *pPointer = NULL;
CIni ini; // Class to read a ini file
ini.ReadIni() // read ini file
IF ini.GetType == FooA
pPointer = new FooA
else
pPointer = new FooB
pPointer->Init()
pPointer->Close()
I try to do it by declaring pPointer as a void pointer but it didn't
compile.
How can I do that ??
I have two classes FooA and FooB with exactly the same methods.
In my application I read a INI File and I am supposed to instantiate either
FooA or FooB.(Actually FooA and FooB
represents classes to control two differents smart card reader but with same
methods).
class FooA
{
int Init();
int Close();
}
class FooB
{
int Init();
int Close();
}
Myapp
-------
void *pPointer = NULL;
CIni ini; // Class to read a ini file
ini.ReadIni() // read ini file
IF ini.GetType == FooA
pPointer = new FooA
else
pPointer = new FooB
pPointer->Init()
pPointer->Close()
I try to do it by declaring pPointer as a void pointer but it didn't
compile.
How can I do that ??