Question about GDI graphics???????

Started by
33 comments, last by Auron 19 years, 6 months ago
could someone tell me the header file for GDI graphics for the free version of borland 5.5 c++?????????????
Advertisement
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)

Simon O'Connor | Technical Director (Newcastle) Lockwood Publishing | LinkedIn | Personal site

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.

#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.
As your leader, I encourage you from time to time, and always in a respectful manner, to question my logic. If you're unconvinced that a particular plan of action I've decided is the wisest, tell me so, but allow me to convince you and I promise you right here and now, no subject will ever be taboo. Except, of course, the subject that was just under discussion. The price you pay for bringing up either my Chinese or American heritage as a negative is - I collect your f***ing head.
It had an error. " Unresolved external '_main' referenced from C:\BORLAND\BCC55\LIB\C0X32.OBJ"
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.
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.
As your leader, I encourage you from time to time, and always in a respectful manner, to question my logic. If you're unconvinced that a particular plan of action I've decided is the wisest, tell me so, but allow me to convince you and I promise you right here and now, no subject will ever be taboo. Except, of course, the subject that was just under discussion. The price you pay for bringing up either my Chinese or American heritage as a negative is - I collect your f***ing head.
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.

Richard "Superpig" Fine - saving pigs from untimely fates - Microsoft DirectX MVP 2006/2007/2008/2009
"Shaders are not meant to do everything. Of course you can try to use it for everything, but it's like playing football using cabbage." - MickeyMouse

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