Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. reaching other classes

reaching other classes

Scheduled Pinned Locked Moved C / C++ / MFC
c++csharphelpquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    deniz79s
    wrote on last edited by
    #1

    i use visual C++.Net. at starting a new form is formed automaticaly that's name is Form1. but after i form the second form that is Form2, i cannot reach any variable or function in Form1. since i write #include "Form2.h" in Form1.h so i can use any variable or function in Form2 but i don't write #include "Form1.h" in Form2.h so i cannot reach things that is in Form1. when i write #include "Form2.h" in Form1.h and #include "Form1.h" in Form2.h after this the compiler give an error that is "multiple defined variables and functions". so how can i reach the Form1 from Form2.:omg:

    D 1 Reply Last reply
    0
    • D deniz79s

      i use visual C++.Net. at starting a new form is formed automaticaly that's name is Form1. but after i form the second form that is Form2, i cannot reach any variable or function in Form1. since i write #include "Form2.h" in Form1.h so i can use any variable or function in Form2 but i don't write #include "Form1.h" in Form2.h so i cannot reach things that is in Form1. when i write #include "Form2.h" in Form1.h and #include "Form1.h" in Form2.h after this the compiler give an error that is "multiple defined variables and functions". so how can i reach the Form1 from Form2.:omg:

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      Look at the top of a .h file that ClassWizard creates. Notice that it adds both #if !defined and a #pragma once preprocessor directives. Those are to keep the file from being included more than once.


      "When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups