Click here to Skip to main content
15,910,471 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How to export Symbol from Win Static Library Pin
Martin Koorts16-Jan-05 22:53
Martin Koorts16-Jan-05 22:53 
GeneralOnPaint and CPaintDC Pin
Malcolm Smart14-Jan-05 3:02
Malcolm Smart14-Jan-05 3:02 
GeneralRe: OnPaint and CPaintDC Pin
Ryan Binns14-Jan-05 3:40
Ryan Binns14-Jan-05 3:40 
GeneralRe: OnPaint and CPaintDC Pin
Mike Dimmick14-Jan-05 3:40
Mike Dimmick14-Jan-05 3:40 
GeneralRe: OnPaint and CPaintDC Pin
Malcolm Smart14-Jan-05 4:37
Malcolm Smart14-Jan-05 4:37 
GeneralLoading HTML documents Pin
Hans Ruck14-Jan-05 2:00
Hans Ruck14-Jan-05 2:00 
GeneralPls Help with CMetaFileDC and CScrollView Pin
Dimitris Vikeloudas14-Jan-05 0:41
Dimitris Vikeloudas14-Jan-05 0:41 
QuestionVC6 - bug? Could you try on your Box? Pin
peterchen14-Jan-05 0:24
peterchen14-Jan-05 0:24 
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 

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.