string s = ostringstream() << 100;
Befor the string assignment function gets called ( see Stream.cpp Line 102 & Line 46 ) the ostringstream / CTest object gets released. Directly after the release(), the ostreamToString function gets called, with a now invalid pointer. If i however use "format" instead of "ostringstream" ( both classes registered by me, just the << operators are different by @ and @+ ) the calling of the release and ostreamToString happen in the correct order. Is the bug on my side or yours ?
Im suspecting my changing from RegisterObjectBehaviour to RegisterGlobalBehaviour in Line 67 in Stream.h to be the root of the problem, but I couldn't see why RegisterObjectBehaviour should be used there since the operators are totally global.
As thankfull as always,
Maddi
ostringstream with AS
Hi Witchlord,
on to my next experiment :)
I want to have an ostringstream like class for nice string formatting.
Therefor I took a look at the OutStream from Sam Cragg. Because he only supports cout / cin, I started to convert the whole thing to ostringstream.
First of all, I converted the Register functions to be static so I can register just the class without needing to create an object first.
The whole process was an addition of access violations and wrong pointers, at one point, the exectution ended in areas never seen befor :)
But at the end I now have a quiet robust implementation. Because its so much, I did not wan't to post it here, but rather uploaded a .rar to my server ( stream.rar ).
But :) The problem arises when trying to do something like this:
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement