Click here to Skip to main content
15,898,999 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
GeneralRe: Problem with atl vc7 and sinkmap Pin
_Magnus_12-Nov-03 3:25
_Magnus_12-Nov-03 3:25 
GeneralRe: Problem with atl vc7 and sinkmap Pin
Michael Dunn12-Nov-03 7:25
sitebuilderMichael Dunn12-Nov-03 7:25 
GeneralRe: Problem with atl vc7 and sinkmap Pin
_Magnus_12-Nov-03 21:46
_Magnus_12-Nov-03 21:46 
GeneralSetup problem of the Atl project Pin
Fox Ray11-Nov-03 20:42
Fox Ray11-Nov-03 20:42 
GeneralRe: Setup problem of the Atl project Pin
geo_m12-Nov-03 3:11
geo_m12-Nov-03 3:11 
GeneralRe: Setup problem of the Atl project Pin
Fox Ray12-Nov-03 13:21
Fox Ray12-Nov-03 13:21 
GeneralRe: Setup problem of the Atl project Pin
geo_m15-Nov-03 2:18
geo_m15-Nov-03 2:18 
GeneralCasting an interface to an internal class Pin
Giles11-Nov-03 11:07
Giles11-Nov-03 11:07 
Say I have a COM object that I want to create inside a library, modify something internally and then pass it on to something externally would the folling seem an okay thing to do in ATL:

IThingy *pIThingy NULL;

HRESULT hr = CThingy::CreateInstance(IID_IThingy, &pIThingy);

if(SUCCEEDED(hr))
{
     CThingy *pThingy = dynamic_cast<CThingy*>(pIThingy);

     if(pThingy)
     {
           pThingy->SomeInternalMemberFunction();
     }
}

What I'm worried about is casting from an interface pointer to the internal class. Is this okay, or if not why?

It works, most of the time, but when you enable things like #define _ATL_DEBUG_INTERFACES in stdafx.h, then the address acrording to the this pointer internaly to the CThingy instance no longer matches pIThingy that is returned from CreateInstance. Very worrying. Seems to be offset by about 8 bytes.
GeneralRe: Casting an interface to an internal class Pin
Tim Smith11-Nov-03 11:54
Tim Smith11-Nov-03 11:54 
GeneralRe: Casting an interface to an internal class Pin
Michael Dunn11-Nov-03 13:37
sitebuilderMichael Dunn11-Nov-03 13:37 
GeneralRe: Casting an interface to an internal class Pin
Giles11-Nov-03 20:41
Giles11-Nov-03 20:41 
GeneralRe: Casting an interface to an internal class Pin
Trong14-Nov-03 6:48
Trong14-Nov-03 6:48 
GeneralStacked Dialog Pin
Sakusys11-Nov-03 0:31
Sakusys11-Nov-03 0:31 
GeneralActivex and resources Pin
roberto.mdv11-Nov-03 0:23
roberto.mdv11-Nov-03 0:23 
QuestionCan the operator be overloaded in ATL and how? Pin
sqwang10-Nov-03 13:30
sqwang10-Nov-03 13:30 
QuestionHow to gray checkbox in tree control. Pin
shivonkar9-Nov-03 20:00
shivonkar9-Nov-03 20:00 
GeneralSTL question. Pin
WREY9-Nov-03 10:03
WREY9-Nov-03 10:03 
GeneralRe: STL question. Pin
Christian Graus9-Nov-03 10:16
protectorChristian Graus9-Nov-03 10:16 
GeneralRe: STL question. Pin
WREY9-Nov-03 12:11
WREY9-Nov-03 12:11 
GeneralRe: STL question. Pin
ZoogieZork9-Nov-03 13:52
ZoogieZork9-Nov-03 13:52 
GeneralRe: STL question. Pin
WREY9-Nov-03 17:36
WREY9-Nov-03 17:36 
GeneralRe: STL question. Pin
jbarton10-Nov-03 7:25
jbarton10-Nov-03 7:25 
GeneralRe: STL question. Pin
WREY10-Nov-03 7:54
WREY10-Nov-03 7:54 
GeneralRe: STL question. Pin
jbarton11-Nov-03 4:42
jbarton11-Nov-03 4:42 
Generalofstream position and &gt;2GB files Pin
Jeremy Osner7-Nov-03 3:38
Jeremy Osner7-Nov-03 3:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.