компилятор Borland C++ Builder 6 выдает вот такую ошибку:
| Цитата | | [Linker Error] Unresolved external 'DirectDrawCreate' referenced from C:\ARCHIVOS DE PROGRAMA\BORLAND\CBUILDER6\MY_PROJ\PROG.OBJ |
вот сам код:
| Код | #define WIN32_LEAN_AND_MEAN
#include <windows.h> #include <windowsx.h> #include <ddraw.h>
HINSTANCE hMainInstance; HWND hMainWindow; HRESULT ddrval; LPDIRECTDRAW lpdd;
LRESULT CALLBACK WindowProc(HWND, UINT, WPARAM, LPARAM);
int APIENTRY WinMain(HINSTANCE hinstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { WNDCLASSEX winclass; // our window class HWND hwnd; // handle to a window MSG msg; // a message variable // fill out the winclass structure winclass.cbSize = sizeof(WNDCLASSEX); winclass.style = CS_DBLCLKS | CS_OWNDC | CS_HREDRAW | CS_VREDRAW; winclass.lpfnWndProc = WindowProc; winclass.cbClsExtra = 0; // extra class info winclass.cbWndExtra = 0; // extra window info winclass.hInstance = hinstance; winclass.hIcon = LoadIcon(NULL, IDI_WINLOGO); winclass.hCursor = LoadCursor(NULL, IDC_ARROW); winclass.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH); winclass.lpszMenuName = NULL; winclass.lpszClassName = "TME Class"; winclass.hIconSm = LoadIcon(NULL, IDI_WINLOGO); // register class if (!RegisterClassEx(&winclass)) return(0); // create a window if (!(hwnd = CreateWindowEx(NULL, // extended style "TME Class", // class identifier "Terran Map Editor", // window title WS_POPUP | WS_VISIBLE, // you can't resize me! hahaha! 0, 0, // initial position 640, 480, // initial size NULL, // handle to parent NULL, hinstance, // app handle NULL))) // extra parameters return(0);
// set globals hMainWindow = hwnd; hMainInstance = hinstance;
ddrval = DirectDrawCreate(NULL, &lpdd, NULL);
while (TRUE) { // check the message queue if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) { if (msg.message == WM_QUIT) // exit loop on quit break; TranslateMessage(&msg); DispatchMessage(&msg); } } return(0); }
LRESULT CALLBACK WindowProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) { return(DefWindowProc(hwnd, msg, wparam, lparam)); }
|
|