|
Badboy22TR wrote: I want to transfer data from Child Form's textboxes to Parent form textboxes. How can i do this ?
One approach is you can learn about Design and Patterns like Model-View-Controller.
Another approach that most people around here do is expose the controls as public properties and just set/get the data from one to the other whenever you like, that way they are tightly coupled so that when you want to change something later it's a big mess.
Badboy22TR wrote: Can any one suggest something or tell me that where i declare delegates?
Have you looked at the C++/CLI Beginner articles here on code project? They are highly recommended.
led mike
|
|
|
|
|
MVC to pass data between forms??? you will never understand this....
|
|
|
|
|
|
Hi guys,
I want to make an array that consists of system defined colors. I wrote the code
System::Drawing::Color Color1[]={Color::Black, Color::Brown, Color::Red};
what delivered the error
'System::Drawing::Color' : a native array cannot contain this managed type
Then I tried this version
Color Color1[] = __gc new Color[];
and I got this error
error C2440: 'initializing' : cannot convert from 'System::Drawing::Color ^' to 'System::Drawing::Color'
Has anyone an idea how to make this work?
Thanks and best wishes
|
|
|
|
|
I would expect this to work...
Color Color1[] = __gc new Color[3];
What about this?
Color Color1 __gc[]= new Color __gc[3];
BTW, this is SO much nicer in VC 2005+ (without the managed extensions)
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Thanks but this also doesn't work, it just causes more errors.
|
|
|
|
|
Yeah you were trying to use managed extensions (old) syntax so I assumed you
were using VS 2002/2003 .NET.
Since you're not, use the new array syntax (no more __gc) as shown by David Anton.
array<Color> ^Color1 = gcnew array<Color><font color="Red">(</font>3<font color="Red">)</font>;
or
array<Color> ^Color1 = gcnew array<Color>{Color::Black, Color::Brown, Color::Red};
or
array<Color> ^Color1 = {Color::Black, Color::Brown, Color::Red};
Mark
*edit* Fixed the parenthesis above
Last modified: 3hrs 18mins after originally posted --
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi Mark,
I tried each of your suggestions, which should, as far as I know, do the same and work, but each caused errors:
array<color> ^Color1 = gcnew array<color>[3];
error C2726: 'gcnew' may only be used to create an object with managed type
array<color> ^Color1 = gcnew array<color>{Color::Black, Color::Brown, Color::Red};
error C3145: 'Color1' : global or static variable may not have managed type 'cli::array<type> ^'
with
[
Type=System::Drawing::Color
]
may not declare a global or static variable, or a member of a native type that refers to objects in the gc heap
error C3145: '$S9' : global or static variable may not have managed type 'cli::array<type> ^'
with
[
Type=System::Drawing::Color
]
may not declare a global or static variable, or a member of a native type that refers to objects in the gc heap
array<color> ^Color1 = {Color::Black, Color::Brown, Color::Red};
error C3145: 'Color1' : global or static variable may not have managed type 'cli::array<type> ^'
with
[
Type=System::Drawing::Color
]
may not declare a global or static variable, or a member of a native type that refers to objects in the gc heap
I really don't know why this doesn't work.
|
|
|
|
|
hehe WTH?
What version of Visual Studio are you using?? Are you compiling for clr?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Well, I'm using Visual C++ Express Edition 2008.
What do you mean with compiling for clr?
|
|
|
|
|
This is managed code, so you must use the /clr compiler switch
(Project settings/Configuration Properties/General/Common Language Runtime Support)
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Also, I fixed the code in my last post - maybe that will work better.
Sorry about that
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
From the error message, you are using C++/CLI, so what you want is:
array<system::drawing::color> ^Color1 = {Color::Black, Color::Brown, Color::Red};
(edited Feb 19 to ignore html tags)
David Anton
http://www.tangiblesoftwaresolutions.com
C++ to C# Converter
C++ to VB Converter
C++ to Java Converter
Instant C#: VB to C# converter
Instant VB: C# to VB converter
Instant C++: convert VB or C# to C++/CLI
Java to VB & C# Converter: convert Java to VB or C#
modified on Tuesday, February 19, 2008 10:31 AM
|
|
|
|
|
Ack! Good eye - I don't know how many times I read it and missed the "^" LOL
Cheers,
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Thanks but it doesn't work.
|
|
|
|
|
The code was mangled when posting (forgot to check "ignore html tags..").
It should be:
array<System::Drawing::Color> ^Color1 = {Color::Black, Color::Brown, Color::Red};
David Anton
http://www.tangiblesoftwaresolutions.com
C++ to C# Converter
C++ to VB Converter
C++ to Java Converter
Instant C#: VB to C# converter
Instant VB: C# to VB converter
Instant C++: convert VB or C# to C++/CLI
Java to VB & C# Converter: convert Java to VB or C#
|
|
|
|
|
I load a report from my Visual c++ NEt program.
I have a error message : invalid report file path,evenif the report is in this directory
my code is bellow.
What can be the problem ?
SqlConnection^ cprl = gcnew SqlConnection();
cprl->ConnectionString = "Persist Security Info=False;Integrated Security=SSPI;database=payroll08;server=sem;Trusted_Connection=Yes;" ;
cprl->Open();
// Ds_report^ data = gcnew Ds_report();
DSENFANTS^ data = gcnew DSENFANTS();
SqlDataAdapter^ adapt = gcnew SqlDataAdapter();
SqlCommand^ Cmd = gcnew SqlCommand();
Cmd->CommandText = "select* from ficenf";
Cmd->CommandType = CommandType::Text;
Cmd->Connection = cprl;
adapt->SelectCommand::set(Cmd) ;
adapt->Fill(data,"enfants");
RDEnfants->SetDataSource(data);
RDEnfants->Load(L"c:\\GESTION\\payrollv2\\payrollv2\REPENFANTS.rpt");
//rptsearchsig->PrintToPrinter(1,true,0,65500);
RVENFANTS->ReportSource = RDEnfants;
//crystalReportViewer1->ReportSource = rptsearchsig;
modified on Monday, February 18, 2008 10:54 AM
|
|
|
|
|
Dear Sir,
I use Visual c++ Net 2005.
I need to know how we do the non document printing in Visual c++ NEt 2005.
Can you show me articles that talk about it ?
It's not Urgent but I need your Help
I learn my self
|
|
|
|
|
mikobi wrote: I learn my self
When? We are still waiting.
On the CodeProject menu under "Chapters" click "Desktop Development" then click "Printing"
led mike
|
|
|
|
|
I did not yet see article that shows me how to print in Visual c++ 2005 NET.
I am blocked by this, I can't go far if I cannot print.
Who can Help me.
|
|
|
|
|
On my form I have one combobox that I need to fill data from my database.
I am using Visual c++ Net 2005
How can I make declaration and add items ?
Urgent
|
|
|
|
|
mikobi wrote: Urgent
The only thing that's urgent is you urgently need to stop trying to learn how to do EVERYTHING through internet forums. Most software developers go to university and read books to learn fundamentals of software development. If you refuse to learn fundamentals there is no hope you will ever be a capable developer.
led mike
|
|
|
|
|
Please Sir, I have not this opportunity to access that university, but I want to know. I learn my self Visual c++ 6.0 and I have made 4 programs .
As there are a new version I need to improve my programs.
|
|
|
|
|
mikobi wrote: I have not this opportunity to access that university
Then obtain some books or even find online courses or tutorials that target beginner programming.
led mike
|
|
|
|
|
I try to do that :
this->nationalite->AddItemsCore("Congo");
I have a message candidate function not accessible.
Remarque: This combobox(nationalite) I need to fill is in a user form.
I do know if this message is related to the kind of form.
|
|
|
|