Click here to Skip to main content
15,925,309 members
Home / Discussions / Managed C++/CLI
   

Managed C++/CLI

 
QuestionC# -> C++ call issue Pin
Jais Joy21-Feb-08 19:18
Jais Joy21-Feb-08 19:18 
GeneralRe: C# -> C++ call issue Pin
Mark Salsbery22-Feb-08 6:20
Mark Salsbery22-Feb-08 6:20 
GeneralWeb Application Vs Windows applications Pin
sathishin21-Feb-08 7:13
sathishin21-Feb-08 7:13 
GeneralRe: Web Application Vs Windows applications Pin
Christian Graus21-Feb-08 20:29
protectorChristian Graus21-Feb-08 20:29 
GeneralRe: Web Application Vs Windows applications Pin
sathishin25-Feb-08 6:18
sathishin25-Feb-08 6:18 
GeneralError with Substring. Pin
msogun20-Feb-08 18:12
msogun20-Feb-08 18:12 
GeneralRe: Error with Substring. Pin
Mark Salsbery21-Feb-08 8:05
Mark Salsbery21-Feb-08 8:05 
QuestionPassing Data Between Forms, I tried and failed :) Pin
Badboy22TR20-Feb-08 14:59
Badboy22TR20-Feb-08 14:59 
Hi, I tried to pass data between forms in VC++. I want to pass input data from child's textboxes to parent when child form closes.
But all i have is errors. Can you tell me where my mistake(s) is ?

//R2.h (Parent Form)

#include Yeni.h
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;

namespace xxx {
public ref class R2 : public System::Windows::Forms::Form
{
........... auto generated code.............
}

//The Button which creates Child Form
private: System::Void pictureBox2_Click(System::Object^ sender, System::EventArgs^ e) {
MdiParent->ActiveMdiChild->Close();
Yeni^ YRForm = gcnew Yeni();
YRForm->MdiParent=this->MdiParent;
YRForm->Show();}

//The Button in child form, which closes child form
private: System::Void Yeni::pictureBox1_Click(System::Object^ sender, YeniUpdateEventArgs^ e)
{
String^ A = e->Isim;
String^ B = e->Soyad;
MessageBox::Show(this,"Isim : "+A+"Soyad : "+B,"Durum",MessageBoxButtons::OK);
}


//Yeni.h (Child Form) (I'm not sure where I should add "delegate")

using namespace System;
using ..........
....

namespace xxx {

public: delegate void YeniUpdateHandler(System::Object^ sender, YeniUpdateEventArgs^ e);
public: YeniUpdateHandler^ YeniUpdated;

public ref class YeniUpdateEventArgs : public System::EventArgs
{


private: String^ mIsim;
private: String^ mSoyad;

public: YeniUpdateEventArgs(String^ sIsim, String^ sSoyad)
{
this->mIsim = sIsim;
this->mSoyad = sSoyad;
}
public:
property String^ Isim
{
String^ get
{
return mIsim;
}
}
public:
property String^ Soyad
{
String^ get
{
return mSoyad;
}
}
};

public ref class Yeni : public System::Windows::Forms::Form
{
........... auto generated code.............
}

//The Button which closes child form
private: System::Void pictureBox1_Click(System::Object^ sender, System::EventArgs^ e) {
String^ sIsim = textBox1->Text;
String^ sSoyad = textBox2->Text;
YeniUpdateEventArgs^ args = gcnew YeniUpdateEventArgs(sIsim, sSoyad);
YeniUpdated(this, args);
this->Close();

}

I have 84 errors Smile | :) ) Most of them is syntax errors. What are my mistakes ? Is anything missing in code or did i place smtg wrong?
Thank you very much...

PS:Please don't suggest any solution or example in VC#, because after i tried to translate, onlything that i had was errors and i
didn't have find any example in VC++.
GeneralRe: Passing Data Between Forms, I tried and failed :) Pin
Paul Conrad29-Feb-08 8:05
professionalPaul Conrad29-Feb-08 8:05 
GeneralRe: Passing Data Between Forms, I tried and failed :) Pin
Badboy22TR29-Feb-08 9:11
Badboy22TR29-Feb-08 9:11 
GeneralI can write a ListView record but I can't read one Pin
BuckBrown20-Feb-08 12:11
BuckBrown20-Feb-08 12:11 
GeneralRe: I can write a ListView record but I can't read one Pin
Christian Graus20-Feb-08 13:18
protectorChristian Graus20-Feb-08 13:18 
GeneralRe: I can write a ListView record but I can't read one Pin
BuckBrown21-Feb-08 6:16
BuckBrown21-Feb-08 6:16 
GeneralRe: I can write a ListView record but I can't read one Pin
Mark Salsbery21-Feb-08 7:44
Mark Salsbery21-Feb-08 7:44 
GeneralRe: I can write a ListView record but I can't read one Pin
BuckBrown21-Feb-08 8:03
BuckBrown21-Feb-08 8:03 
GeneralRe: I can write a ListView record but I can't read one [modified] Pin
Mark Salsbery21-Feb-08 8:15
Mark Salsbery21-Feb-08 8:15 
GeneralRe: I can write a ListView record but I can't read one Pin
BuckBrown21-Feb-08 8:22
BuckBrown21-Feb-08 8:22 
GeneralRe: I can write a ListView record but I can't read one Pin
BuckBrown21-Feb-08 7:50
BuckBrown21-Feb-08 7:50 
GeneralRe: I can write a ListView record but I can't read one Pin
Mark Salsbery21-Feb-08 8:02
Mark Salsbery21-Feb-08 8:02 
GeneralRe: I can write a ListView record but I can't read one Pin
BuckBrown21-Feb-08 8:17
BuckBrown21-Feb-08 8:17 
GeneralRe: I can write a ListView record but I can't read one Pin
Mark Salsbery21-Feb-08 8:21
Mark Salsbery21-Feb-08 8:21 
GeneralRe: I can write a ListView record but I can't read one Pin
BuckBrown21-Feb-08 8:28
BuckBrown21-Feb-08 8:28 
GeneralRe: I can write a ListView record but I can't read one Pin
Mark Salsbery21-Feb-08 8:41
Mark Salsbery21-Feb-08 8:41 
GeneralFirst column of ListView will not center justify Pin
BuckBrown20-Feb-08 10:35
BuckBrown20-Feb-08 10:35 
GeneralNeed your thoughts.!!! Pin
rowdy_vc++20-Feb-08 0:57
rowdy_vc++20-Feb-08 0:57 

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.