dbharrison
Technical User
I am currently working on a Peer to Peer Networking application created using Visual C++ 6 Application Wizard. The application uses AfxBeginThread to start a new thread and it is desireable to create the thread function outside the classes created using the Application Wizard, i.e. as a global function and using global variables(the reasons for this are to do with passing of parameters to the thread function).
I have not had to do this before and am having some difficulty with it. Again, using the Application Wizard I added a neww Source File and Header File to the project. I placed the thread function in the source file and the data declarations in the header file and, as expected they showed up in the Class window as Globals and should therefore be accessible from any of the classes (the CView class in this case) but when I try to compile the program both the global function and the global variables show up as "undeclared identifiers" in the view class, error C2065.
If I include the header file inside the CView source file then the variables are shown as being declared twice and again the compilation fails
Have I missed something here?
Thanks for any help available
Boatprog
I have not had to do this before and am having some difficulty with it. Again, using the Application Wizard I added a neww Source File and Header File to the project. I placed the thread function in the source file and the data declarations in the header file and, as expected they showed up in the Class window as Globals and should therefore be accessible from any of the classes (the CView class in this case) but when I try to compile the program both the global function and the global variables show up as "undeclared identifiers" in the view class, error C2065.
If I include the header file inside the CView source file then the variables are shown as being declared twice and again the compilation fails
Have I missed something here?
Thanks for any help available
Boatprog