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. Calling the functions from different class

Calling the functions from different class

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestionannouncement
3 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.
  • A Offline
    A Offline
    aravind sn
    wrote on last edited by
    #1

    Hello all, im very much confused with this make this snippet work,, let me explain my problem in simple. please follow the folling code. class ClassA { public: function_A(); function_B(); } class Class1 { public: ClassA A1 Function_1(); } class Class1::Function_1() { Dlg1.DoModal(); A1.function_A(); A1.function_B(); } class ClassDlg { FunDlg(); } ClassDlg::OnRefresh() { i wanted "A1.function_A();" i wanted "A1.function_B();" } The Dialog window will be called by "Class1::Function_1()" so after closing the dialog window the function "A1.function_A();" and "A1.function_B();" are called in order to update the contents of the mainpage(say property page). actually the contents are modified in the dialog window. so what i wanted to do is call the functions "A1.function_A();" and "A1.function_B();" before closing the dialog window say at after pressing the"Refresh" button(OnRefresh will be called). Im confused its not just happening what i desired. can any expert give me a solution, like is there any try statement i can give..?? please help me...

    _ 1 Reply Last reply
    0
    • A aravind sn

      Hello all, im very much confused with this make this snippet work,, let me explain my problem in simple. please follow the folling code. class ClassA { public: function_A(); function_B(); } class Class1 { public: ClassA A1 Function_1(); } class Class1::Function_1() { Dlg1.DoModal(); A1.function_A(); A1.function_B(); } class ClassDlg { FunDlg(); } ClassDlg::OnRefresh() { i wanted "A1.function_A();" i wanted "A1.function_B();" } The Dialog window will be called by "Class1::Function_1()" so after closing the dialog window the function "A1.function_A();" and "A1.function_B();" are called in order to update the contents of the mainpage(say property page). actually the contents are modified in the dialog window. so what i wanted to do is call the functions "A1.function_A();" and "A1.function_B();" before closing the dialog window say at after pressing the"Refresh" button(OnRefresh will be called). Im confused its not just happening what i desired. can any expert give me a solution, like is there any try statement i can give..?? please help me...

      _ Offline
      _ Offline
      _AnsHUMAN_
      wrote on last edited by
      #2

      From your question it seems that you want to call the function of classA from ClassDlg. Why don't you create the object for class A in ClassDlg as well as you do in Class1? or please rephrase your question if I understood incorrectly.

      You need to google first, if you have "It's urgent please" mentioned in your question. ;-)_AnShUmAn_

      A 1 Reply Last reply
      0
      • _ _AnsHUMAN_

        From your question it seems that you want to call the function of classA from ClassDlg. Why don't you create the object for class A in ClassDlg as well as you do in Class1? or please rephrase your question if I understood incorrectly.

        You need to google first, if you have "It's urgent please" mentioned in your question. ;-)_AnShUmAn_

        A Offline
        A Offline
        aravind sn
        wrote on last edited by
        #3

        Hi anshuman, thanks for your reply, Actually,A1(object of ClassA) is like a handle to the table in the mainpage(flex grid). if i create 2 bjects that will create 2 flex grids. Instead i just wanted to update the already created table contents by this object A1. "Dlg1" is the object of class "ClassDlg" where class ClassDlg { public: FunDlg(); OnRefresh() } i just wanted to call these function say "A1.function_A(); and A1.function_B();" inside the member function of class ClassDlg.

        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