<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[OpenGL Code Problem]]></title><description><![CDATA[<p>Hallo, ich habe mir vor kurzem das Buch &quot;3D-Grafik mit OpenGl&quot; gekauft, da ich nun von 2D auf 3D umsteigen wollte, nur ich werde schon mit Fehlermeldungen bei dem ersten Beispielprogramm beschmissen, dass ich von der CD kopiert habe. Ich benutze Visual Studio C++ 2010 (Vieleicht liegt es ja da drann). Hoffe ihr könnt mir helfen, da dies nicht in dem Buch beschrieben ist.</p>
<p>screen_interface.h :</p>
<pre><code>#ifndef SCREEN_INTERFACE_H
#define SCREEN_INTERFACE_H

#include &lt;windows.h&gt;
#include &lt;stdlib.h&gt;
#include &lt;stdio.h&gt;
#include &lt;string.h&gt;

typedef unsigned char uchar;
typedef unsigned short ushort;
typedef unsigned long ulong;

void exit_error( char *message );
void exit_nofile( char *user, char *filename );
void exit_nomemory( char *user, char *array );
void message( char *title, char *message );

#define x_res screen_interface.get_xr()
#define y_res screen_interface.get_yr()

#define WIN32_LEAN_AND_MEAN

LRESULT CALLBACK main_window_procedure( HWND main_window_handle, UINT message, WPARAM wparam, LPARAM lparam )
{
  if( message == WM_CLOSE ) {  PostQuitMessage( 0 );  return 0;  }

  return DefWindowProc( main_window_handle, message, wparam, lparam );
}

class hardware_interface
{
  private:
	uchar enlarged;
	long x_resolution, y_resolution;

    HWND main_window_handle;
    HDC device_context;
    HGLRC rendering_context;
	DEVMODE old_screen_settings;

    void initialise_platform( void );

  public:
    void fullscreen( HINSTANCE hInstance, long xr, long yr );
	void open_window( HINSTANCE hInstance, long xr, long yr );
    void close_window( void );

	long get_xr( void ) {  return x_resolution;  }
    long get_yr( void ) {  return y_resolution;  }

    void swap_buffers( void ) {  SwapBuffers( device_context );  }

	hardware_interface( void ) : enlarged( 0 ), x_resolution( 0 ), y_resolution( 0 )
    {
      main_window_handle = NULL;  device_context = NULL;  rendering_context = NULL;
      memset( &amp;old_screen_settings, 0, sizeof( old_screen_settings ) );
    }
   ~hardware_interface( void ) {  close_window();  }
} screen_interface;

void hardware_interface::fullscreen( HINSTANCE hinst, long xr, long yr )
{
  x_resolution = xr;  y_resolution = yr;
  enlarged = 1;

  if( EnumDisplaySettings( NULL, ENUM_CURRENT_SETTINGS, &amp;old_screen_settings ) != TRUE )
	exit_error( &quot;Fehler während der Ermittlung der aktuellen Bildschirmbetriebsart.\n&quot; );

  WNDCLASS winclass;

  winclass.style = CS_OWNDC;
  winclass.lpfnWndProc = main_window_procedure;
  winclass.cbClsExtra = 0;
  winclass.cbWndExtra = 0;
  winclass.hInstance = hinst;
  winclass.hIcon = LoadIcon( NULL, IDI_APPLICATION );
  winclass.hCursor = LoadCursor( NULL, IDC_ARROW );
  winclass.hbrBackground = (HBRUSH) GetStockObject( BLACK_BRUSH );
  winclass.lpszMenuName = NULL;
  winclass.lpszClassName = &quot;Main Window&quot;;
  RegisterClass( &amp;winclass );

  char window_name[] = &quot;3D-Grafik Programmierung&quot;;

  main_window_handle = CreateWindowEx
  (
    WS_EX_TOPMOST, &quot;Main Window&quot;, window_name, WS_VISIBLE | WS_POPUP,
    0,0, xr, yr, NULL, NULL, hinst, NULL
  );

  if( main_window_handle == 0 )
    exit_error( &quot;Fehler beim Öffnen des Programmfensters.\n&quot; );

  long bit_depth = 32;

  DEVMODE new_screen_settings;

  memset( &amp;new_screen_settings, 0, sizeof( new_screen_settings ) );
  new_screen_settings.dmSize = sizeof( new_screen_settings );
  new_screen_settings.dmPelsWidth = xr;
  new_screen_settings.dmPelsHeight = yr;
  new_screen_settings.dmBitsPerPel = bit_depth;
  new_screen_settings.dmFields = DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT;

  if( ChangeDisplaySettings( &amp;new_screen_settings, 0 ) != DISP_CHANGE_SUCCESSFUL )
	exit_error( &quot;Fehler beim Einstellen der gewünschten Bildschirmbetriebsart.\n&quot; );

  ShowCursor( 0 );

  initialise_platform();
}

void hardware_interface::open_window( HINSTANCE hinst, long xr, long yr )
{
  x_resolution = xr;  y_resolution = yr;
  long bit_depth = 32;

  WNDCLASS winclass;

  winclass.style = CS_OWNDC;
  winclass.lpfnWndProc = main_window_procedure;
  winclass.cbClsExtra = 0;
  winclass.cbWndExtra = 0;
  winclass.hInstance = hinst;
  winclass.hIcon = LoadIcon( NULL, IDI_APPLICATION );
  winclass.hCursor = LoadCursor( NULL, IDC_ARROW );
  winclass.hbrBackground = (HBRUSH) GetStockObject( BLACK_BRUSH );
  winclass.lpszMenuName = NULL;
  winclass.lpszClassName = &quot;Main Window&quot;;
  RegisterClass( &amp;winclass );

  int x_add = 2 * (GetSystemMetrics( SM_CXBORDER ) + GetSystemMetrics( SM_CXEDGE ));
  int y_add = 2 * (GetSystemMetrics( SM_CYBORDER ) + GetSystemMetrics( SM_CYEDGE )) + GetSystemMetrics( SM_CYCAPTION );

  char window_name[] = &quot;Grafikprogrammierung mit OpenGL&quot;;

  main_window_handle = CreateWindow
  (
    &quot;Main Window&quot;, window_name, WS_CAPTION | WS_POPUPWINDOW | WS_VISIBLE,
    0, 0, xr+x_add, yr+y_add, NULL, NULL, hinst, NULL
  );

  if( main_window_handle == 0 )
    exit_error( &quot;Fehler beim Öffnen des Programmfensters.\n&quot; );

  initialise_platform();
}

void hardware_interface::initialise_platform( void )
{
  PIXELFORMATDESCRIPTOR pfd;
  int format;

  memset( &amp;pfd, 0, sizeof( pfd ) );
  pfd.nSize = sizeof( pfd );
  pfd.nVersion = 1;
  pfd.dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL;// | PFD_DOUBLEBUFFER;
  pfd.iPixelType = PFD_TYPE_RGBA;
  pfd.cColorBits = 32;
  pfd.cDepthBits = 32;
  pfd.cAlphaBits = 8;
  pfd.iLayerType = PFD_MAIN_PLANE;

  device_context = GetDC( main_window_handle );
  format = ChoosePixelFormat( device_context, &amp;pfd );
  SetPixelFormat( device_context, format, &amp;pfd );

  rendering_context = wglCreateContext( device_context );
  wglMakeCurrent( device_context, rendering_context );

  glMatrixMode( GL_PROJECTION );  glLoadIdentity();
  gluOrtho2D( 0, x_resolution, 0, y_resolution );
  glMatrixMode( GL_MODELVIEW );
}

void hardware_interface::close_window( void )
{
  if( enlarged )
    if( ChangeDisplaySettings( &amp;old_screen_settings, 0 ) != DISP_CHANGE_SUCCESSFUL )
	  exit_error( &quot;Fehler beim Einstellen der ursprünglichen Bildschirmbetriebsart.\n&quot; );

  wglMakeCurrent( NULL, NULL );
  wglDeleteContext( rendering_context );
  ReleaseDC( main_window_handle, device_context );

  DestroyWindow( main_window_handle );
}

void exit_error( char *message )
{
  screen_interface.close_window();

  ShowCursor( 1 );
  MessageBox( NULL, message, &quot;Programmabbruch nach einem schwerwiegenden Fehler&quot;, MB_OK );

  exit( 1 );
}

void exit_error( char *message, char *title )
{
  screen_interface.close_window();

  ShowCursor( 1 );
  MessageBox( NULL, message, title, MB_OK );

  exit( 1 );
}

void exit_nofile( char *user, char *filename )
{
  char string[ 500 ];
  sprintf( string, &quot;%s: Fehler beim Öffnen der Datei '%s'.\n&quot;, user, filename );

  exit_error( string );
}

void exit_nomemory( char *user, char *array )
{
  char string[ 500 ];
  sprintf( string, &quot;%s: Fehler während der Reservierung von Arbeitsspeicher für das Array '%s'.\n&quot;, user, array );

  exit_error( string );
}

void message( char *title, char *message )
{
  MessageBox( NULL, message, title, MB_OK ); 
}

#endif
</code></pre>
<p>Fehlermeldungen :</p>
<blockquote>
<p>1&gt;------ Erstellen gestartet: Projekt: Projekt, Konfiguration: Debug Win32 ------<br />
1&gt; main.cpp<br />
1&gt;c:\users\robin\desktop\opengl\projekt\projekt\screen_interface.h(80): error C2440: '=': 'const char [12]' kann nicht in 'LPCWSTR' konvertiert werden<br />
1&gt; Die Typen, auf die verwiesen wird, sind nicht verknüpft; die Konvertierung erfordert einen reinterpret_cast-Operator oder eine Typumwandlung im C- oder Funktionsformat.<br />
1&gt;c:\users\robin\desktop\opengl\projekt\projekt\screen_interface.h(89): error C2664: 'CreateWindowExW': Konvertierung des Parameters 2 von 'const char [12]' in 'LPCWSTR' nicht möglich<br />
1&gt; Die Typen, auf die verwiesen wird, sind nicht verknüpft; die Konvertierung erfordert einen reinterpret_cast-Operator oder eine Typumwandlung im C- oder Funktionsformat.<br />
1&gt;c:\users\robin\desktop\opengl\projekt\projekt\screen_interface.h(129): error C2440: '=': 'const char [12]' kann nicht in 'LPCWSTR' konvertiert werden<br />
1&gt; Die Typen, auf die verwiesen wird, sind nicht verknüpft; die Konvertierung erfordert einen reinterpret_cast-Operator oder eine Typumwandlung im C- oder Funktionsformat.<br />
1&gt;c:\users\robin\desktop\opengl\projekt\projekt\screen_interface.h(141): error C2664: 'CreateWindowExW': Konvertierung des Parameters 2 von 'const char [12]' in 'LPCWSTR' nicht möglich<br />
1&gt; Die Typen, auf die verwiesen wird, sind nicht verknüpft; die Konvertierung erfordert einen reinterpret_cast-Operator oder eine Typumwandlung im C- oder Funktionsformat.<br />
1&gt;c:\users\robin\desktop\opengl\projekt\projekt\screen_interface.h(194): error C2664: 'MessageBoxW': Konvertierung des Parameters 2 von 'char *' in 'LPCWSTR' nicht möglich<br />
1&gt; Die Typen, auf die verwiesen wird, sind nicht verknüpft; die Konvertierung erfordert einen reinterpret_cast-Operator oder eine Typumwandlung im C- oder Funktionsformat.<br />
1&gt;c:\users\robin\desktop\opengl\projekt\projekt\screen_interface.h(204): error C2664: 'MessageBoxW': Konvertierung des Parameters 2 von 'char *' in 'LPCWSTR' nicht möglich<br />
1&gt; Die Typen, auf die verwiesen wird, sind nicht verknüpft; die Konvertierung erfordert einen reinterpret_cast-Operator oder eine Typumwandlung im C- oder Funktionsformat.<br />
1&gt;c:\users\robin\desktop\opengl\projekt\projekt\screen_interface.h(227): error C2664: 'MessageBoxW': Konvertierung des Parameters 2 von 'char *' in 'LPCWSTR' nicht möglich<br />
1&gt; Die Typen, auf die verwiesen wird, sind nicht verknüpft; die Konvertierung erfordert einen reinterpret_cast-Operator oder eine Typumwandlung im C- oder Funktionsformat.<br />
========== Erstellen: 0 erfolgreich, Fehler bei 1, 0 aktuell, 0 übersprungen ==========</p>
</blockquote>
]]></description><link>https://www.c-plusplus.net/forum/topic/324101/opengl-code-problem</link><generator>RSS for Node</generator><lastBuildDate>Wed, 15 Jul 2026 04:35:33 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/324101.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 03 Mar 2014 10:27:44 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to OpenGL Code Problem on Mon, 03 Mar 2014 10:27:44 GMT]]></title><description><![CDATA[<p>Hallo, ich habe mir vor kurzem das Buch &quot;3D-Grafik mit OpenGl&quot; gekauft, da ich nun von 2D auf 3D umsteigen wollte, nur ich werde schon mit Fehlermeldungen bei dem ersten Beispielprogramm beschmissen, dass ich von der CD kopiert habe. Ich benutze Visual Studio C++ 2010 (Vieleicht liegt es ja da drann). Hoffe ihr könnt mir helfen, da dies nicht in dem Buch beschrieben ist.</p>
<p>screen_interface.h :</p>
<pre><code>#ifndef SCREEN_INTERFACE_H
#define SCREEN_INTERFACE_H

#include &lt;windows.h&gt;
#include &lt;stdlib.h&gt;
#include &lt;stdio.h&gt;
#include &lt;string.h&gt;

typedef unsigned char uchar;
typedef unsigned short ushort;
typedef unsigned long ulong;

void exit_error( char *message );
void exit_nofile( char *user, char *filename );
void exit_nomemory( char *user, char *array );
void message( char *title, char *message );

#define x_res screen_interface.get_xr()
#define y_res screen_interface.get_yr()

#define WIN32_LEAN_AND_MEAN

LRESULT CALLBACK main_window_procedure( HWND main_window_handle, UINT message, WPARAM wparam, LPARAM lparam )
{
  if( message == WM_CLOSE ) {  PostQuitMessage( 0 );  return 0;  }

  return DefWindowProc( main_window_handle, message, wparam, lparam );
}

class hardware_interface
{
  private:
	uchar enlarged;
	long x_resolution, y_resolution;

    HWND main_window_handle;
    HDC device_context;
    HGLRC rendering_context;
	DEVMODE old_screen_settings;

    void initialise_platform( void );

  public:
    void fullscreen( HINSTANCE hInstance, long xr, long yr );
	void open_window( HINSTANCE hInstance, long xr, long yr );
    void close_window( void );

	long get_xr( void ) {  return x_resolution;  }
    long get_yr( void ) {  return y_resolution;  }

    void swap_buffers( void ) {  SwapBuffers( device_context );  }

	hardware_interface( void ) : enlarged( 0 ), x_resolution( 0 ), y_resolution( 0 )
    {
      main_window_handle = NULL;  device_context = NULL;  rendering_context = NULL;
      memset( &amp;old_screen_settings, 0, sizeof( old_screen_settings ) );
    }
   ~hardware_interface( void ) {  close_window();  }
} screen_interface;

void hardware_interface::fullscreen( HINSTANCE hinst, long xr, long yr )
{
  x_resolution = xr;  y_resolution = yr;
  enlarged = 1;

  if( EnumDisplaySettings( NULL, ENUM_CURRENT_SETTINGS, &amp;old_screen_settings ) != TRUE )
	exit_error( &quot;Fehler während der Ermittlung der aktuellen Bildschirmbetriebsart.\n&quot; );

  WNDCLASS winclass;

  winclass.style = CS_OWNDC;
  winclass.lpfnWndProc = main_window_procedure;
  winclass.cbClsExtra = 0;
  winclass.cbWndExtra = 0;
  winclass.hInstance = hinst;
  winclass.hIcon = LoadIcon( NULL, IDI_APPLICATION );
  winclass.hCursor = LoadCursor( NULL, IDC_ARROW );
  winclass.hbrBackground = (HBRUSH) GetStockObject( BLACK_BRUSH );
  winclass.lpszMenuName = NULL;
  winclass.lpszClassName = &quot;Main Window&quot;;
  RegisterClass( &amp;winclass );

  char window_name[] = &quot;3D-Grafik Programmierung&quot;;

  main_window_handle = CreateWindowEx
  (
    WS_EX_TOPMOST, &quot;Main Window&quot;, window_name, WS_VISIBLE | WS_POPUP,
    0,0, xr, yr, NULL, NULL, hinst, NULL
  );

  if( main_window_handle == 0 )
    exit_error( &quot;Fehler beim Öffnen des Programmfensters.\n&quot; );

  long bit_depth = 32;

  DEVMODE new_screen_settings;

  memset( &amp;new_screen_settings, 0, sizeof( new_screen_settings ) );
  new_screen_settings.dmSize = sizeof( new_screen_settings );
  new_screen_settings.dmPelsWidth = xr;
  new_screen_settings.dmPelsHeight = yr;
  new_screen_settings.dmBitsPerPel = bit_depth;
  new_screen_settings.dmFields = DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT;

  if( ChangeDisplaySettings( &amp;new_screen_settings, 0 ) != DISP_CHANGE_SUCCESSFUL )
	exit_error( &quot;Fehler beim Einstellen der gewünschten Bildschirmbetriebsart.\n&quot; );

  ShowCursor( 0 );

  initialise_platform();
}

void hardware_interface::open_window( HINSTANCE hinst, long xr, long yr )
{
  x_resolution = xr;  y_resolution = yr;
  long bit_depth = 32;

  WNDCLASS winclass;

  winclass.style = CS_OWNDC;
  winclass.lpfnWndProc = main_window_procedure;
  winclass.cbClsExtra = 0;
  winclass.cbWndExtra = 0;
  winclass.hInstance = hinst;
  winclass.hIcon = LoadIcon( NULL, IDI_APPLICATION );
  winclass.hCursor = LoadCursor( NULL, IDC_ARROW );
  winclass.hbrBackground = (HBRUSH) GetStockObject( BLACK_BRUSH );
  winclass.lpszMenuName = NULL;
  winclass.lpszClassName = &quot;Main Window&quot;;
  RegisterClass( &amp;winclass );

  int x_add = 2 * (GetSystemMetrics( SM_CXBORDER ) + GetSystemMetrics( SM_CXEDGE ));
  int y_add = 2 * (GetSystemMetrics( SM_CYBORDER ) + GetSystemMetrics( SM_CYEDGE )) + GetSystemMetrics( SM_CYCAPTION );

  char window_name[] = &quot;Grafikprogrammierung mit OpenGL&quot;;

  main_window_handle = CreateWindow
  (
    &quot;Main Window&quot;, window_name, WS_CAPTION | WS_POPUPWINDOW | WS_VISIBLE,
    0, 0, xr+x_add, yr+y_add, NULL, NULL, hinst, NULL
  );

  if( main_window_handle == 0 )
    exit_error( &quot;Fehler beim Öffnen des Programmfensters.\n&quot; );

  initialise_platform();
}

void hardware_interface::initialise_platform( void )
{
  PIXELFORMATDESCRIPTOR pfd;
  int format;

  memset( &amp;pfd, 0, sizeof( pfd ) );
  pfd.nSize = sizeof( pfd );
  pfd.nVersion = 1;
  pfd.dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL;// | PFD_DOUBLEBUFFER;
  pfd.iPixelType = PFD_TYPE_RGBA;
  pfd.cColorBits = 32;
  pfd.cDepthBits = 32;
  pfd.cAlphaBits = 8;
  pfd.iLayerType = PFD_MAIN_PLANE;

  device_context = GetDC( main_window_handle );
  format = ChoosePixelFormat( device_context, &amp;pfd );
  SetPixelFormat( device_context, format, &amp;pfd );

  rendering_context = wglCreateContext( device_context );
  wglMakeCurrent( device_context, rendering_context );

  glMatrixMode( GL_PROJECTION );  glLoadIdentity();
  gluOrtho2D( 0, x_resolution, 0, y_resolution );
  glMatrixMode( GL_MODELVIEW );
}

void hardware_interface::close_window( void )
{
  if( enlarged )
    if( ChangeDisplaySettings( &amp;old_screen_settings, 0 ) != DISP_CHANGE_SUCCESSFUL )
	  exit_error( &quot;Fehler beim Einstellen der ursprünglichen Bildschirmbetriebsart.\n&quot; );

  wglMakeCurrent( NULL, NULL );
  wglDeleteContext( rendering_context );
  ReleaseDC( main_window_handle, device_context );

  DestroyWindow( main_window_handle );
}

void exit_error( char *message )
{
  screen_interface.close_window();

  ShowCursor( 1 );
  MessageBox( NULL, message, &quot;Programmabbruch nach einem schwerwiegenden Fehler&quot;, MB_OK );

  exit( 1 );
}

void exit_error( char *message, char *title )
{
  screen_interface.close_window();

  ShowCursor( 1 );
  MessageBox( NULL, message, title, MB_OK );

  exit( 1 );
}

void exit_nofile( char *user, char *filename )
{
  char string[ 500 ];
  sprintf( string, &quot;%s: Fehler beim Öffnen der Datei '%s'.\n&quot;, user, filename );

  exit_error( string );
}

void exit_nomemory( char *user, char *array )
{
  char string[ 500 ];
  sprintf( string, &quot;%s: Fehler während der Reservierung von Arbeitsspeicher für das Array '%s'.\n&quot;, user, array );

  exit_error( string );
}

void message( char *title, char *message )
{
  MessageBox( NULL, message, title, MB_OK ); 
}

#endif
</code></pre>
<p>Fehlermeldungen :</p>
<blockquote>
<p>1&gt;------ Erstellen gestartet: Projekt: Projekt, Konfiguration: Debug Win32 ------<br />
1&gt; main.cpp<br />
1&gt;c:\users\robin\desktop\opengl\projekt\projekt\screen_interface.h(80): error C2440: '=': 'const char [12]' kann nicht in 'LPCWSTR' konvertiert werden<br />
1&gt; Die Typen, auf die verwiesen wird, sind nicht verknüpft; die Konvertierung erfordert einen reinterpret_cast-Operator oder eine Typumwandlung im C- oder Funktionsformat.<br />
1&gt;c:\users\robin\desktop\opengl\projekt\projekt\screen_interface.h(89): error C2664: 'CreateWindowExW': Konvertierung des Parameters 2 von 'const char [12]' in 'LPCWSTR' nicht möglich<br />
1&gt; Die Typen, auf die verwiesen wird, sind nicht verknüpft; die Konvertierung erfordert einen reinterpret_cast-Operator oder eine Typumwandlung im C- oder Funktionsformat.<br />
1&gt;c:\users\robin\desktop\opengl\projekt\projekt\screen_interface.h(129): error C2440: '=': 'const char [12]' kann nicht in 'LPCWSTR' konvertiert werden<br />
1&gt; Die Typen, auf die verwiesen wird, sind nicht verknüpft; die Konvertierung erfordert einen reinterpret_cast-Operator oder eine Typumwandlung im C- oder Funktionsformat.<br />
1&gt;c:\users\robin\desktop\opengl\projekt\projekt\screen_interface.h(141): error C2664: 'CreateWindowExW': Konvertierung des Parameters 2 von 'const char [12]' in 'LPCWSTR' nicht möglich<br />
1&gt; Die Typen, auf die verwiesen wird, sind nicht verknüpft; die Konvertierung erfordert einen reinterpret_cast-Operator oder eine Typumwandlung im C- oder Funktionsformat.<br />
1&gt;c:\users\robin\desktop\opengl\projekt\projekt\screen_interface.h(194): error C2664: 'MessageBoxW': Konvertierung des Parameters 2 von 'char *' in 'LPCWSTR' nicht möglich<br />
1&gt; Die Typen, auf die verwiesen wird, sind nicht verknüpft; die Konvertierung erfordert einen reinterpret_cast-Operator oder eine Typumwandlung im C- oder Funktionsformat.<br />
1&gt;c:\users\robin\desktop\opengl\projekt\projekt\screen_interface.h(204): error C2664: 'MessageBoxW': Konvertierung des Parameters 2 von 'char *' in 'LPCWSTR' nicht möglich<br />
1&gt; Die Typen, auf die verwiesen wird, sind nicht verknüpft; die Konvertierung erfordert einen reinterpret_cast-Operator oder eine Typumwandlung im C- oder Funktionsformat.<br />
1&gt;c:\users\robin\desktop\opengl\projekt\projekt\screen_interface.h(227): error C2664: 'MessageBoxW': Konvertierung des Parameters 2 von 'char *' in 'LPCWSTR' nicht möglich<br />
1&gt; Die Typen, auf die verwiesen wird, sind nicht verknüpft; die Konvertierung erfordert einen reinterpret_cast-Operator oder eine Typumwandlung im C- oder Funktionsformat.<br />
========== Erstellen: 0 erfolgreich, Fehler bei 1, 0 aktuell, 0 übersprungen ==========</p>
</blockquote>
]]></description><link>https://www.c-plusplus.net/forum/post/2386239</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2386239</guid><dc:creator><![CDATA[Wayn&#x27;s]]></dc:creator><pubDate>Mon, 03 Mar 2014 10:27:44 GMT</pubDate></item><item><title><![CDATA[Reply to OpenGL Code Problem on Mon, 03 Mar 2014 10:31:20 GMT]]></title><description><![CDATA[<p>Spiel in den Projektkonfigurationen mal mit der Unicode-/Multibyte Zeichendarstellung rum.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2386241</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2386241</guid><dc:creator><![CDATA[Skym0sh0]]></dc:creator><pubDate>Mon, 03 Mar 2014 10:31:20 GMT</pubDate></item><item><title><![CDATA[Reply to OpenGL Code Problem on Mon, 03 Mar 2014 10:35:03 GMT]]></title><description><![CDATA[<p>Es gibt 2 Arten von Strings, ASCII-Strings und Unicode-Strings. Dein Projekt ist auf Unicode gestellt, damit verlangen Funktionen wie MessageBox Unicode-Strings, du gibst ihnen aber ASCII-Strings und der Compiler meckert.</p>
<p>Lösung 1: Stelle in den Projekteinstellungen von Unicode auf ASCII um<br />
Lösung 2: Benutze Unicode-Strings. Beispiel: void message(wchar_t *title, wchar_t *message); winclass.lpszClassName = L&quot;Main Window&quot;;<br />
Lösung 3: Verlange explizit die ASCII-Variante: MessageBoxA statt MessageBox, WNDCLASSA statt WNDCLASS usw.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2386243</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2386243</guid><dc:creator><![CDATA[nwp3]]></dc:creator><pubDate>Mon, 03 Mar 2014 10:35:03 GMT</pubDate></item><item><title><![CDATA[Reply to OpenGL Code Problem on Mon, 03 Mar 2014 10:38:55 GMT]]></title><description><![CDATA[<p>nwp3 schrieb:</p>
<blockquote>
<p>Lösung 3: Verlange explizit die ASCII-Variante: MessageBoxA statt MessageBox, WNDCLASSA statt WNDCLASS usw.</p>
</blockquote>
<p><img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f44d.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--thumbs_up"
      title=":+1:"
      alt="👍"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2386244</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2386244</guid><dc:creator><![CDATA[dot]]></dc:creator><pubDate>Mon, 03 Mar 2014 10:38:55 GMT</pubDate></item><item><title><![CDATA[Reply to OpenGL Code Problem on Mon, 03 Mar 2014 10:41:07 GMT]]></title><description><![CDATA[<p>Das Problem was ich nun habe, ich kann nur von Unicode auf Multybyte bzw &quot;nicht angegeben&quot; umstellen. Jedoch kriege ich im Multybyte Satz deutlich weniger Fehler :</p>
<blockquote>
<p>1&gt;------ Erstellen gestartet: Projekt: Projekt, Konfiguration: Debug Win32 ------<br />
1&gt; main.cpp<br />
1&gt;c:\users\robin\desktop\opengl\projekt\projekt\screen_interface.h(212): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.<br />
1&gt; c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(371): Siehe Deklaration von 'sprintf'<br />
1&gt;c:\users\robin\desktop\opengl\projekt\projekt\screen_interface.h(220): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.<br />
1&gt; c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(371): Siehe Deklaration von 'sprintf'<br />
1&gt;LINK : fatal error LNK1104: Datei &quot;glew32.lib&quot; kann nicht geöffnet werden.<br />
========== Erstellen: 0 erfolgreich, Fehler bei 1, 0 aktuell, 0 übersprungen ==========</p>
</blockquote>
]]></description><link>https://www.c-plusplus.net/forum/post/2386245</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2386245</guid><dc:creator><![CDATA[Wayn&#x27;s]]></dc:creator><pubDate>Mon, 03 Mar 2014 10:41:07 GMT</pubDate></item><item><title><![CDATA[Reply to OpenGL Code Problem on Mon, 03 Mar 2014 10:44:06 GMT]]></title><description><![CDATA[<p>Das sind Warnings, keine Fehler...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2386246</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2386246</guid><dc:creator><![CDATA[dot]]></dc:creator><pubDate>Mon, 03 Mar 2014 10:44:06 GMT</pubDate></item><item><title><![CDATA[Reply to OpenGL Code Problem on Mon, 03 Mar 2014 10:45:26 GMT]]></title><description><![CDATA[<p>Leider doch :</p>
<blockquote>
<p>1&gt;LINK : fatal error LNK1104: Datei &quot;glew32.lib&quot; kann nicht geöffnet werden.</p>
</blockquote>
<p>Nur weiß ich nicht, warum der die Library jetzt net mehr öffnen kann.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2386247</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2386247</guid><dc:creator><![CDATA[Wayn&#x27;s]]></dc:creator><pubDate>Mon, 03 Mar 2014 10:45:26 GMT</pubDate></item><item><title><![CDATA[Reply to OpenGL Code Problem on Mon, 03 Mar 2014 10:48:50 GMT]]></title><description><![CDATA[<p>Konnte &quot;er&quot; vorher wohl auch nicht, nur bist du vorhin noch gar nicht so weit gekommen, dass &quot;er&quot; es überhaupt versucht hätte. Grund ist vermutlich, dass &quot;er&quot; sie nicht finden kann, oder dass es eine falsche Library ist (64 Bit vs. 32 Bit!?)...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2386249</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2386249</guid><dc:creator><![CDATA[dot]]></dc:creator><pubDate>Mon, 03 Mar 2014 10:48:50 GMT</pubDate></item><item><title><![CDATA[Reply to OpenGL Code Problem on Mon, 03 Mar 2014 10:49:52 GMT]]></title><description><![CDATA[<p>Habe jetzt mal statt der glew32.lib die Glee.lib eingetragen, aber er findet weder die eine, noch die andere <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":/"
      alt="😕"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2386250</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2386250</guid><dc:creator><![CDATA[Wayn&#x27;s]]></dc:creator><pubDate>Mon, 03 Mar 2014 10:49:52 GMT</pubDate></item><item><title><![CDATA[Reply to OpenGL Code Problem on Mon, 03 Mar 2014 10:54:53 GMT]]></title><description><![CDATA[<p>Dann hast du eben was falsch konfiguriert...</p>
<p>Wo liegen die libs? Hast du die entsprechenden Pfade richtig gesetzt? Sind es überhaupt für deinen Compiler passende libs?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2386253</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2386253</guid><dc:creator><![CDATA[dot]]></dc:creator><pubDate>Mon, 03 Mar 2014 10:54:53 GMT</pubDate></item></channel></rss>