static functions win32 oop

This is a discussion on static functions win32 oop within the Windows Programming forums, part of the Platform Specific Boards category; Hello, I have a problem understanding something. Am am just starting out with the Win32Api and think it's fun to ...

  1. #1
    nickeax
    Guest

    Red face static functions win32 oop

    Hello, I have a problem understanding something. Am am just starting out with the Win32Api and think it's fun to work with, but I am trying to do it in an object orientated way. The main problem is that my friend told me I will need to make winmain() into a static function. Could someone please give me a simple explanation of what a static function actually is?? Thanks!!

  2. #2
    Skunkmeister Stoned_Coder's Avatar
    Join Date
    Aug 2001
    Posts
    2,572
    A static function has internal linkage. That means it can only be seen in the file it is declared in.

    I actually think you mean a static member function.
    This is a member function of a class that is declared static. It cannot access any class data that is held on a per - object basis.It may access static class data though. When accessing a public static function you do not need an object. because they follow normal function pointer calling convention rather than _thiscall you can use a static member function as a WNDPROC.
    Free the weed!! Class B to class C is not good enough!!
    And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. How do i do this? (static structure inside class)
    By 39ster in forum C++ Programming
    Replies: 4
    Last Post: 11-17-2008, 02:14 AM
  2. seg fault at vectornew
    By tytelizgal in forum C Programming
    Replies: 2
    Last Post: 10-25-2008, 01:22 PM
  3. question about static members and functions
    By e66n06 in forum C++ Programming
    Replies: 5
    Last Post: 01-07-2008, 01:41 PM
  4. opengl program as win API menu item
    By SAMSAM in forum Game Programming
    Replies: 1
    Last Post: 03-03-2003, 06:48 PM
  5. bug for static functions in template class
    By Unregistered in forum C++ Programming
    Replies: 3
    Last Post: 09-16-2001, 06:38 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21