Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Interface pointer Assignment Crashing

Status
Not open for further replies.

sskumar

Programmer
Joined
Sep 12, 2002
Messages
36
Location
US
Hi
I have a class
Class MM{
public:
SetInterfacePtr( IsomeInterfacePointer *y)
{
xx = y;// crashing place
};
private:
IADFsomeInterfacePointer *xx;
};

When i have an object variable of type class MM
and call its SetInterfacePtr function it is crashing...

I checked for the content it is not NULL.
What might be the problem?
Can we assign an Interface pointer to another?

S.Senthil Kumar
 
Yes we can, but only if both interface pointers reside in the same thread (otherwise it needs more work, but still possible).

Are these smartpointers ?
I don't have experience with those, but maybe the assignment operator is overloaded by smartpointers and something goes wrong there....

Did you try a manual queryinterface on the y-pointer?
Is this pointer valid?

If it's true that you're using smartpointers and what I think is right (assignment operator overloaded and probably executing a queryinterface) the y-pointer needs to be valid.
Greetings,
Rick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top