The C project is not working properly

17 views
Skip to first unread message

Alex Tuchin

unread,
Mar 24, 2025, 8:36:19 AMMar 24
to dislin-users
Hello! 
Program:
#include "dislin.h"
int main ()
{
  swgopt("russian", "coding");
  chacod("utf8");
  winfnt("Times New Roman");
  int screen_width, screen_height;
  getscr (&screen_width, &screen_height);
  swgwin (0, 0, screen_width, screen_height);
  swgtit ("Изучение Dislin study");
  int id_main = wgini ("form");
  int id_basbtn = wgbas(id_main, "form");
  swgwin(30, 30, 350, 50);
  wgpbut(id_basbtn, "Старт Start");
  wgfin ();
  return 0;
}
compiled into Code blocks:
gcc.exe -Wall -std=c17 -g  -c O:\MyProgramming\cDislin\cDislin.c -o obj\Debug\cDislin.o
gcc.exe -LO:\msys64\mingw64\lib -o bin\Debug\cDislin.exe obj\Debug\cDislin.o  O:\MyProgramming\cDislin\dismg64.a -luser32 -lgdi32 -lopengl32  
Only the terminal window appears at startup, but the form does not appear. Please help me fix the project (https://disk.yandex.ru/d/t18KU3f1nwAmlA)

Helmut Michels

unread,
Mar 25, 2025, 10:18:27 AMMar 25
to dislin-users
Hi,

the reasen is the routine winfnt. It must be called in level 1 between disini and disfin. winfnt is not
a widget routine. Normally, winfnt should be ignored if it is not called in level 1, but it seems to be executed
and to crash the program. I have noted this as a bug.
 
With best regards,

Helmut
Message has been deleted

Alex Tuchin

unread,
Mar 25, 2025, 10:49:51 AMMar 25
to dislin-users
Hi, Helmut!

Thanks for the reply.
The same code in the application in the C++ application shows a form with warnings:
 <<<< Warning 3: Incorrect level in chacod!   ( 0)
 <<<< Warning 3: Incorrect level in winfnt!   ( 0)
Why is this happening?

Alex

вторник, 25 марта 2025 г. в 17:18:27 UTC+3, mic...@dislin.de:
Reply all
Reply to author
Forward
0 new messages