Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

80 lines
1.5 KiB

  1. /*
  2. main.c
  3. A simple startup module so I can just call the win16 code
  4. with the least porting effort
  5. Revision history
  6. Sept 92 Lauriegr Remove try except - it just makes debugging harder.
  7. */
  8. #include <stdio.h>
  9. #include <stdlib.h>
  10. #include <windows.h>
  11. //
  12. // globals in mmiotest.c
  13. //
  14. extern HANDLE ghInst;
  15. //
  16. // functions in mmiotest.c
  17. //
  18. extern void Test1(HWND hWnd);
  19. extern void Test2(HWND hWnd);
  20. extern void Test3(HWND hWnd);
  21. int __cdecl main(int argc, char *argv[], char *envp[])
  22. {
  23. FILE *fp;
  24. /* save instance handle for dialog boxes */
  25. ghInst = GetModuleHandle(NULL);
  26. // create the local test file
  27. printf("\nCreating hello.txt");
  28. fp = fopen("hello.txt", "wb");
  29. if (!fp) {
  30. printf("\nUnable to create hello.txt");
  31. exit(1);
  32. }
  33. fprintf(fp, "hello world\r\n");
  34. fclose(fp);
  35. // try {
  36. // execute all the tests
  37. printf("\n--------------- Test1 ---------------\n");
  38. Test1(NULL);
  39. printf("Done Test1.\n");
  40. printf("\n--------------- Test2 ---------------\n");
  41. Test2(NULL);
  42. printf("Done Test2.\n");
  43. printf("\n--------------- Test3 ---------------\n");
  44. Test3(NULL);
  45. printf("Done Test3.\n");
  46. printf("Done All Tests.\n");
  47. // } except (1) {
  48. // printf("\nException");
  49. // }
  50. return 0;
  51. }
  52. void dDbgAssert(LPSTR exp, LPSTR file, int line)
  53. {
  54. printf("\nAssertion failure:");
  55. printf("\n Exp: %s", exp);
  56. printf("\n File: %s, line %d\n", file, line);
  57. DebugBreak();
  58. }