You are not logged in. You can browse in the PowerBASIC Community, but you must click Login (top right) before you can post. If this is your first visit, check out the FAQ or Sign Up.
You where right about the Style member beeing declared as a LONG in PBNote.
I changed it to a DWORD, - and got the GPF back.
Changed calls to OpenFileDialog and SaveFileDialog in PBNote,
(removed ByVal for the Style member), and now it works OK.
I make use of a copy of these procedures.
The reason is that the selected filetype is not returned.
Maybe this can be adjusted?
The default filter size is also to small in my case.
The dialogs returns flags too, like %OFN_READONLY. By declaring as BYVAL,
you cannot get these return values. Error in PBNote sample probably
originates from Style (flags) member being declared as LONG. Change
that to DWORD in PBNote.bas instead and it should work. Current version
of ComDlg32.inc is correct.
The COMDLG32.INC is dated 09.07.2001 16.22, and has a size of 21 833
It contains following information :
' Last Update: July 9, 2001
I'm not sure about the PBNote Version.... how do I determine this ?
maybe by "filestamp", as I've edited the file, I don't know the stamp
for it, but the other files (.rc, .pbr & .ico) are stamped 01.07.1999 06.00,
so I guess this might be version 6.00.
I put the BYVAL in Comdlg32.inc :
Code:
FUNCTION SaveFileDialog ( _
BYVAL hWnd AS LONG, _ ' parent window
BYVAL Caption AS STRING, _ ' caption
Filespec AS STRING, _ ' filename
BYVAL InitialDir AS STRING, _ ' start directory
BYVAL Filter AS STRING, _ ' filename filter
DefExtension AS STRING, _ ' default extension
>>>> BYVAL Flags AS DWORD _ ' flags
) AS LONG
FUNCTION OpenFileDialog ( _
BYVAL hWnd AS LONG, _ ' parent window
BYVAL Caption AS STRING, _ ' caption
Filespec AS STRING, _ ' filename
BYVAL InitialDir AS STRING, _ ' start directory
BYVAL Filter AS STRING, _ ' filename filter
BYVAL DefExtension AS STRING, _ ' default extension
>>>> BYVAL Flags AS DWORD _ ' flags
) AS LONG
No changes of the actual calls in PBNote :
Code:
If OpenFileDialog(hWndMain, "Open File", f, Path, "Text Files|*.TXT|All Files|*.*", "TXT", ByVal Style) THEN
If ISFALSE(SaveFileDialog(hWndMain, "Save File", f, Path,"Text Files|*.TXT|All Files|*.*", "TXT", ByVal Style)) Then
I Think the ComDlg32.inc needs a minor adjustment.
Playing with the PBNote sample, the OpenFileDialog and
SaveFileDialog functions GPF'ed, and what caused the GPF'ing
was the statement :
Code:
ofn.Flags = Flags
By adding BYVAL to the Flags argument the GPF'ing stopped...
We process personal data about users of our site, through the use of cookies and other technologies, to deliver our services, and to analyze site activity. For additional details, refer to our Privacy Policy.
By clicking "I AGREE" below, you agree to our Privacy Policy and our personal data processing and cookie practices as described therein. You also acknowledge that this forum may be hosted outside your country and you consent to the collection, storage, and processing of your data in the country where this forum is hosted.
Leave a comment: