Click here to Skip to main content
15,867,686 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: MFC APPLICATION Pin
ThatsAlok20-May-09 21:30
ThatsAlok20-May-09 21:30 
QuestionConvert C# to C++ MFC? Pin
nhenden6700020-May-09 17:33
nhenden6700020-May-09 17:33 
AnswerRe: Convert C# to C++ MFC? Pin
Chandrasekharan P20-May-09 17:49
Chandrasekharan P20-May-09 17:49 
AnswerRe: Convert C# to C++ MFC? Pin
Hamid_RT20-May-09 19:17
Hamid_RT20-May-09 19:17 
JokeRe: Convert C# to C++ MFC? Pin
ThatsAlok20-May-09 21:32
ThatsAlok20-May-09 21:32 
GeneralRe: Convert C# to C++ MFC? Pin
Hamid_RT21-May-09 2:32
Hamid_RT21-May-09 2:32 
JokeRe: Convert C# to C++ MFC? Pin
ThatsAlok20-May-09 21:31
ThatsAlok20-May-09 21:31 
QuestionHaving problems changing between forms. Pin
monkeyboy200920-May-09 16:54
monkeyboy200920-May-09 16:54 
Hi, I'm not a very knowledgable programmer in visual C++, as I've only learned from my Programming12 class which started in February. I hope that I can provide as much information as I can to help you understand my problem better. Thank you in advance for all of your help.

A bit about my program:
- It is a "Store" application, so I have Items and the user inputs the amount of money they have, and they buy which items they want accordingly. If they spend too much, when they try to go to the checkout, a messagebox tells them they have spent too much and must redo.
- I have 3 forms: "Form1", "Inventory", and "Checkout".
- I want to pass information between each (Prices/Quantities Bought/User's Name, etc.

To change forms, I was using

Inventory^ frm2 = gcnew Inventory();


and calling frm2 on the MAIN form (Form1), and on the "Inventory" form, I was using

Form^ frm1 = Application::OpenForms["Form1"];



I was having problems with that, so I decided to just use the following code to deal with it:

this->Size = System::Drawing::Size(124,20);
this->CenterToScreen();
this->TopMost = false;


This was to Change the Form1, and hide it behind the new form.

Then I would use this:
frm2->Show();
frm2->TopMost = true;

To show the 2nd form (Inventory)

Going between the Form1 and the Inventory forms was okay, but I can't seem to get to the 3rd form (Checkout) at all. I keep getting the error described in the title: "An unhandled exception of type 'System.NullReferenceException' occurred in System.Windows.Forms.dll Additional information: Object reference not set to an instance of an object."

Is there a better way I can go between forms than the ways described? How can I fix that error?
Any help will be much appreciated. I will provide as much information as necessary for you to understand better.

Thank you again,
Monkeyboy2009
AnswerRe: Having problems changing between forms. Pin
Chandrasekharan P20-May-09 19:17
Chandrasekharan P20-May-09 19:17 
GeneralRe: Having problems changing between forms. Pin
ThatsAlok20-May-09 21:36
ThatsAlok20-May-09 21:36 
GeneralRe: Having problems changing between forms. Pin
Chandrasekharan P20-May-09 21:52
Chandrasekharan P20-May-09 21:52 
AnswerRe: Having problems changing between forms. Pin
ThatsAlok20-May-09 21:36
ThatsAlok20-May-09 21:36 
QuestionHelp me! Pin
nhenden6700020-May-09 16:11
nhenden6700020-May-09 16:11 
AnswerRe: Help me! Pin
Hamid_RT20-May-09 19:22
Hamid_RT20-May-09 19:22 
AnswerRe: Help me! Pin
ThatsAlok20-May-09 21:38
ThatsAlok20-May-09 21:38 
Questionpointer and address? Pin
dec8220-May-09 15:45
dec8220-May-09 15:45 
AnswerRe: pointer and address? Pin
Chris Losinger20-May-09 16:33
professionalChris Losinger20-May-09 16:33 
AnswerRe: pointer and address? Pin
ThatsAlok20-May-09 21:39
ThatsAlok20-May-09 21:39 
AnswerRe: pointer and address? Pin
CPallini21-May-09 0:12
mveCPallini21-May-09 0:12 
QuestionUsing Multithreading to encrypt a file Pin
Sh_oK20-May-09 14:16
Sh_oK20-May-09 14:16 
AnswerRe: Using Multithreading to encrypt a file Pin
Chris Losinger20-May-09 15:19
professionalChris Losinger20-May-09 15:19 
GeneralRe: Using Multithreading to encrypt a file Pin
Sh_oK25-May-09 13:02
Sh_oK25-May-09 13:02 
QuestionGetting a disabled CView to give a strong visual cue of being disabled, so that the user understands that it isn't a bug that it's disabled. Pin
Sternocera20-May-09 9:58
Sternocera20-May-09 9:58 
GeneralRe: Getting a disabled CView to give a strong visual cue of being disabled, so that the user understands that it isn't a bug that it's disabled. Pin
Michael Dunn20-May-09 10:43
sitebuilderMichael Dunn20-May-09 10:43 
GeneralRe: Getting a disabled CView to give a strong visual cue of being disabled, so that the user understands that it isn't a bug that it's disabled. Pin
Sternocera20-May-09 11:32
Sternocera20-May-09 11:32 

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.