|
You can create 2 separate forms just as teejayem suggested, but if you want them completely independent of each other (i.e. Form2 is not a child of Form1), then you need to modify your <project_name>.cpp file that opens your main form. This file contains your main loop, and probably has a line like
Application::Run(gcnew Form1());
You would need to change this to create your Form1 and Form2 objects, show them, and then start your application. You might need a DoEvents loop, but there might be a way around that.
Dybs
|
|
|
|
|
You have to include the form2.h in your form1.h file for you to be able to use it
#include "Form2.h"
also "Show" isn't a property, it is a method. You shouldn't be trying to assign a boolean to it
Don't be overcome by evil, but overcome evil with good
|
|
|
|
|
Thank you, it works, but there is still little problem.
Form1::Visible = false;<br />
<br />
<br />
Form2->Show();
|
|
|
|
|
I'm guessing that is because your varaible name is the same as your class name. so the compiler is thinking your trying to call a static method. Change your variable name to something more unique
System::Windows::Forms::Form^ myFrm2 = gcnew System::Windows::Forms::Form()
myFrm2->Show()
Don't be overcome by evil, but overcome evil with good
|
|
|
|
|
Oh, thank you for your help. I was googling with "c++\cli" AND "#include"Form2.h"" and I found solution. It was that what you wrote. Same name Form2. THANK YOU
modified on Sunday, August 24, 2008 1:43 PM
|
|
|
|
|
I need a simple example on how to use OpenFileDialog(). I don't want to extend it or enhance it (I did search for articles), just use it. Even after searching the entire Visual Studio directory, I cannot find the right files to include so that the compile stops telling me that OpenFileDialog is an undeclared identifier.
Do you have a link that will help me out?
Thank you.
Thanks for your time
|
|
|
|
|
example
to use this class you need to include the System.Windows.Forms assembly and add the namespace on top of your .h
Don't be overcome by evil, but overcome evil with good
|
|
|
|
|
Hello teejayem,
I feel like there are too many questions to ask. I check your example link, but Microsoft leaves so much out and is so different from my code that I don’t understand it.
RE: to use this class you need to include the System.Windows.Forms assembly and add the namespace on top of your .h
Does this mean to put the below at the top of my .h file?
#include “System.Windows.Forms”
using System.Windows.Forms
The on button function in my code, created by VS, starts like this:
void Ctest1Dlg::OnBnClickedSelectLogFileButton()
{
And does not look anything like the example code:
void button1_Click( Object^ /*sender*/, System::EventArgs^ /*e*/ )
{
I read about the ^ character and still don’t make any sense of that.
I wonder why we need more obscure characters in C++. It seems like we are trying to turn C++ into APL.
And just to be certain, I am using Visual Studio 2008 under Windows XP Home.
Thanks for your time
|
|
|
|
|
"RE: to use this class you need to include the System.Windows.Forms assembly and add the namespace on top of your .h"
you need to add the namespace like:
using namespace System::Windows::Forms;
"I read about the ^ character and still don’t make any sense of that."
"In C++/CLI the only type of pointer is the normal C++ pointer, and the .NET reference types are accessed through a "handle", with the new syntax ClassName^ instead of ClassName*"
Source[^]
"I wonder why we need more obscure characters in C++. It seems like we are trying to turn C++ into APL."
Hopefully you are talking about C++/CLI and not pure C++! You cannot use managed classes in a pure C++ application.
Don't be overcome by evil, but overcome evil with good
|
|
|
|
|
bkelly13 wrote: I wonder why we need more obscure characters in C++. It seems like we are trying to turn C++ into APL.
C++/CLI should be treated as a separate language.
C++ is still C++. No obscure characters have been added.
Are you sure C++/CLI is what you want to use? There's also
a way to use the open file common dialog from native C++.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hello Mark,
RE: Are you sure C++/CLI is what you want to use? There's also
a way to use the open file common dialog from native C++.
No, I am not sure at all I want to mess with this. I activated Help from my Visual Studio to find out how to open a dialog for opening a file. I wound up here, but I am not at all sure where I want to be.
Thanks for your time
|
|
|
|
|
|
Good information. I had not found that.
Thank you for posting this.
Thanks for your time
|
|
|
|
|
Please Guide Connect Sqlserver with VC++6.0.
application is win32 consoleApplication
thanks very much
|
|
|
|
|
What have you tried coding so far? What exactly are you having trouble with?
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
I think there it is:
http://msdn.microsoft.com/cs-cz/beginner/bb308760(en-us).aspx
|
|
|
|
|
Hi,
I am writing a pure C++ programe. I need to use strcpy_s() in my programe. As of now my compiler is not supporting strcpy_s(), what should I need to do if i wan u to use strcpy_s(). Do i need to download any library of standard (ISO/IEC TR 24731 ), is it free?
I don know how to go about it, so please let me know how to get more info about it?
-Nandu
|
|
|
|
|
You cannot use strcpy_s in versions of C++ before VS 2005. Download Visual Studio Express for C++ if you want to use it for free. However, you loose MFC and ATL, for example. Please, direct your "native" C++ questions to the C++/MFC forum.
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
Hi,
I program with C++/CLI and Visual Studio 2005 currently.
I would like to improve my Application with graphical effects like highlighting selected bitmaps or
other Objects. I would also like to use shadows for Lines, Rects etc. But i don´t know how to.
Following would spring to mind
1) I try to use the simple Functions of System::Graphics. But I doubt i would manage to get good results. Are there any Code-Samples for higlighting and shadows?
2) I use the new WPF. But neither C++/CLI nor Visual Studio 05 seem to support it well...
3) I use DX or OpenGL. But i have no experience with it so far.
4) I use some other Library that might be around. Do you know any?
So I´d like to ask: What do you think would be the best solution?
I appreciate any help,
Best wishes
|
|
|
|
|
Hi All,
I could not find the actual difference between strcat_s() and strcat(). Is it possible to use this in MSVC++ 6.0, boz when I tried to strcat_s() I got the error "error C2065: 'strncpy_s' : undeclared identifier" (i hv tried using both #include <string.h> and #include <string>).
And other doubt is whether this will work both in UNIX and windows, as I am developing a C++ application which should be platform independent.
If i want to use strcat_s() in MSVC++ 6.0 which include file i need to use.
Thanks
Nandu
|
|
|
|
|
Nandu_77b wrote: Is it possible to use this in MSVC++ 6.0,
I don't think so. The "safe" string functions came with the CRT starting
with VC 2005.
And please post non-C++/CLI questions on the Visual C++/MFC board.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi
Is there any tool that could analyze managed C++ code to identify (i am using Visual Studion 2003).
1). memory leaks
2). index out of bounds
3). memory overruns
I have seen Devpartner and Rational PurifyPlus but they do not work with managed C++.
Thanks in advance.
-----------------
Every is Illusion
modified on Thursday, August 21, 2008 2:44 PM
|
|
|
|
|
Check out the ANTS Profiler[^] from Red Gate. I haven't used the memory profiler portion myself, but it's awesome for quickly finding speed bottlenecks in your code. Not very cheap, but well worth it IMHO.
Dybs
|
|
|
|
|
I have tried using Ants Profiler but it works on ".Net 2.0 Framework", I want something for ".Net 1.1"
These are the cases that I want the profiler to detect.
---------------------------------------------------------
Case 1
Reading values at an index that is out or range (using array).
Case 2
Writing values at an index that is out or range (using array).
Case 3
Reading values at an index that is out or range (using vector).
Case 4
Writing values at an index that is out or range (using vector).
Case 5
Memory leak.
Case 6
Memory overrun using array.
Case 7
Memory overrun using malloc
Case 8
Access memory that has been deleted
Every is Illusion
|
|
|
|
|
We have a desktop utility that has enjoyed some success in the market place and a vendor who’s mission is to tie things together has almost reverse engineered our internal API that we provide to a VB like scripting engine.
We Authenticode sign all our modules and are getting ready to introduce new functionality that uses .NET code in DLL’s.
Any suggestions on the best low impact way to make sure that we do not have unauthorized third parties attempting to use our functionality?
|
|
|
|