i am using dev c++ ,so while i am working on graphics it gets diplayed in different window that is bgi window while input and output functions in normal output window what i want is both of them in one window . how do i do this ?
graphics is displayed in different window bgi in dev c++
Collapse
X
-
You can't. By normal input output I assume you mean using stdin and stdout via scanf and printf (or similar functions).
stdin, stdout and stderr have to be read/written to a console window. Most programs with a GUI have no console and therefore can not display stdout or take stdin input.
Dev-C++, like most IDEs, takes extra steps to capture stdin/stdout/stderr and write them out to a Window in the IDE to provide extra information. -
thank u banfa ...but then how do i do this? i am working on a quiz game project where input is required as well as graphics background and sound on the same screen ..how will i do this ...if it isnt possible in dev c++, i have tried turbo c++ also but sound function couldnt be added as error occured saying windows.h could not be opened. otherwise graphis and input operations are taking place in one window only .in turbo c++..please help me regarding this ..if i need to download it kindly tell me from where and which software will i need for carrying out th
is c++ projectComment
-
You are using a GUI, that is Graphical User Interface.
Use the facilities provided by the GUI. It has methods to output data, TextOut etc and it has methods to input data such as Text Boxes or just intercepting the WM_CHAR messages that are produced when keys are pressed.
Forget about printf, scanf, cin and cout and read the documentation on the system you are using.Comment
-
As I understood, you are using dev-c++ bgi, that is some sort of Borland BGI API emulation under Windows, that provides you with some fixed size window that you draw on using BGI functions. In this case, you have either to program some 'control' using bgi functions that will allow you to enter one or more lines of text, or dive into sources of this BGI-WIN32 library and use win32 functions to make window of desired class with calls like CreateWindow( "edit", "",
WS_VISIBLE|WS_C HILD|WS_BORDER| WS_VSCROLL|WS_H SCROLL|
ES_MULTILINE|ES _WANTRETURN|ES_ AUTOHSCROLL|ES_ AUTOVSCROLL,
0, 0, nClientWidth, nClientHeight, hwnd, (HMENU)nEditID, hInstance, NULL);Comment
-
i just wanted to combine all i/o operations ,graphics ,sound in one window only.i dont want to create a special window for it . c using turbo c++ i made it all in one window but play sound() wasnt availaible...wh en i tried it in dev c++ all i /o functions + sound was being performed in one window but graphics in other ..what i want is all in one window ..pls tell me how do i do this ?Comment
-
Input functions? Getch, kbhit or what else dev-c++ has similar to those of Borland C. Then you read keyboard code, detect printables/controls, and draw 'current input string' according to it until user presses 'Enter'. And yes, draw cursor too. No, you don't need to make it blink.
Ps - sound is not 'performed' in some particular window.Comment
-
What if there are no such functions that can replace (in his context) scanf() 1:1 without additional work? You have to make them yourself (see post #11). It's unlikely that even if someone have implemented such replacement, he will be able to share it with you.Comment
-
i am using dev c++ , i want to clear my graphics screen how do i do this ? i have tried system("cls") but it didnt work and even tried adding conio.h plus linking it but i got these errors
2 C:\Dev-Cpp\choc 1.cpp conio.h: No such file or directory. what should i do please help me linking to its libraryComment
Comment