I've got some COM objects in a .h file:
Base.h file
IEICUserPtr User;
I then include the .h file in my main program and from my main program delcare them like this:
Program.cpp
void init()
{
extern IEICUserPtr User;
User.CreateInstance(__uuidof(EICUser));
}
This goes fine an dandy...but then in another function, I try and get that variable back by doing this:
Program.cpp
void GetInfo()
{
extern IEICUserPtr User;
User->PutId("NWW"
}
Which then throws an exception. If I do this right after I create my COM object int he same function there is no problem...so my guess is that it's not keeping the variable intact like I think it should. I have other variables that I do the same thing with, but that info stays intact. Any ideas as to why this COM Ptr isn't keeping the info and what I need to do to make it stay intact? Thanks in advance!
Niky Williams
NTS Marketing
Base.h file
IEICUserPtr User;
I then include the .h file in my main program and from my main program delcare them like this:
Program.cpp
void init()
{
extern IEICUserPtr User;
User.CreateInstance(__uuidof(EICUser));
}
This goes fine an dandy...but then in another function, I try and get that variable back by doing this:
Program.cpp
void GetInfo()
{
extern IEICUserPtr User;
User->PutId("NWW"
}
Which then throws an exception. If I do this right after I create my COM object int he same function there is no problem...so my guess is that it's not keeping the variable intact like I think it should. I have other variables that I do the same thing with, but that info stays intact. Any ideas as to why this COM Ptr isn't keeping the info and what I need to do to make it stay intact? Thanks in advance!
Niky Williams
NTS Marketing