![]() |
|
#1
|
|||
|
|||
How to implement a global function function in C++Hi,
Could you tell me how to declare and implement a global function in C++, which can be accessed from any of the class in a particular application. My requirement is to programmatically terminate a MFC application from a generic C++ class added to the application. I found the following method which is supposed to be implemented as a global function. CPP / C++ / C Code:
but I could not find the correct way to implement a global function. Any help would be greatly appreciated. Thank you very much in advance. regards, Haini. Last edited by LuciWiz : 30-Jan-2009 at 08:19.
Reason: Please insert your C++ code between [cpp] & [/cpp] tags
|
|||
|
#2
|
|||
|
|||
Re: How to implement a global function function in C++well im just a begginer but I would assume create an implemintation file, ExitMFC.cpp for example or add the function to an existing one and declare the prototype in the header.h file used by all other modules?
DAn |
|
#3
|
|||
|
|||
Re: How to implement a global function function in C++Hi,
Thanks for replying. But my concern is where in the header file I declare the prototype. If I declare a prototype of a function in a header file of a particular class, that function is accessible only within the scope of that class. But I need the function to be globally visible. Thank you. regards, Hasini. |
|
#4
|
|||
|
|||
Re: How to implement a global function function in C++Quote:
CPP / C++ / C Code:
|
Recent GIDBlog
Toyota - 2009 May Promotion by Nihal
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| run script command on ns2.26 | newbie06 | Computer Software Forum - Linux | 65 | 19-Aug-2009 08:50 |
| Airport Log program using 3D linked List : problem reading from file | batrsau | C Programming Language | 11 | 29-Feb-2008 08:44 |
| Flex and bison coding | lucky88star | C++ Forum | 5 | 24-Dec-2007 12:57 |
| Need Help with input files. | Efferus | C++ Forum | 2 | 24-Nov-2007 17:19 |
| [Include] Doubly-linked List | dsmith | C Programming Language | 6 | 14-Apr-2006 14:12 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The