Hi all,

I am using MFC dialog application and I have some global variables.

I am struggling with where and how I can declare an external function to make initialization for external or global variables and this function should bring the values from DB to store them in those global variables.

I tried to put the desired code without include them inside function structure after the ProjectNameApp theApp in the ProjectName.cpp// but failed

I tried to put the function declaration as a member function in the ProjectNameApp class and call it after the ProjectNameApp theApp in the ProjectName.cpp //but failed as well


I tried to put the function declaration as a member function in the ZZ.cpp and made the proper including //but failed and inform me that you can't initialize them into closed scope.

it seems to me that the initialization should be in the test.cpp and without function using. I don't believe that but how I can make it.


Please any one can help me?

Any help will be appreciated