Question about GDI graphics???????
could someone tell me the header file for GDI graphics for the free version of borland 5.5 c++?????????????
The compiler you're using shouldn't matter.
The majority of GDI functions are included from "Wingdi.h", that header itself is included from "Windows.h" which you'll need for basic things such as opening a window.
If you have neither then you need to obtain the Windows Platform SDK which contains all those headers and other stuff (I'm sure Borland C++ ships with a version of the PSDK though - so it might be a setup issue)
The majority of GDI functions are included from "Wingdi.h", that header itself is included from "Windows.h" which you'll need for basic things such as opening a window.
If you have neither then you need to obtain the Windows Platform SDK which contains all those headers and other stuff (I'm sure Borland C++ ships with a version of the PSDK though - so it might be a setup issue)
OK thanks, and umm could someone post a compilable example of some code just to draw a line??? please!!!!!!!!!!!!!
here's a simple line drawing example. you will start at 0, 0 (uppser left corner) by default and draw a line to 100, 100.
hope that helps.
#include <windows.h>LRESULT CALLBACK LineProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam){ PAINTSTRUCT ps; HDC hdc; switch(Msg) { case WM_CLOSE: PostQuitMessage(0); break; case WM_PAINT: hdc = BeginPaint(hWnd, &ps); LineTo(hdc, 100, 100); EndPaint(hWnd, &ps); break; } return DefWindowProc(hWnd, Msg, wParam, lParam);}int WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int){ MSG msg; WNDCLASS wc = {0}; wc.hbrBackground = (HBRUSH)(COLOR_WINDOW); wc.hCursor = LoadCursor(NULL, IDC_ARROW); wc.lpfnWndProc = LineProc; wc.lpszClassName = "Simple Line"; RegisterClass(&wc); CreateWindow(wc.lpszClassName, "A simple line", WS_OVERLAPPEDWINDOW|WS_VISIBLE, 0, 0, 640, 480, NULL, NULL, NULL, NULL); while(GetMessage(&msg, NULL, 0, 0)) { TranslateMessage(&msg); DispatchMessage(&msg); } return 0;}
hope that helps.
It had an error. " Unresolved external '_main' referenced from C:\BORLAND\BCC55\LIB\C0X32.OBJ"
what the crap does that mean?
what the crap does that mean?
It means you're not compling it correctly.
Google for some tutorials on writing win32 applications with borland. They should mention how to set up the project so that you don't get that error.
Google for some tutorials on writing win32 applications with borland. They should mention how to set up the project so that you don't get that error.
yeah, i think you need to set your target to Win32. they don't need main() to run. if using the commandline compiler, it's a flag you set. i forget which one, (maybe -w ???), look at Borlands site. they have some information about it.
EDIT: dammit. gotta be quicker.
EDIT: dammit. gotta be quicker.
Ive already set it up, i did it step by step on some site, and ive already compiled like hundreds of programs, but none of then have graphics!!!!!
Firstly, calm down. A single exclamation mark or question mark is enough, you do not need seven.
Secondly, this has become a compiler/buildconfig issue, and does not belong in GP&T. Moving to For Beginners.
Secondly, this has become a compiler/buildconfig issue, and does not belong in GP&T. Moving to For Beginners.
oh and im using the FREE BORLAND 5.5 COMPILER AND ITS A COMAND LINE COMPILER!!!!!!!!!!!!! and i saw a little thing on it about that there a graphics window and a text window, and there like a command like closegraph or something? because it said that this free compiler can only use gdi graphics. so im looking for somone to tell me BUT SO FAR NO ONE IS!!! ive been looking for tutorials for like a month but i havent found any that my compiler can compile!!!!!!! SOMEONE please help!!!!!!!!!!
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement