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
C

coadtoad

@coadtoad
About
Posts
2
Topics
0
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • C++ Array Of Function Pointers problem
    C coadtoad

    If you want to have function pointers, I believe that the functions must be static, then you can't see the member variables from the static function. You may need to use a different approach like calling a CDialog member function that uses a switch statement to call the member functions. A little bit more messy, but you will have better encapsulation than writing a series of static functions. Coadtoad

    C / C++ / MFC help c++ data-structures debugging

  • C++ Array Of Function Pointers problem
    C coadtoad

    Your functions are public members. Are you initializing them in the .cpp file at the global scope or in a member function? If global, then I think that you are defining a new array that happens to have the same name as your member variable. You are not assigning values to your member array. Then when you call the function, the array is not initialized. Try this: In your OnInitDialog(): // Init the functions pointers here functionarray1[0] = CDialog::Func1 ; functionarray1[1] = CDialog::Func2 ; Later: // call the functions functionarray1[0]() ; functionarray1[1]() ; Make sure you declare Func1 and Func2 as static in CDialog.h void (*functionarray1[48])(); void static Func1() ; void static Func2() ; Coadtoad

    C / C++ / MFC help c++ data-structures debugging
  • Login

  • Don't have an account? Register

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