Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9126881
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T07:09:17+00:00 2026-06-17T07:09:17+00:00

I’m having an application with 2 winforms: Form1.h and TrackEdit.h. They’re both in the

  • 0

I’m having an application with 2 winforms: Form1.h and TrackEdit.h. They’re both in the same namespace (“ParkCleanUp2”).

From within Form1 I call this code:

ParkCleanUp2::TrackEdit^ te;

Where it gives me these errors:

Error   24  error C2039: 'TrackEdit' : is not a member of 'ParkCleanUp2' (TrackEdit.cpp)    c:\users\-joey\documents\visual studio 2010\projects\park cleanup 2\park cleanup 2\Form1.h  2332
Error   25  error C2065: 'TrackEdit' : undeclared identifier (TrackEdit.cpp)    c:\users\-joey\documents\visual studio 2010\projects\park cleanup 2\park cleanup 2\Form1.h  2332
Error   26  error C2065: 'te' : undeclared identifier (TrackEdit.cpp)   c:\users\-joey\documents\visual studio 2010\projects\park cleanup 2\park cleanup 2\Form1.h  2332

Though, if I go to TrackEdit.h it show me:

namespace ParkCleanUp2 {
 //Some namespae includes
     public ref class TrackEdit : public System::Windows::Forms::Form

So I’m wondering why it’s giving me the error “‘TrackEdit’ : is not a member of ‘ParkCleanUp2’” and why it’s looking into the TrackEdit.cpp file, while I included the .h file.
What I found to be weird, and maybe important to mention, is that when I comment the #include "Form1.h line in TrackEdit.h it just works perfect, but in TrackEdit.h I than can’t call Form1’s functions (like selected an item in a listbox) which I wanted to achieve.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T07:09:19+00:00Added an answer on June 17, 2026 at 7:09 am

    It appears you have both Form1.h and TrackEdit.h each #include-ing the other. Instead, have a forward declaration, and only include Form1.h from TrackEdit.cpp, and vise-versa.

    The double-include doesn’t work because you’ve got both classes referencing the other. Each class needs to know about the other in order to define itself. Since all you have is the full class definition, you’ve got a circular definition. Instead, the forward declaration provides just enough for the compiler to know “OK, there’s a class with that name, and that’s all I know about it”, and the circular dependency is resolved.

    (Also: When you edited the question, you removed the most important sentence: “so basically Form1.h includes TrackEdit.h, which includes Form1.h again”. That pattern is very rarely correct. If you see yourself doing that, provide more forward declarations instead.)

    Something like this:

    Form1.h:

    namespace ParkCleanUp2 {
        ref class TrackEdit;
    
        public ref class Form1 {
            TrackEdit^ track;
        };
    }
    

    TrackEdit.h:

    namespace ParkCleanUp2 {
        ref class Form1;
    
        public ref class TrackEdit {
            Form1^ parentForm;
        };
    }
    

    Form1.cpp and TrackEdit.cpp:

    #include "Form1.h"
    #include "TrackEdit.h"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
Does anyone know how can I replace this 2 symbol below from the string
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I am trying to find ID3V2 tags from MP3 file using jid3lib in Java.
I have this code to decode numeric html entities to the UTF8 equivalent character.
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
We're building an app, our first using Rails 3, and we're having to build

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.