Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
X

Xeef

@Xeef
About
Posts
17
Topics
9
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • cast to a stored type
    X Xeef

    hi all how can i do something like: System::Type^ a = int::typeid; int b = (a^) c;

    Managed C++/CLI question

  • still reflecting / major problem
    X Xeef

    can a reflected methode not return gcnew System::Windows::Forms::TextBox() but just base types like INT ??? if not mean it can return TextBox where do i go wrong ? myType = SampleAssembly->GetType("Memory.What"); myObj = System::Activator::CreateInstance( myType ); myMethod = myType->GetMethod("Name"); myMethod->Invoke( myObj , nullptr ); <<<--- here is the error i have a MessageBox::Show in Memory.What.Name wich is fiered and also shows TextBox->ToString() corect which shoud by returned (ToString is for testing in the messagebox dont get confused) An unhandled exception of type 'System.NullReferenceException' occurred in WhatsUp.exe Additional information: Object reference not set to an instance of an object.

    Managed C++/CLI help testing beta-testing performance question

  • Reflection how to cast to loaded type
    X Xeef

    unfortunaly no :( same error this is where i am in the moment : myType = SampleAssembly->GetType("Memory.What"); myObj = System::Activator::CreateInstance( myType ); System::Reflection::MethodInfo^ mi = myType->GetMethod("Ver"); mi->Invoke(myObj , nullptr ); so i can call the methode but its not to elegant there muss by some other way so that i can call it like : LoadedDLL->Ver();

    Managed C++/CLI question c++ performance help tutorial

  • Reflection how to cast to loaded type
    X Xeef

    hi all System::Reflection::Assembly^ SampleAssembly; System::Type^ myType; System::Activator::Object^ myObj; try { SampleAssembly = System::Reflection::Assembly::LoadFrom( Path ); } catch (System::IO::FileNotFoundException^ catchException) { Form->_TabCon->_PageStatus->StatusText->Text += catchException->ToString() + System::Environment::NewLine; return 1; } try { myType = SampleAssembly->GetType("Memory.What"); if (!myType) throw (System::String^) "Can´t locate Base Function [incompatible plug ???]"; } catch (System::String^ catchException) { Form->_TabCon->_PageStatus->StatusText->Text += catchException + System::Environment::NewLine; return 1; } myObj = System::Activator::CreateInstance( myType ); // creates the instance **What^ W = (What^)myObj;** how can i cast to "What^" ? i tryed to have a .h .cpp file whit the same declaration as in "Memmory.what" but i get an error An unhandled exception of type 'System.InvalidCastException' occurred in WhatsUp.exe Additional information: Unable to cast object of type 'Memory.What' to type 'WhatsUp.What'.

    Managed C++/CLI question c++ performance help tutorial

  • global or something like
    X Xeef

    hup some how i didnt saw the 2 abowe replays :confused: this managed unmanaged clr cli mfc ... is so confusing to me in the moment :confused: no idea in what i am programing :^) just that i am using visual c++ :-D

    C / C++ / MFC question

  • global or something like
    X Xeef

    Hmmmm looks like in the moment : namespace WhatsUp { MainForm::MainForm( ) { Size = System::Drawing::Size( 600, 600 ); MinimumSize = System::Drawing::Size( 600, 600 ); _TabCon = gcnew TabCon( this ); Controls->Add( _TabCon ); _TabCon->_PageStatus = gcnew PageStatus( ); _TabCon->Controls->Add ( _TabCon->_PageStatus ); _TabCon->_PageSetup = gcnew PageSetup( ); _TabCon->Controls->Add ( _TabCon->_PageSetup ); _PlugLoad = gcnew PlugLoad( this ); _IniLoad = gcnew IniLoad ( this ); } } [System::STAThreadAttribute] int main(array^ args) { System::Windows::Forms::Application::EnableVisualStyles(); System::Windows::Forms::Application::SetCompatibleTextRenderingDefault(false); System::Windows::Forms::Application::Run( gcnew WhatsUp::MainForm() ); } ... .. namespace WhatsUp { IniLoad::IniLoad( MainForm^ F ) { Form = F; Form->_TabCon->_PageStatus->StatusText->Text += "Proccessing ini File" + System::Environment::NewLine; PageSetup and PageStatus are derived TabPages i have a few textboxes on them as output this are populated by PlugLoad, IniLoad and many others IniLoad loads an xml cheks it and give singel nodes to PlugLoad for future proccessing and so on so all classes by it a derived like PageSetup or a base class like IniLoad needs to comunikate whit each other either to write something on screen or to hand over data for future proccessing

    fcheng wrote:

    then consider collecting the key data together in one "data" class

    i think this is basicli what MainForm do it has a referenc / pointer to all used classes i was basicly hopoing to by abel to prevent IniLoad::IniLoad( MainForm^ F ) Form = F; and use instead some global referenc to it but i can´t make managed things global is there some EASY way to know who has called this class IniLoad::IniLoad( ) Form = System::SomeFunction->The->oneWho->CalledMe; whit out to use assembler

    C / C++ / MFC question

  • global or something like
    X Xeef

    hi all i have a bunch of classes mostly extended base classes like Form, TabControl... all of them needs to know abouth each other in the moment i have _TabCon = gcnew TabCon( this ); //this points to MainFrom Controls->Add( _TabCon ); ... .. TabCon::TabCon( MainForm^ F) { Form = F; .. . so all classes know MainForm and MainForm know all classes is there a better way ? whit out the need of Form = F; in each class something like static global MainFromLink = MainForm; so that i can reach this from anywhere MainFrom is ref class MainForm: public System::Windows::Forms::Form

    C / C++ / MFC question

  • 2 way comunicaion betwean classes
    X Xeef

    Cool thx a lot ! :-D

    Managed C++/CLI c++ help question

  • 2 way comunicaion betwean classes
    X Xeef

    hi all topic says it how can i do something like : this ist NOT working but what ever i try i ending always by this problem --> class1.h #pragma once ref class class1 { public: class1(void); class2^ c2; }; .cpp #include "StdAfx.h" #include "class1.h" #include "class2.h" class1::class1(void) { } class2.h #pragma once ref class class2 { public: class2(void); class1^ c1; }; .cpp #include "StdAfx.h" #include "class2.h" #include "class1.h" class2::class2(void) { }

    Managed C++/CLI c++ help question

  • classes a few questions
    X Xeef

    working half way how can i get this out of class.h in to the class.cpp file : virtual int Show(void){return 1;}; virtual int Show(void)override{.... something like : virtual int Memory::Show(void)override{ wich isnt woking :((

    Managed C++/CLI data-structures tutorial question

  • classes a few questions
    X Xeef

    hi all if some one whit knowledege coud sacrify 2-3 minutes it woud save me a day time ;) a have a class X now i wana make a class Y wich woud derive all methodes, variables of X and has new ones i wana ensure in X that certain methode are implemented in Y wich arent in X but declared i wana overwrite methodes of X in Y how do i write functions for operators that this works : Myclass a=Myclass(); a++; a=a*a; ... .. i was try to use System::String inside a struct and was geting erros that i cant use a managed type in a struct blabla i have solved this by using a class instead but woud by nice to know if there is a way around similair problems seams to ocure if i try to use them as static i woud like to have a static array in my class whit a pointer to all instances of this class this is important else way i have trubel if some one coud give me a 10-20 line example it woud by great just code no need for description

    Managed C++/CLI data-structures tutorial question

  • how do i remove a MouseEventHandler [modified]
    X Xeef

    hi all stuckt agein hope i not highjack this hole topic :wtf: void Disp::Lock_Down(System::Object ^o, System::Windows::Forms::MouseEventArgs ^e){ Lock->MouseMove += gcnew System::Windows::Forms::MouseEventHandler( this, &Disp::Lock_Drag ); MousePosition=MainF->MousePosition; } void Disp::Lock_Up(System::Object ^o, System::Windows::Forms::MouseEventArgs ^e){ >>>>>>>>>>>>>> not like this but how ??? :confused: Lock->MouseMove->Remove(this, &Disp::Lock_Drag); <<<<<<<<<<<<<< } -- modified at 9:48 Friday 25th May, 2007 this works void Disp::Lock_Down(System::Object ^o, System::Windows::Forms::MouseEventArgs ^e){ t = gcnew System::Windows::Forms::MouseEventHandler( this, &Disp::Lock_Drag ); Lock->MouseMove += t; MousePosition=MainF->MousePosition; } void Disp::Lock_Up(System::Object ^o, System::Windows::Forms::MouseEventArgs ^e){ Lock->MouseMove -= t; } BUT i realy not like "t" is there a way to get it somehow else mayby out of Object ^o or MouseEventArgs ^e or how ever whit out the need to store it by my self

    Managed C++/CLI question

  • datagridview data
    X Xeef

    :-D thx a lot ! exctly what i need

    Managed C++/CLI question data-structures help

  • datagridview data
    X Xeef

    hi agein to all array^row0 = {"11/22/1968","29"}; DataGridView1->Rows->Add( row0 ); row0[0]="2"; Object^ a= DataGridView1->DataSource; a[0]="123"; error C3915: 'System::Object' has no default indexed property (class indexer) how do i acces the rows after they are created / aplyed i havent try it but i am prety sure i coud overwrite it like DataGridView1->Rows->Add( somethingelse ); mayby not whit add :p it woud just append / push it in this case any way the question is how can i acces it streigt to replace data something like DataSource[row][col]= "my new value"; i not wana use databinding to a data base as the data are live generated and i dont think it woud make thinks easyer any way ;) on top if this is there any way to list the content and types whats in an object some recursive loop wich woud rotate truh all elements of the object by it an array a mullti dim array or what ever object combination

    Managed C++/CLI question data-structures help

  • conver size_t to System::String
    X Xeef

    wow so much help in so short time thank you too

    Managed C++/CLI question c++ graphics help

  • conver size_t to System::String
    X Xeef

    cool ! thx a lot ! working so fare :-D System::String^ MeM::X(){ char a[200]; sprintf_s( a,200, "%d", stat.dwTotalPhys ); return gcnew System::String(a); }

    Managed C++/CLI question c++ graphics help

  • conver size_t to System::String
    X Xeef

    hi all new here and also to c++ MeM mem=MeM() textBoxeS[0] = gcnew System::Windows::Forms::TextBox; textBoxeS[0]->Size = System::Drawing::Size( 300, 40 ); textBoxeS[0]->ReadOnly = true; //textBoxeS[0]->Text = gcnew String(mem.X()); ???????????? textBoxeS[0]->BackColor = SystemColors::Window; MeM::MeM(void) { GlobalMemoryStatus (&stat); } System::String^ MeM::X(){ how do i cast / convert this ---->>>> char *a=(char*)stat.dwTotalPhys; return gcnew String(a); //System.ArgumentOutOfRangeExceptio //return const_cast(stat.dwTotalPhys); <<<<---------- PROBLEM HERE } other question is there an AUTOindent function in visual C++ 2005 ? cheers rick

    Managed C++/CLI question c++ graphics help
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups