home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / os / os2 / programm / 6509 < prev    next >
Encoding:
Text File  |  1992-11-17  |  3.1 KB  |  108 lines

  1. Path: sparky!uunet!gumby!destroyer!gatech!prism!gb8
  2. From: gb8@prism.gatech.EDU (BEEBE,GARY E)
  3. Newsgroups: comp.os.os2.programmer
  4. Subject: More Trouble with WinFileDlg
  5. Message-ID: <75110@hydra.gatech.EDU>
  6. Date: 17 Nov 92 15:49:06 GMT
  7. Organization: Georgia Institute of Technology
  8. Lines: 98
  9.  
  10.  
  11. Hello All,
  12.  
  13. I am still having problems with the WinFileDlg API function
  14. and would like to solicite some information. In general,
  15. what I am trying to do is use the WinFileDlg function to
  16. return a path\filename of a file selected to be opened in
  17. the default OPEN style dialog box. The following section of
  18. code has not entirely worked:
  19.  
  20. #define INCL_PM
  21. #define INCL_DOSFILEMGR
  22. #define INCL_DOSERRORS
  23. #define INCL_WINSTDDLG
  24. #define INCL_WINSTDFILE
  25. #define INCL_WIN
  26. #define INCL_DOSMEMMGR
  27. #define INCL_DOSQUEUES
  28. #define INCL_DOSSEMAPHORES
  29. #define INCL_DEV
  30. #include "V_PLOT_2.h"
  31.  
  32.  
  33. APIRET open_file(HFILE *fptr,HWND hWndOwner)
  34. {
  35.    CHAR buffer[4];
  36.    APIRET Dlgrc;
  37.    FILEDLG Dlgdat;
  38.    ULONG OpenAction;
  39.    strcpy(buffer,"*.*");Dlgdat.cbSize=sizeof(FILEDLG);
  40.    Dlgdat.fl= FDS_CENTER| FDS_OPEN_DIALOG
  41.            FDS_PRELOAD_VOLINFO;
  42.    Dlgdat.pszTitle=(PSZ)NULL;
  43.    Dlgdat.pszIType=(PSZ)NULL;
  44.    Dlgdat.pszOKButton=(PSZ)NULL;
  45. /*   Dlgdat.pfnDlgProc=(PFNWP)NULL;
  46.    Dlgdat.hMod=(HMODULE)NULL;*/
  47.    Dlgdat.usDlgId=(USHORT)0;
  48.    Dlgdat.pszIType=(PSZ)NULL;
  49.    Dlgdat.papszITypeList=(PAPSZ)NULL;
  50.    Dlgdat.pszIDrive=(PSZ)NULL;
  51.    Dlgdat.papszIDriveList=(PAPSZ)NULL;
  52.    WinFileDlg(HWND_DESKTOP,hWndOwner,&Dlgdat);
  53.    Dlgrc=DosOpen(Dlgdat.szFullFile , fptr , &OpenAction
  54.          ,0,0,OPEN_ACTION_FAIL_IF_NEW,
  55.          OPEN_SHARE_DENYREADWRITE|OPEN_ACCESS_READONLY,0);
  56.    return(Dlgrc);
  57. }
  58.  
  59.  
  60. This code will compile properly but die at the WinFileDlg
  61. call with a protection violation. If prior to the WinFileDlg
  62. call the Dlgdat.pfnDlgProc and Dlgdat.hMod variables are set
  63. to NULL (for example in IDBG) then the dialog procedure
  64. appears to work fine. If the comments are removed from the
  65. "open_file" section of code so that the Dlgdat.pfnDlgProc
  66. and Dlgdat.hMod variables are set to NULL prior to
  67. compilation, then the compiler dies with the following
  68. error:
  69.  
  70. Invocation of <NMAKE.EXE> begins
  71. Invocation string:  /f V_PLOT_2.MAK
  72. <---------------------------------------------------------->
  73.  
  74.  
  75. Operating System/2 Program Maintenance Utility
  76.  
  77. Version 2.000.000 Dec 02 1991
  78.  
  79. Copyright (C) IBM Corporation 1988-1991.
  80.  
  81. Copyright (C) Microsoft Corp. 1988-1991.
  82.  
  83. All rights reserved.
  84.  
  85.      ICC.EXE /Sn /Q /Ls /Lx /Ti /W1 /Gs- /Gf .\V_PLOT_2.c
  86. D:\IBMC\WKFRAME\v_plot_2\V_PLOT_2.c(417:39) : severe error
  87. EDC0002: Unexpected compiler error #C0000005:2FA2D occurred.
  88. NMAKE : fatal error U1077: 'D:\OS2\CMD.EXE' :
  89. return code '12'
  90. Stop.
  91. <Make - Vector Plotter for OS/2> ended tc = 0 rc = 2 at
  92. 11-16-1992 21:41
  93.  
  94.  
  95. Will a CSD update fix this problem? I'm open to suggestions.
  96.  
  97. Thanks in advance,
  98.  
  99. Gary
  100.  
  101. P.S. Sorry about the M's :*)
  102.  
  103. -- 
  104. BEEBE,GARY E
  105. Georgia Institute of Technology, Atlanta Georgia, 30332
  106. uucp:      ...!{decvax,hplabs,ncar,purdue,rutgers}!gatech!prism!gb8
  107. Internet: gb8@prism.gatech.edu
  108.