P
PeterWokke
Guest
I have to do it in ABL coding.I have. &IF PROCESS-ARCHITECTURE EQ 32 &THEN &GLOBAL-DEFINE POINTERTYPE 'LONG' &GLOBAL-DEFINE POINTERBYTES 4 &GLOBAL-DEFINE OPENFILENAME_SIZE_VERSION 76 &ELSEIF PROCESS-ARCHITECTURE EQ 64 &THEN &GLOBAL-DEFINE POINTERTYPE 'INT64' &GLOBAL-DEFINE POINTERBYTES 8 &GLOBAL-DEFINE OPENFILENAME_SIZE_VERSION 148 &ENDIF DEFINE VARIABLE iPoint AS INTEGER NO-UNDO. /* create and initialize an OPENFILENAME structure: */ SET-SIZE(lpOfn) = {&OPENFILENAME_SIZE_VERSION}. message 'OPENFILENAME_SIZE' {&OPENFILENAME_SIZE_VERSION} skip 'POINTERBYTES' {&POINTERBYTES} view-as alert-box. iPoint = 1. /* size */ PUT-INT64 (lpOfn, iPoint) = GET-SIZE(lpOfn). iPoint = iPoint + {&POINTERBYTES}. /* hwndOwner */ PUT-INT64 (lpOfn, iPoint) = QCurrentHWND. iPoint = iPoint + {&POINTERBYTES}. /* hInstance */ PUT-INT64 (lpOfn, iPoint) = 0. iPoint = iPoint + {&POINTERBYTES}. /* lpstrFilter */ PUT-INT64 (lpOfn, iPoint) = GET-POINTER-VALUE(lpstrFilter). iPoint = iPoint + {&POINTERBYTES}. /* lpstrCustomFilter */ PUT-INT64 (lpOfn, iPoint) = 0. iPoint = iPoint + {&POINTERBYTES}. /* nMaxCustFilter */ PUT-INT64 (lpOfn, iPoint) = 0. iPoint = iPoint + {&POINTERBYTES}. /* nFilterIndex */ PUT-INT64 (lpOfn, iPoint) = 0. iPoint = iPoint + {&POINTERBYTES}. /* lpstrFile */ PUT-INT64 (lpOfn, iPoint) = GET-POINTER-VALUE(lpstrFile). iPoint = iPoint + {&POINTERBYTES}. /* nMaxFile */ PUT-INT64 (lpOfn, iPoint) = GET-SIZE(lpstrFile). iPoint = iPoint + {&POINTERBYTES}. /* lpstrFileTitle */ PUT-INT64 (lpOfn, iPoint) = 0. iPoint = iPoint + {&POINTERBYTES}. /* nMaxFileTitle */ PUT-INT64 (lpOfn, iPoint) = 0. iPoint = iPoint + {&POINTERBYTES}. /* lpstrInitialDir */ PUT-INT64 (lpOfn, iPoint) = IF (GET-SIZE(lpstrInitialDir) 0) THEN GET-POINTER-VALUE(lpstrInitialDir) ELSE 0. iPoint = iPoint + {&POINTERBYTES}. /* lpstrTitle */ PUT-INT64 (lpOfn, iPoint) = GET-POINTER-VALUE(lpstrTitle). iPoint = iPoint + {&POINTERBYTES}. /* flags */ PUT-INT64 (lpOfn, iPoint) = Flags. iPoint = iPoint + {&POINTERBYTES}. /* nFileOffset */ PUT-SHORT (lpOfn, iPoint) = 0. iPoint = iPoint + 2. /* nFileExtension */ PUT-SHORT (lpOfn, iPoint) = 0. iPoint = iPoint + 2. /* lpstrDefExt */ PUT-INT64 (lpOfn, iPoint) = 0. iPoint = iPoint + {&POINTERBYTES}. /* lCustData */ PUT-INT64 (lpOfn, iPoint) = 0. iPoint = iPoint + {&POINTERBYTES}. /* lpfnHook */ PUT-INT64 (lpOfn, iPoint) = 0. iPoint = iPoint + {&POINTERBYTES}. /* lpTemplateName */ PUT-INT64 (lpOfn, iPoint) = 0. iPoint = iPoint + 7. message GET-POINTER-VALUE(lpOfn) skip 'iPoint ' iPoint skip STRING(lpOfn) view-as alert-box. /*CURRENT-WINDOW:SENSITIVE = FALSE.*/ /* run the dialog: */ RUN GetOpenFileNameA (GET-POINTER-VALUE(lpOfn), OUTPUT c-OK). /*CURRENT-WINDOW:SENSITIVE = TRUE.*/ This still not work. Should I set &GLOBAL-DEFINE POINTERBYTES 16 USse for PUT-SHORT increase of 4 &GLOBAL-DEFINE OPENFILENAME_SIZE_VERSION 296
Continue reading...
Continue reading...