Click here to Skip to main content
15,902,299 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: VC6 - bug? Could you try on your Box? Pin
peterchen14-Jan-05 0:29
peterchen14-Jan-05 0:29 
AnswerRe: VC6 - bug? Could you try on your Box? Pin
Aamir Butt14-Jan-05 0:38
Aamir Butt14-Jan-05 0:38 
GeneralRe: VC6 - bug? Could you try on your Box? Pin
peterchen14-Jan-05 1:24
peterchen14-Jan-05 1:24 
GeneralRe: VC6 - bug? Could you try on your Box? Pin
Aamir Butt16-Jan-05 17:31
Aamir Butt16-Jan-05 17:31 
GeneralRe: VC6 - bug? Could you try on your Box? Pin
peterchen16-Jan-05 18:42
peterchen16-Jan-05 18:42 
AnswerRe: VC6 - bug? Could you try on your Box? Pin
KaЯl14-Jan-05 1:37
KaЯl14-Jan-05 1:37 
AnswerRe: VC6 - bug? Could you try on your Box? Pin
Ryan Binns14-Jan-05 1:59
Ryan Binns14-Jan-05 1:59 
GeneralRe: VC6 - bug? Could you try on your Box? Pin
Ryan Binns14-Jan-05 2:39
Ryan Binns14-Jan-05 2:39 
My dissassembly matched your expected pattern. Although in my case, the register was not cleared to zero, but was set using the high-order dword of the GUID structure returned by GetSomeID() since it was inlined.

Funnily enough, in my case, the extra block was not needed and made no difference; neither did the rand() call - I could remove either one and still have the same error.

It appears here as though the problem is in the initialisation of the itParent object. At warning level 4, the compiler complains about being unable to inline the constructors, and on investigation, there are 8 bytes unaccounted for on the stack at the end of the function call (which would be equal to the two parameters to the two constructors called). I made the parameters to the constructors constant references rather than values, and this fixed the problem, as did making another constructor for CFinalPtr that took an IUnknownPtr argument, so only one constructor was called. I've noticed before that the compiler has trouble with copy constructors that take structures by value.

[edit]Disregard that. Used the wrong file Roll eyes | :rolleyes: [/edit]

Just noticed something... You're passing a CPtrWrap as an argument to the only CPtrWrap constructor that expects a IUnknownPtr. I'm not sure that's a valid construct, since CPtrWrap is derived from IUnknownPtr, and you're passing it by value, not by reference. If the constructor expected a reference or pointer there wouldn't be a problem. To be honest, I'm surprised the compiler doesn't warn about it. Certainly, if CPtrWrap had any data members of its own or virtual functions that weren't in IUnknownPtr, I'd expect it to totally screw up; basically if the size of two were different. Have a look at this, because I think it may have something to do with the problem.

Ryan
"Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"

GeneralRe: VC6 - bug? Could you try on your Box? Pin
peterchen14-Jan-05 3:16
peterchen14-Jan-05 3:16 
GeneralRe: VC6 - bug? Could you try on your Box? Pin
peterchen14-Jan-05 3:07
peterchen14-Jan-05 3:07 
GeneralRe: VC6 - bug? Could you try on your Box? Pin
Ryan Binns14-Jan-05 3:16
Ryan Binns14-Jan-05 3:16 
GeneralEXE Icon modifier Pin
CVNK7613-Jan-05 23:20
CVNK7613-Jan-05 23:20 
GeneralRe: EXE Icon modifier Pin
Joel Holdsworth15-Jan-05 0:19
Joel Holdsworth15-Jan-05 0:19 
GeneralRe: EXE Icon modifier Pin
cvnk17-Jan-05 0:26
cvnk17-Jan-05 0:26 
GeneralTired of ...... Pin
pc_dev13-Jan-05 22:49
pc_dev13-Jan-05 22:49 
GeneralRe: Tired of ...... Pin
Maximilien14-Jan-05 0:40
Maximilien14-Jan-05 0:40 
GeneralRe: Tired of ...... Pin
Roger Allen14-Jan-05 0:58
Roger Allen14-Jan-05 0:58 
Generalin view of MDI app OnMove() never happens Pin
T.T.H.13-Jan-05 22:45
T.T.H.13-Jan-05 22:45 
GeneralRe: in view of MDI app OnMove() never happens Pin
Iain Clarke, Warrior Programmer13-Jan-05 23:44
Iain Clarke, Warrior Programmer13-Jan-05 23:44 
GeneralHelp For ToolTipText in VC++ Pin
phijophlip13-Jan-05 22:03
phijophlip13-Jan-05 22:03 
Questionhow to get ethernet card ip address Pin
vc-programmer-13-Jan-05 21:44
vc-programmer-13-Jan-05 21:44 
AnswerRe: how to get ethernet card ip address Pin
pc_dev13-Jan-05 23:05
pc_dev13-Jan-05 23:05 
GeneralRe: how to get ethernet card ip address Pin
vc-programmer-13-Jan-05 23:22
vc-programmer-13-Jan-05 23:22 
GeneralRe: how to get ethernet card ip address Pin
David Crow14-Jan-05 2:54
David Crow14-Jan-05 2:54 
General#include header files order. Pin
rbid13-Jan-05 21:34
rbid13-Jan-05 21:34 

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.