Форум программистов, компьютерный форум, киберфорум
C++ Builder
Войти
Регистрация
Восстановить пароль
Блоги Сообщество Поиск Заказать работу  
 
Рейтинг 4.50/6: Рейтинг темы: голосов - 6, средняя оценка - 4.50
0 / 0 / 0
Регистрация: 08.11.2015
Сообщений: 69

Урок №14 NeHe Не могу откомпилировать и проверить работоспособность

20.01.2019, 04:23. Показов 1172. Ответов 1
Метки нет (Все метки)

Студворк — интернет-сервис помощи студентам
Есть урок от NeHe. Написано, что должен компилироваться в билдере 6. Даже екзешку прилагают. Но я не могу это откомпилировать. Не поможете разобраться???

пишет... что-то вроде
[BCC32 Error] Unit1.cpp(480): E2034 Cannot convert 'char const[7]' to 'const wchar_t *'
Full parser context
Unit1.cpp(395): parsing: int CreateGLWindow(char *,int,int,int,bool)


Я сперва обрадовался, что так подробно тут все расписано... но... нефига... Может у кого-то получилось?


C++
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
//---------------------------------------------------------------------------
 
#include <vcl.h>
#include <windows.h>    // Header file for windows
#include <math.h>   // Header file for windows math library     ( ADD )
#include <stdio.h>  // Header file for standard Input/Output    ( ADD )
#include <stdarg.h> // Header file for variable argument routines   ( ADD )
#include <gl\gl.h>      // Header file for the OpenGL32 library
#include <gl\glu.h>     // Header file for the GLu32 library
#include <gl\glaux.h>   // Header file for the GLaux library
#pragma hdrstop
 
//---------------------------------------------------------------------------
#pragma argsused
 
HGLRC hRC = NULL;               // Permanent rendering context
HDC hDC = NULL;                 // Private GDI device context
HWND hWnd = NULL;               // Holds our window handle
HINSTANCE hInstance = NULL;     // Holds the instance of the application
 
bool keys[256];                 // Array used for the keyboard routine
bool active = true;             // Window active flag set to TRUE by default
bool fullscreen = true;         // Fullscreen flag set to fullscreen mode by default
 
GLuint  base;           // Base display list for the font set   ( ADD )
GLfloat rot;            // Used to rotate the text      ( ADD )
 
GLYPHMETRICSFLOAT gmf[256]; // Storage for information about our font
 
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);   // Declaration for WndProc
 
GLvoid BuildFont(GLvoid)    // Build our bitmap font
{
    HFONT font;     // Windows font ID
 
    base = glGenLists(256); // Storage for 256 characters
 
    font = CreateFont(  -12,                                    // Height of font
                        0,              // Width of font
                        0,              // Angle of escapement
                        0,              // Orientation angle
                        FW_BOLD,            // Font weight
                        FALSE,              // Italic
                        FALSE,              // Underline
                        FALSE,              // Strikeout
                        ANSI_CHARSET,           // Character set identifier
                        OUT_TT_PRECIS,          // Output precision
                        CLIP_DEFAULT_PRECIS,        // Clipping precision
                        ANTIALIASED_QUALITY,        // Output quality
                        FF_DONTCARE|DEFAULT_PITCH,  // Family and pitch
                        "Comic Sans MS");       // Font name
 
    SelectObject(hDC, font);                        // Selects the font we created
 
    wglUseFontOutlines( hDC,                        // Select the current DC
                        0,              // Starting character
                        255,                // Number of display lists to build
                        base,               // Starting display lists
                        0.0f,               // Deviation from the true outlines
                        0.2f,               // Font thickness in the Z direction
                        WGL_FONT_POLYGONS,      // Use polygons, not lines
                        gmf);               // Address of buffer to recieve data
}
 
GLvoid KillFont(GLvoid)         // Delete the font
{
        glDeleteLists(base, 256);   // Delete all 256 characters
}
 
GLvoid glPrint(const char *fmt, ...)    // Custom GL "Print" routine
{
    float length = 0;       // Used to find the length of the text
    char text[256];         // Holds our string
    va_list ap;         // Pointer to list of arguments
 
    if (fmt == NULL)        // If there's no text
        return;         // Do nothing
 
    va_start(ap, fmt);      // Parses the string for variables
        vsprintf(text, fmt, ap);    // And converts symbols to actual numbers
    va_end(ap);         // Results are stored in text
 
    for (unsigned int loop=0;loop<(strlen(text));loop++)    // Loop to find text length
    {
        length+=gmf[text[loop]].gmfCellIncX;        // Increase length by each characters width
    }
 
    glTranslatef(-length/2,0.0f,0.0f);          // Center our text on the screen
 
    glPushAttrib(GL_LIST_BIT);              // Pushes the display list bits
    glListBase(base);                   // Sets the base character to 0
    glCallLists(strlen(text), GL_UNSIGNED_BYTE, text);  // Draws the display list text
    glPopAttrib();                      // Pops the display list bits
}
 
GLvoid ReSizeGLScene(GLsizei width, GLsizei height)     // Resize and initialize the GL window
{
        if (height == 0)                        // Prevent A Divide By Zero By
        {
                height = 1;                     // Making height equal One
        }
 
        glViewport(0, 0, width, height);        // Reset the current viewport
 
        glMatrixMode(GL_PROJECTION);            // Select the projection matrix
    glLoadIdentity();                       // Reset the projection matrix
 
    // Calculate the aspect ratio of the window
    gluPerspective(45.0f,(GLfloat)width/(GLfloat)height,0.1f,100.0f);
 
    glMatrixMode(GL_MODELVIEW);             // Select the modelview matrix
    glLoadIdentity();                       // Reset the modelview matrix
}
 
int InitGL(GLvoid)      // All setup for OpenGL goes here
{
    glShadeModel(GL_SMOOTH);                // Enable smooth shading
    glClearColor(0.0f, 0.0f, 0.0f, 0.5f);   // Black background
    glClearDepth(1.0f);                     // Depth buffer setup
    glEnable(GL_DEPTH_TEST);                // Enables depth testing
    glDepthFunc(GL_LEQUAL);                 // The type of depth testing to do
    glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);      // Really nice perspective calculations
        glEnable(GL_LIGHT0);            // Enable default light (quick and dirty)   ( NEW )
    glEnable(GL_LIGHTING);          // Enable lighting              ( NEW )
    glEnable(GL_COLOR_MATERIAL);        // Enable coloring of material          ( NEW )
 
    BuildFont();                // Build the font               ( ADD )
 
    return true;                            // Initialization went OK
}
 
int DrawGLScene(GLvoid)         // Here's where we do all the drawing
{
    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // clear screen and depth buffer
    glLoadIdentity();       // Reset the current modelview matrix
 
        glTranslatef(0.0f,0.0f,-10.0f); // Move ten units into the screen
 
        glRotatef(rot,1.0f,0.0f,0.0f);      // Rotate on the X axis
    glRotatef(rot*1.5f,0.0f,1.0f,0.0f); // Rotate on the Y axis
    glRotatef(rot*1.4f,0.0f,0.0f,1.0f); // Rotate on the Z axis
 
        // Pulsing colors based on the rotation
    glColor3f(1.0f*float(cos(rot/20.0f)),1.0f*float(sin(rot/25.0f)),1.0f-0.5f*float(cos(rot/17.0f)));
 
        glPrint("NeHe - %3.2f",rot/50);         // Print GL text to the screen
 
        rot+=0.5f;              // Increase the rotation variable
 
    return true;            // Everything went OK
}
 
GLvoid KillGLWindow(GLvoid)     // Properly kill the window
{
    if (fullscreen)         // Are we in fullscreen mode?
    {
        ChangeDisplaySettings(NULL,0);  // If so switch back to the desktop
        ShowCursor(true);               // Show mouse pointer
    }
 
    if (hRC)        // Do we have a rendering context?
    {
        if (!wglMakeCurrent(NULL,NULL))         // Are we able to release the DC and RC contexts?
        {
            MessageBox(NULL,"Release of DC and RC failed.","SHUTDOWN ERROR",MB_OK | MB_ICONINFORMATION);
        }
 
        if (!wglDeleteContext(hRC))             // Are we able to delete the RC?
        {
            MessageBox(NULL,"Release rendering context failed.","SHUTDOWN ERROR",MB_OK | MB_ICONINFORMATION);
        }
        hRC = NULL;             // Set RC to NULL
    }
 
    if (hDC && !ReleaseDC(hWnd,hDC))        // Are we able to release the DC
    {
        MessageBox(NULL,"Release device context failed.","SHUTDOWN ERROR",MB_OK | MB_ICONINFORMATION);
        hDC = NULL;             // Set DC to NULL
    }
 
    if (hWnd && !DestroyWindow(hWnd))       // Are we able to destroy the window?
    {
        MessageBox(NULL,"Could not release hWnd.","SHUTDOWN ERROR",MB_OK | MB_ICONINFORMATION);
        hWnd = NULL;            // Set hWnd to NULL
    }
 
    if (!UnregisterClass("OpenGL",hInstance))       // Are we able to unregister class
    {
        MessageBox(NULL,"Could not unregister class.","SHUTDOWN ERROR",MB_OK | MB_ICONINFORMATION);
        hInstance = NULL;       // Set hInstance to NULL
    }
 
        KillFont();     // Destroy the font
}
 
/*  This Code Creates Our OpenGL Window.  Parameters Are:
 *  title           - Title To Appear At The Top Of The Window
 *  width           - Width Of The GL Window Or Fullscreen Mode
 *  height          - Height Of The GL Window Or Fullscreen Mode
 *  bits            - Number Of Bits To Use For Color (8/16/24/32)
 *  fullscreenflag  - Use Fullscreen Mode (TRUE) Or Windowed Mode (FALSE)*/
 
BOOL CreateGLWindow(char* title, int width, int height, int bits, bool fullscreenflag)
{
    GLuint      PixelFormat;        // Holds the results after searching for a match
    WNDCLASS    wc;             // Windows class structure
    DWORD       dwExStyle;              // Window extended style
    DWORD       dwStyle;                // Window style
    RECT        WindowRect;             // Grabs rctangle upper left / lower right values
    WindowRect.left = (long)0;              // Set left value to 0
    WindowRect.right = (long)width;     // Set right value to requested width
    WindowRect.top = (long)0;               // Set top value to 0
    WindowRect.bottom = (long)height;       // Set bottom value to requested height
 
    fullscreen = fullscreenflag;              // Set the global fullscreen flag
 
    hInstance               = GetModuleHandle(NULL);        // Grab an instance for our window
    wc.style                = CS_HREDRAW | CS_VREDRAW | CS_OWNDC;   // Redraw on size, and own DC for window
    wc.lpfnWndProc          = (WNDPROC) WndProc;            // WndProc handles messages
    wc.cbClsExtra           = 0;                    // No extra window data
    wc.cbWndExtra           = 0;                    // No extra window data
    wc.hInstance            = hInstance;                // Set the Instance
    wc.hIcon                = LoadIcon(NULL, IDI_WINLOGO);      // Load the default icon
    wc.hCursor              = LoadCursor(NULL, IDC_ARROW);      // Load the arrow pointer
    wc.hbrBackground        = NULL;                 // No background required for GL
    wc.lpszMenuName     = NULL;                 // We don't want a menu
    wc.lpszClassName    = "OpenGL";             // Set the class name
 
    if (!RegisterClass(&wc))                    // Attempt to register the window class
    {
        MessageBox(NULL,"Failed To Register The Window Class.","ERROR",MB_OK|MB_ICONEXCLAMATION);
 
        return false;   // Return FALSE
    }
    
    if (fullscreen)         // Attempt fullscreen mode?
    {
        DEVMODE dmScreenSettings;                                       // Device mode
        memset(&dmScreenSettings,0,sizeof(dmScreenSettings));           // Makes sure memory's cleared
        dmScreenSettings.dmSize         = sizeof(dmScreenSettings);     // Size of the devmode structure
        dmScreenSettings.dmPelsWidth    = width;                        // Selected screen width
        dmScreenSettings.dmPelsHeight   = height;                       // Selected screen height
        dmScreenSettings.dmBitsPerPel   = bits;                         // Selected bits per pixel
        dmScreenSettings.dmFields=DM_BITSPERPEL|DM_PELSWIDTH|DM_PELSHEIGHT;
 
        // Try to set selected mode and get results. NOTE: CDS_FULLSCREEN gets rid of start bar.
        if (ChangeDisplaySettings(&dmScreenSettings,CDS_FULLSCREEN)!=DISP_CHANGE_SUCCESSFUL)
        {
            // If the mode fails, offer two options. Quit or use windowed mode.
            if (MessageBox(NULL,"The requested fullscreen mode is not supported by\nyour video card. Use windowed mode instead?","NeHe GL",MB_YESNO|MB_ICONEXCLAMATION)==IDYES)
            {
                fullscreen = false;       // Windowed mode selected. Fullscreen = FALSE
            }
            else
            {
                // Pop up a message box letting user know the program is closing.
                MessageBox(NULL,"Program will now close.","ERROR",MB_OK|MB_ICONSTOP);
                return false;           // Return FALSE
            }
        }
    }
 
    if (fullscreen)                         // Are We Still In Fullscreen Mode?
    {
        dwExStyle = WS_EX_APPWINDOW;    // Window extended style
        dwStyle = WS_POPUP;     // Windows style
        ShowCursor(false);      // Hide mouse pointer
    }
    else
    {
        dwExStyle=WS_EX_APPWINDOW | WS_EX_WINDOWEDGE;           // Window extended style
        dwStyle=WS_OVERLAPPEDWINDOW;                            // Windows style
    }
 
    AdjustWindowRectEx(&WindowRect, dwStyle, FALSE, dwExStyle);     // Adjust window to true requested size
 
    // Create the window
    if (!(hWnd = CreateWindowEx(dwExStyle,          // Extended Style For The Window
                "OpenGL",               // Class name
        title,                  // Window title
        dwStyle |               // Defined window style
        WS_CLIPSIBLINGS |           // Required window style
        WS_CLIPCHILDREN,            // Required window style
        0, 0,                   // Window position
        WindowRect.right-WindowRect.left,   // Calculate window width
        WindowRect.bottom-WindowRect.top,   // Calculate window height
        NULL,                   // No parent window
        NULL,                   // No menu
        hInstance,              // Instance
        NULL)))                 // Dont pass anything to WM_CREATE
    {
        KillGLWindow();                         // Reset the display
        MessageBox(NULL,"Window Creation Error.","ERROR",MB_OK|MB_ICONEXCLAMATION);
        return false;                           // Return FALSE
    }
 
    static  PIXELFORMATDESCRIPTOR pfd =             // pfd tells windows how we want things to be
    {
        sizeof(PIXELFORMATDESCRIPTOR),          // Size of this pixel format descriptor
        1,                  // Version number
        PFD_DRAW_TO_WINDOW |            // Format must support window
        PFD_SUPPORT_OPENGL |            // Format must support OpenGL
        PFD_DOUBLEBUFFER,           // Must support double buffering
        PFD_TYPE_RGBA,              // Request an RGBA format
        bits,                   // Select our color depth
        0, 0, 0, 0, 0, 0,           // Color bits ignored
        0,                  // No alpha buffer
        0,                  // Shift bit ignored
        0,                  // No accumulation buffer
        0, 0, 0, 0,             // Accumulation bits ignored
        16,                 // 16Bit Z-Buffer (Depth buffer)
        0,                  // No stencil buffer
        0,                  // No auxiliary buffer
        PFD_MAIN_PLANE,             // Main drawing layer
        0,                  // Reserved
        0, 0, 0                 // Layer masks ignored
    };
    
    if (!(hDC=GetDC(hWnd)))         // Did we get a device context?
    {
        KillGLWindow();         // Reset the display
        MessageBox(NULL,"Can't create a GL device context.","ERROR",MB_OK|MB_ICONEXCLAMATION);
        return false;           // Return FALSE
    }
 
    if (!(PixelFormat=ChoosePixelFormat(hDC,&pfd))) // Did windows find a matching pixel format?
    {
        KillGLWindow();         // Reset the display
        MessageBox(NULL,"Can't find a suitable pixelformat.","ERROR",MB_OK|MB_ICONEXCLAMATION);
        return false;           // Return FALSE
    }
 
    if(!SetPixelFormat(hDC,PixelFormat,&pfd))       // Are we able to set the pixel format?
    {
        KillGLWindow();         // Reset the display
        MessageBox(NULL,"Can't set the pixelformat.","ERROR",MB_OK|MB_ICONEXCLAMATION);
        return false;           // Return FALSE
    }
 
    if (!(hRC=wglCreateContext(hDC)))               // Are we able to get a rendering context?
    {
        KillGLWindow();         // Reset the display
        MessageBox(NULL,"Can't create a GL rendering context.","ERROR",MB_OK|MB_ICONEXCLAMATION);
        return false;           // Return FALSE
    }
 
    if(!wglMakeCurrent(hDC,hRC))    // Try to activate the rendering context
    {
        KillGLWindow();         // Reset the display
        MessageBox(NULL,"Can't activate the GL rendering context.","ERROR",MB_OK|MB_ICONEXCLAMATION);
        return false;           // Return FALSE
    }
 
    ShowWindow(hWnd,SW_SHOW);       // Show the window
    SetForegroundWindow(hWnd);      // Slightly higher priority
    SetFocus(hWnd);                 // Sets keyboard focus to the window
    ReSizeGLScene(width, height);   // Set up our perspective GL screen
 
    if (!InitGL())                  // Initialize our newly created GL window
    {
        KillGLWindow();         // Reset the display
        MessageBox(NULL,"Initialization failed.","ERROR",MB_OK|MB_ICONEXCLAMATION);
        return false;           // Return FALSE
    }
 
    return true;                    // Success
}
 
LRESULT CALLBACK WndProc(HWND hWnd,     // Handle for this window
                        UINT uMsg,      // Message for this window
            WPARAM wParam,  // Additional message information
            LPARAM lParam)  // Additional message information
{
    switch (uMsg)                           // Check for windows messages
    {
        case WM_ACTIVATE:               // Watch for window activate message
        {
            if (!HIWORD(wParam))    // Check minimization state
            {
                active = true;  // Program is active
            }
            else
            {
                active = false; // Program is no longer active
            }
 
            return 0;               // Return to the message loop
        }
 
        case WM_SYSCOMMAND:             // Intercept system commands
        {
            switch (wParam)         // Check system calls
            {
                case SC_SCREENSAVE:     // Screensaver trying to start?
                case SC_MONITORPOWER:   // Monitor trying to enter powersave?
                return 0;       // Prevent from happening
            }
            break;                  // Exit
        }
 
        case WM_CLOSE:                  // Did we receive a close message?
        {
            PostQuitMessage(0);     // Send a quit message
            return 0;               // Jump back
        }
 
        case WM_KEYDOWN:                // Is a key being held down?
        {
            keys[wParam] = true;    // If so, mark it as TRUE
            return 0;               // Jump back
        }
 
        case WM_KEYUP:                  // Has a key been released?
        {
            keys[wParam] = false;   // If so, mark it as FALSE
            return 0;               // Jump back
        }
 
        case WM_SIZE:                   // Resize the OpenGL window
        {
            ReSizeGLScene(LOWORD(lParam),HIWORD(lParam));  // LoWord = Width, HiWord = Height
            return 0;               // Jump back
        }
    }
 
    // Pass all unhandled messages to DefWindowProc
    return DefWindowProc(hWnd,uMsg,wParam,lParam);
}
 
WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
        MSG msg;                // Windows message structure
    bool done = false;      // Bool variable to exit loop
 
    // Ask the user which screen mode they prefer
    if (MessageBox(NULL,"Would you like to run in fullscreen mode?", "Start FullScreen?",MB_YESNO|MB_ICONQUESTION)==IDNO)
    {
        fullscreen = false;       // Windowed mode
    }
 
    // Create our OpenGL window
    if (!CreateGLWindow("NeHe's Outline Font Tutorial",640,480,16,fullscreen))
    {
        return 0;               // Quit if window was not created
    }
 
    while(!done)            // Loop that runs while done = FALSE
    {
        if (PeekMessage(&msg,NULL,0,0,PM_REMOVE))   // Is there a message waiting?
        {
            if (msg.message == WM_QUIT)             // Have we received a quit message?
            {
                done = true;                    // If so done = TRUE
            }
            else                                    // If not, deal with window messages
            {
                TranslateMessage(&msg);         // Translate the message
                DispatchMessage(&msg);          // Dispatch the message
            }
        }
        else            // If there are no messages
        {
            // Draw the scene.  Watch for ESC key and quit messages from DrawGLScene()
            if (active)                             // Program active?
            {
                if (keys[VK_ESCAPE])            // Was ESC pressed?
                {
                    done = true;            // ESC signalled a quit
                }
                else                            // Not time to quit, Update screen
                {
                    DrawGLScene();          // Draw the scene
                    SwapBuffers(hDC);       // Swap buffers (Double buffering)
                }
            }
 
            if (keys[VK_F1])                        // Is F1 being pressed?
            {
                keys[VK_F1] = false;            // If so make key FALSE
                KillGLWindow();                 // Kill our current window
                fullscreen =! fullscreen;       // Toggle fullscreen / windowed mode
                // Recreate our OpenGL window
                if (!CreateGLWindow("NeHe's Outline Font Tutorial",640,480,16,fullscreen))
                {
                    return 0;               // Quit if window was not created
                }
            }
        }
    }
 
    // Shutdown
    KillGLWindow();         // Kill the window
    return (msg.wParam);    // Exit the program
}
//---------------------------------------------------------------------------
0
IT_Exp
Эксперт
34794 / 4073 / 2104
Регистрация: 17.06.2006
Сообщений: 32,602
Блог
20.01.2019, 04:23
Ответы с готовыми решениями:

C++ и OpenGl урок NeHe
Сделал по уроку Nehe 6 Куб прогружается но он белый а должна накладываться текстура вот код где загружаю текстуру GLvoid...

Работает ли 10 урок nehe?
Вопрос написан в заголовке. В уроке написано что он не работает, правда ли это или нет? Ссылка на урок

Не могу проверить на работоспособность
Ув.форумчане нужна помощь срочно, на второй кнопке я попытался найти максимального числа из массива с шагом 7 , но что я не могу вывести...

1
Супер-модератор
Эксперт Pascal/DelphiАвтор FAQ
 Аватар для volvo
33379 / 21503 / 8236
Регистрация: 22.10.2011
Сообщений: 36,899
Записей в блоге: 12
20.01.2019, 16:08
У тебя Юникодный Билдер - он подразумевает WNDCLASSW, а не WNDCLASSA, как тот компилятор, для которого эти уроки были написаны. Так что либо в настройках проекта выставлять "TCHAR maps to" в char, вместо wchar_t, либо использовать везде L"строка" вместо просто "строка":
C++
1
wc.lpszClassName    = L"OpenGL";
дальше еще возможны подобные ошибки, исправлять по аналогии.
0
Надоела реклама? Зарегистрируйтесь и она исчезнет полностью.
BasicMan
Эксперт
29316 / 5623 / 2384
Регистрация: 17.02.2009
Сообщений: 30,364
Блог
20.01.2019, 16:08
Помогаю со студенческими работами здесь

Модуль(Откомпилировать и проверить)
Написал только что модуль для вычисления площадивсех плоских фигур Обьясняю принцып модуля: берем например трапецию, функция...

Проверить программу на работоспособность
#include &lt;stdafx.h&gt; #include &lt;iostream&gt; #include &lt;cstdlib&gt; #include &lt;fstream&gt; #include &lt;ctime&gt; using namespace std; int...

Как проверить работоспособность?
Как проверить работоспособность ехе для различных windows? Например для html можно проверить правильность отображения для различных...

TV-Out : как проверить на работоспособность?
Как-то неожиданно пропал видеосигнал по S-Video на телевизор(синий экран - нет видеосигнала). Кто подскажет - как проверить TV-Out на...

Как проверить работоспособность БД?
Вот примеру у меня есть готовый проект который подразумевает большой онлайн , как можно виртуально сделать нагрузку чтобы посмотреть как...


Искать еще темы с ответами

Или воспользуйтесь поиском по форуму:
2
Ответ Создать тему
Новые блоги и статьи
Символьное дифференцирование
igorrr37 13.02.2026
/ * Логарифм записывается как: (x-2)log(x^2+2) - означает логарифм (x^2+2) по основанию (x-2). Унарный минус обозначается как ! */ #include <iostream> #include <stack> #include <cctype>. . .
Камера Toupcam IUA500KMA
Eddy_Em 12.02.2026
Т. к. у всяких "хикроботов" слишком уж мелкий пиксель, для подсмотра в ESPriF они вообще плохо годятся: уже 14 величину можно рассмотреть еле-еле лишь на экспозициях под 3 секунды (а то и больше),. . .
И ясному Солнцу
zbw 12.02.2026
И ясному Солнцу, и светлой Луне. В мире покоя нет и люди не могут жить в тишине. А жить им немного лет.
«Знание-Сила»
zbw 12.02.2026
«Знание-Сила» «Время-Деньги» «Деньги -Пуля»
SDL3 для Web (WebAssembly): Подключение Box2D v3, физика и отрисовка коллайдеров
8Observer8 12.02.2026
Содержание блога Box2D - это библиотека для 2D физики для анимаций и игр. С её помощью можно определять были ли коллизии между конкретными объектами и вызывать обработчики событий столкновения. . . .
SDL3 для Web (WebAssembly): Загрузка PNG с прозрачным фоном с помощью SDL_LoadPNG (без SDL3_image)
8Observer8 11.02.2026
Содержание блога Библиотека SDL3 содержит встроенные инструменты для базовой работы с изображениями - без использования библиотеки SDL3_image. Пошагово создадим проект для загрузки изображения. . .
SDL3 для Web (WebAssembly): Загрузка PNG с прозрачным фоном с помощью SDL3_image
8Observer8 10.02.2026
Содержание блога Библиотека SDL3_image содержит инструменты для расширенной работы с изображениями. Пошагово создадим проект для загрузки изображения формата PNG с альфа-каналом (с прозрачным. . .
Установка Qt-версии Lazarus IDE в Debian Trixie Xfce
volvo 10.02.2026
В общем, достали меня глюки IDE Лазаруса, собранной с использованием набора виджетов Gtk2 (конкретно: если набирать текст в редакторе и вызвать подсказку через Ctrl+Space, то после закрытия окошка. . .
КиберФорум - форум программистов, компьютерный форум, программирование
Powered by vBulletin
Copyright ©2000 - 2026, CyberForum.ru