Click here to Skip to main content
15,893,487 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Structures and Member Variables Question Pin
#realJSOP15-Jan-07 3:19
mve#realJSOP15-Jan-07 3:19 
Questioncreate thread in asm block Pin
zon_cpp14-Jan-07 20:06
zon_cpp14-Jan-07 20:06 
AnswerRe: create thread in asm block Pin
yeti1114-Jan-07 20:13
yeti1114-Jan-07 20:13 
GeneralRe: create thread in asm block Pin
zon_cpp15-Jan-07 18:27
zon_cpp15-Jan-07 18:27 
GeneralRe: create thread in asm block Pin
yeti1115-Jan-07 21:48
yeti1115-Jan-07 21:48 
Questioncasting stl::vector confusion... Pin
yeti1114-Jan-07 19:59
yeti1114-Jan-07 19:59 
AnswerRe: casting stl::vector confusion... Pin
Stephen Hewitt14-Jan-07 20:24
Stephen Hewitt14-Jan-07 20:24 
GeneralRe: casting stl::vector confusion... [modified] Pin
yeti1114-Jan-07 21:03
yeti1114-Jan-07 21:03 
Why i need it;

http://www.codeproject.com/script/comments/forums.asp?msg=1841069&forumid=1647#xx1841069xx


What i am doing;

i am storing pointer to a vector inside some dispatch table that is stored in a base class for any class i am using.

vector holds further pointers to classes

pointer to vector is stored as void* (to avoid adding #includes to library that i wrote as generic), so i need to
cast it to vector but as i dont have #include to stored class definition the only thing i can cast it to is baseclass*.

when i want to gather its data, i call function in that base class that takes vector pointer
and casts it to vector<baseclass*>*, then i iterate through those class pointers and
gather their data,...

in that process i dont manipulate its content i am just reading what is stored inside and call
stored class* functions.

Unfortunally somewhere in (large and hard to handle) class structure some vector is annoying me
as:

<br />
+	_STL::_Vector_base<serClass *,_STL::allocator<serClass *> >	{_M_start=0xcccccccc _M_finish=0x00579264 const serIO::`vftable' _M_end_of_storage={_M_data=0x010cf778 } }	_STL::_Vector_base<serClass *,_STL::allocator<serClass *> ><br />


_M_start=0xcccccccc and it crashes.

before that the same freaking code is called around 20 times and it works without any problem.

Whole thing is going on in two processes, sending large class structures via sockets from one to another and vice versa, and is hell to trace so i am trying to theoretically find a problem Frown | :(



-- modified at 3:21 Monday 15th January, 2007
AnswerRe: casting stl::vector confusion... Pin
El Corazon14-Jan-07 20:46
El Corazon14-Jan-07 20:46 
GeneralRe: casting stl::vector confusion... [modified] Pin
yeti1114-Jan-07 21:05
yeti1114-Jan-07 21:05 
AnswerRe: casting stl::vector confusion... Pin
Michael Dunn14-Jan-07 22:17
sitebuilderMichael Dunn14-Jan-07 22:17 
GeneralRe: casting stl::vector confusion... [modified] Pin
yeti1114-Jan-07 22:59
yeti1114-Jan-07 22:59 
GeneralRe: casting stl::vector confusion... Pin
El Corazon15-Jan-07 4:59
El Corazon15-Jan-07 4:59 
GeneralRe: casting stl::vector confusion... Pin
yeti1115-Jan-07 11:57
yeti1115-Jan-07 11:57 
GeneralRe: casting stl::vector confusion... Pin
El Corazon15-Jan-07 15:00
El Corazon15-Jan-07 15:00 
GeneralRe: casting stl::vector confusion... Pin
Stephen Hewitt15-Jan-07 12:37
Stephen Hewitt15-Jan-07 12:37 
GeneralRe: casting stl::vector confusion... Pin
Stephen Hewitt15-Jan-07 12:02
Stephen Hewitt15-Jan-07 12:02 
GeneralRe: casting stl::vector confusion... Pin
yeti1115-Jan-07 12:16
yeti1115-Jan-07 12:16 
GeneralRe: casting stl::vector confusion... Pin
Stephen Hewitt15-Jan-07 16:00
Stephen Hewitt15-Jan-07 16:00 
GeneralRe: casting stl::vector confusion... [modified] Pin
yeti1115-Jan-07 18:21
yeti1115-Jan-07 18:21 
GeneralRe: casting stl::vector confusion... Pin
Stephen Hewitt15-Jan-07 18:27
Stephen Hewitt15-Jan-07 18:27 
GeneralRe: casting stl::vector confusion... Pin
yeti1115-Jan-07 18:39
yeti1115-Jan-07 18:39 
GeneralRe: casting stl::vector confusion... Pin
Stephen Hewitt15-Jan-07 18:43
Stephen Hewitt15-Jan-07 18:43 
GeneralRe: casting stl::vector confusion... Pin
yeti1115-Jan-07 18:44
yeti1115-Jan-07 18:44 
AnswerRe: casting stl::vector confusion... Pin
John R. Shaw15-Jan-07 4:18
John R. Shaw15-Jan-07 4:18 

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.