943,589 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 960
  • C++ RSS
Nov 5th, 2008
0

#include "form.h" problem

Expand Post »
I am encounter a problem that I dont understand what is happening.

I use the Form application where I from Form4 will open Form22 like this wich works.

C++ Syntax (Toggle Plain Text)
  1. #pragma once
  2. #include "stdafx.h"
  3. #include "Form22.h"
  4.  
  5. Form22 ^form22 = gcnew Form22;
  6. form22->ShowDialog();


What I need to do now is to #include "Form4.h" in Form22 like this:
C++ Syntax (Toggle Plain Text)
  1. #pragma once
  2. #include "stdafx.h"
  3. #include "Form4.h"

I also tried this in Form22:
C++ Syntax (Toggle Plain Text)
  1. #pragma once
  2. #include "stdafx.h"
  3.  
  4. #ifndef FORM4_H
  5. #define FORM4_H
  6. #include "Form4.h"
  7. #endif

But if I try to #include "Form4.h" in Form22, I will have a compileError that says this. So I dont know why this is happening and what I can do about it.

'Form22' : undeclared identifier
'form22' : undeclared identifier
Last edited by Jennifer84; Nov 5th, 2008 at 6:40 pm.
Similar Threads
Reputation Points: 10
Solved Threads: 1
Posting Pro
Jennifer84 is offline Offline
563 posts
since Feb 2008
Nov 6th, 2008
0

Re: #include "form.h" problem

My actual case is that I need to know how it is possible to pass a "string" from Form22 to Form4.

The test I could think of could be:

Lets say that Form22 has a textBox1 that has the string "Hello".
Then when pressing the button "OK" that will close the Form22,
then Form4 will show a MessageBox with "Hello".

Within a Form I know how to do this but many get stuck when doing
this through forms.
So I wonder how I will begin this ?

Thank you
Reputation Points: 10
Solved Threads: 1
Posting Pro
Jennifer84 is offline Offline
563 posts
since Feb 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: What's wrong with the return of this function call?
Next Thread in C++ Forum Timeline: please help with code emmidiately





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC