Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

c++ - Derived class vtable corrupted? -


need in root causing vtable corruption issue(not sure if that’s happening). here simplified version of code.

class cbase { public:     cbase()     virtual ~cbase()     virtual void base_virtual_fn1() = 0;     virtual void base_virtual_fn2(); private:     cdata   _data; };  class cderived : public cbase { public:     cderived();     virtual ~cderived()     virtual void base_virtual_fn1();     virtual void base_virtual_fn2();     virtual void derived_virtual_fn1();     virtual void derived_virtual_fn2(); private:     // contains vectors , maps, integers, bools.  }; 

when create instance of cderived , call derived class virtual function derived_virtual_fn2 other function gets called i.e. derived_virtual_fn1.

calls base_virtual_fnx has no issues.

this happens object created on heap , not local object.

these classes in shared library. i’m using gcc 3.4.2 on linux (sles 10). there no pragma pack directive in of code , there mix of c , c++ code (extern c used). issue here?

i forgot mention there there tons of other code (executable, libraries)

here nasty mistake made took me forever find. compiler/debugger/valgrind gave me no insight going on. there should someway debug these kinds of errors:

the base class compiled in library "some_package" defined:

class interface {     virtual int function1(int); #ifdef some_package     virtual int function2(int); #endif     virtual int function3(int); }  class base : public interface {     int function1(int);     int function2(int);     int function3(int); } 

the derived class compiled later without some_package defined

class derived : public base {     int function1(int);     int function3(int); } 

calls function3 caused jumps function2 able figure out debugger, took me long time find cause.


Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -