title: Illegal call of non-static member function with struct & wifstream
body: <p>Alright so I am trying to use wifstream to read from my .txt and put into my structure. I keep getting issues with this code: Please tell me what I need to know about it and why its failing. Thanks &lt;3</p>
  
  <p>I have 8 errors and they are all:</p>
  
  <pre><code>std::basic_istream&lt;wchar_t,std::char_traits&lt;wchar_t&gt;&gt;::getline': none of the 2 overloads could convert all the argument types
  std::basic_istream&lt;wchar_t,std::char_traits&lt;wchar_t&gt;&gt;::getline': illegal call of non-static member function
  std::basic_istream&lt;wchar_t,std::char_traits&lt;wchar_t&gt;&gt;::getline': illegal call of non-static member function
  std::basic_istream&lt;wchar_t,std::char_traits&lt;wchar_t&gt;&gt;::getline': illegal call of non-static member function
  a nonstatic member reference must be relative to a specific object
  a nonstatic member reference must be relative to a specific object
  a nonstatic member reference must be relative to a specific object
  std::basic_ifstream&lt;_Elem, _Traits&gt;::getline [with _Elem=wchar_t, _Traits=std::char_traits&lt;wchar_t&gt;]" matches the argument list 
  </code></pre>
  
  <p>Code:</p>
  
  <pre><code>#include "stdafx.h"
  #include &lt;Windows.h&gt;
  #include &lt;Commctrl.h&gt;
  #include &lt;Windowsx.h&gt;
  #include &lt;shellapi.h&gt;
  #include &lt;TlHelp32.h&gt;
  #include &lt;wchar.h&gt;
  #include &lt;fstream&gt;
  
  //SQL Headers
  //Add SQL later with option to store games location.
  
  //Macros Tab1
  #define IDB_BUTTONLAUNCH 100
  #define IDB_PROCESSCHECKBOX 101
  
  //Macros Tab2
  #define IDB_SQLRADIOBUTTON 201
  #define IDB_NOTEPADRADIOBUTTON 202
  
  #pragma comment(linker,"\"/manifestdependency:type='win32' \
  name='Microsoft.Windows.Common-Controls' version='6.0.0.0' \
  processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")
  
  int numberAdder = 0;
  int *numberAdderPTR = &amp;numberAdder;
  
  struct gameSaved
  {
      int gameID = 0;
      static wchar_t szGameDirectory[100];
      static wchar_t szApplicationName[100];
      static wchar_t szComboName[100];
  };
  
  wchar_t gameSaved::szGameDirectory[100];
  wchar_t gameSaved::szApplicationName[100];
  wchar_t gameSaved::szComboName[100];
  gameSaved gameList[50];
  </code></pre>
  
  <hr>
  
  <pre><code>void WndProc (etc) // This is just representing that it is all global.
  {
              std::wifstream savedGames;
              savedGames.open(L"ComboBox Saved Games.txt");
               //Error Code is with all the std::wifstream::getline below
              while (std::wifstream::getline(gameList[numberAdder].gameID, 2))
              {
                  std::wifstream::getline(gameList[numberAdder].szGameDirectory, MAX_PATH);
                  std::wifstream::getline(gameList[numberAdder].szApplicationName, MAX_PATH);
                  std::wifstream::getline(gameList[numberAdder].szComboName, MAX_PATH);
                  ComboBox_AddString(hComboBoxTab1, gameList[numberAdder].szComboName);
                  *numberAdderPTR = gameList[numberAdder].gameID + 1;
              }
      }
  </code></pre>