home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / alt / msdos / programm / 3115 < prev    next >
Encoding:
Text File  |  1993-01-08  |  1.7 KB  |  54 lines

  1. Newsgroups: alt.msdos.programmer
  2. Path: sparky!uunet!spool.mu.edu!agate!usenet.ins.cwru.edu!wariat!erica
  3. From: erica@wariat.org (Lady of the BitMode)
  4. Subject: Borland C/C++ blues
  5. Message-ID: <1993Jan8.055812.26546@wariat.org>
  6. Organization: Akademia Pana Kleksa, Public Access Uni* Site
  7. Distribution: usa
  8. Date: Fri, 8 Jan 1993 05:58:12 GMT
  9. Lines: 43
  10.  
  11. Hello, a have a question about borland c++/c 3.1.
  12. I running win3.1 under dos5.0. I own borland c/c++ 3.1.
  13.  
  14. WHen I compile and execute the following code the windows just vanishes
  15. away before I can cause an event to happen to exit WaitMessage function
  16. call. Also, the text part of the button on the window is blank.
  17.  
  18. Basically, the program is terminating before anythings happends and all the the defined window get is a captions and a outline of  aa button.
  19.  
  20. Why ?, I copied this program out of a book. does anyone know why it won't run.
  21. actual code followins.
  22.  
  23. *All code is small*
  24.  
  25. test.c:
  26. =============================================================================
  27. #include <windows.h>
  28.  
  29. int PASCAL WinMain( HANDLE hInstance, HANDLE hPrevInstance, LPSTR lpszCmdLine,
  30. int nCmdShow )
  31.   {
  32.   HWND hWnd;
  33.  
  34.   hWnd= CreateWindow( "BUTTON", "PRESS ME", BS_PUSHBUTTON,
  35.   10, 10, 100, 100, NULL, NULL, hInstance, NULL ) ;
  36.   ShowWindow( hWnd, nCmdShow ) ;
  37.   WaitMessage();
  38.   return 0;
  39.   } 
  40.  
  41. test.def
  42. =============================================================================
  43. EXETYPE    WINDOWS
  44. STUB    'WINSTUB.EXE'
  45. CODE    PRELOAD MOVEABLE
  46. DATA PRELOAD MOVEABLE MULTIPLE
  47. HEAPSIZE 1024
  48. STACKSIZE 5120
  49.  
  50. test.prj
  51. =============================================================================
  52. test.c
  53. test.def                                                                                 
  54.