Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

GetFileOpenName in PB9 and OFN_EXPLORER flag

312 views
Skip to first unread message

philipsalgannik

unread,
Aug 4, 2004, 1:47:30 PM8/4/04
to
Anybody was able to successfuly open the dialog in Explorer
style?

Ken Balakrishnan

unread,
Aug 4, 2004, 2:13:21 PM8/4/04
to
Works for me in Pb9 build 7119...

GetFileOpenName("Test", sPath, sFile, ".txt", "All Files (*.*),*.*", "c:\",
4)


<Philip Salgannik> wrote in message
news:41112132.3c0...@sybase.com...

philipsalgannik

unread,
Aug 4, 2004, 3:49:34 PM8/4/04
to
The syntax works for me too :-). The resulting dialog is NOT
Explorer style.
When I do it thru an API call with OFN_EXPLORER flag, it
opens proper Explorer style dialog...

Terry Voth

unread,
Aug 4, 2004, 3:56:14 PM8/4/04
to
I'm not sure what it's *supposed* to look like, but it looks
different, with files and folders in separate selection lists. It
actually looks more Win3.1 to me. I'm on 6533.

Good luck,

Terry [TeamSybase] and Sequel the techno-kitten


Sequel's Sandbox: http://www.techno-kitten.com
Home of PBL Peeper, a free PowerBuilder Developer's Toolkit.
Version 2.2.06 now available at the Sandbox
See the PB Troubleshooting Guide at the Sandbox
^ ^
o o
=*=

Paul Horan[TeamSybase]

unread,
Aug 4, 2004, 4:02:07 PM8/4/04
to
<Philip Salgannik> wrote in message news:41113dce.3f8...@sybase.com...

> The syntax works for me too :-). The resulting dialog is NOT
> Explorer style.
> When I do it thru an API call with OFN_EXPLORER flag, it
> opens proper Explorer style dialog...
>
> > Works for me in Pb9 build 7119...
> >
> > GetFileOpenName("Test", sPath, sFile, ".txt", "All Files
> > (*.*),*.*", "c:\", 4)
> >
> >


What's the API call?

--
Paul Horan[TeamSybase]


philipsalgannik

unread,
Aug 4, 2004, 4:20:58 PM8/4/04
to
Function long GetSaveFileNameA(REF OPENFILENAME
SaveFileName) library "comdlg32.dll"

type OPENFILENAME from structure
long lstructsize
long hwndowner
long hinstance
long lpstrfilter
long lpstrcustomfilter
long nMaxCustomFilter
long nFilterIndex
long lpstrFile
long nMaxFile
long lpstrFileTitle
long nMaxFileTitle
long lpstrInitialDir
long lpstrTitle
long Flags
integer nFileOffset
integer nFileExtension
long lpstrDefExt
long lCustData
long lpfnHook
long lpTemplateName
end type

Terry Voth

unread,
Aug 4, 2004, 4:43:01 PM8/4/04
to
If you can supply the PowerScript to populate the structure and make
the call, I can compare to what I'm seeing. (The picture on MSDN is
missing:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/WinUI/WindowsUserInterface/UserInput/CommonDialogBoxLibrary/AboutCommonDialogBoxes/OpenandSaveAsDialogBoxes.asp)

Bruce Armstrong [TeamSybase]

unread,
Aug 4, 2004, 5:58:24 PM8/4/04
to
You're using the wrong value for OFN_EXPLORER, but it's because the wording of
the help is rather poor.

The value you pass for aFlag is 2 ^ ( index - 1 )
^^^^^

Since the index for OFN_EXPLORER is 2, you need to pass 2, not 4, because you're
supposed to pass 2 ^ ( 2 - 1 ) = 2 ^ 1 = 2.

On 4 Aug 2004 11:13:21 -0700,
in sybase.public.powerbuilder.general

Ken Balakrishnan

unread,
Aug 4, 2004, 6:07:09 PM8/4/04
to
Oops. I didn't read the Help thoroughly and so I used the wrong flag, and
when I saw something different than usual, I assumed it was what you were
after. According to Help, if you set any flags, the old-style dialog will
be used (which is what Terry and I saw), unless you also set OFN_EXPLORER,
in which case the usual dialog (without the bar on the left) is used. So,
as far as PB is concerned, it seems to be working as documented....?

<Philip Salgannik> wrote in message

news:411151d8.412...@sybase.com...


> > If you can supply the PowerScript to populate the

> You should be seeing the one called ExplDial, but most
> likely seeing something like Pb9dial
>


Ken Balakrishnan

unread,
Aug 4, 2004, 6:14:18 PM8/4/04
to
You're being kind -- the wording of Help was OK, I just wasn't paying
attention. But thanks for softening the blow. :)

"Bruce Armstrong [TeamSybase]" <NOCANSPAM_br...@teamsybase.com>
wrote in message news:41115c00$1@forums-1-dub...

Philip Salgannik

unread,
Aug 4, 2004, 7:42:58 PM8/4/04
to
Doesn't matter what you pass as a flag, still get the wrong dialog...


pbm_thisusuallydoesnothelp:-))
Philip Salgannik

"Bruce Armstrong [TeamSybase]" <NOCANSPAM_br...@teamsybase.com>
wrote in message news:41115c00$1@forums-1-dub...

Philip Salgannik

unread,
Aug 4, 2004, 7:45:27 PM8/4/04
to
I don't read the help the way you do...
It says " Passing the flag 32770 opens the Explorer-style dialog box with
the Read Only check box selected by default."


pbm_thisusuallydoesnothelp:-))
Philip Salgannik

"Ken Balakrishnan" <kNOe...@cps92.com> wrote in message
news:41115e0d$1@forums-1-dub...

Terry Voth

unread,
Aug 4, 2004, 7:45:48 PM8/4/04
to
You are correct about what I'm seeing. Haven't got a work around
yet....

On 4 Aug 2004 14:15:04 -0700, Philip Salgannik wrote:

>> If you can supply the PowerScript to populate the

Bruce Armstrong [TeamSybase]

unread,
Aug 4, 2004, 8:53:52 PM8/4/04
to
Don't know what to say, it works fine for me.

On 4 Aug 2004 16:42:58 -0700, "Philip Salgannik"
<philema...@comcast.net> wrote:

Bruce Armstrong [TeamSybase]
http://www.teamsybase.com

Vote for PocketBuilder in the Mobile Village awards
http://www.mobilevillage.com/awards.htm

Vote for PocketBuilder in the Pocket PC Magazine awards
http://www.pocketpcmag.com/awards/category_2004.asp?catid=46

Two 3rd party books on developing with PowerBuilder
http://www.pb9books.com?source=newsgroups

Need code sample? Check out CodeXchange:
http://www.codexchange.sybase.com

Preach the gospel at all times. If necessary, use words. - Francis of Assisi
http://www.needhim.org

---------------------------------------------------------------------
DISCLAIMER:

This newsgroup message is only intended for the recipient. Given that it
is a posting to a public newsgroup, that means if you can read this
message then you are the recipient. This message may contain information
that is confidential and protected from disclosure. And then again,
it may not.

Given that TeamSybase members are not employees of Sybase, the contents
of this message do not necessarily represent the views or policies of
Sybase. Given that TeamSybase is a diverse group of users of Sybase
products, the contents of this message do not necessarily represent the
views of a significant number of the members of TeamSybase. Given that the
author has mutliple personalities and hears voices in his head, the contents
of this message do not necessarily represent his own views.

Philip Salgannik

unread,
Aug 5, 2004, 12:28:07 AM8/5/04
to
Did you look at the images in my other post?


pbm_thisusuallydoesnothelp:-))
Philip Salgannik

"Bruce Armstrong [TeamSybase]" <NOCANSPAM_br...@teamsybase.com>
wrote in message news:gp03h0lo93kcnkcjf...@4ax.com...

Bruce Armstrong [TeamSybase]

unread,
Aug 5, 2004, 1:01:44 AM8/5/04
to
Yep. What about them?

Here's the explorer dialog I get, and the code I'm using to get it.

On 4 Aug 2004 21:28:07 -0700, "Philip Salgannik"

Philip Salgannik

unread,
Aug 5, 2004, 8:59:25 AM8/5/04
to
This is the WRONG one. This one I can get too.


pbm_thisusuallydoesnothelp:-))
Philip Salgannik

"Bruce Armstrong [TeamSybase]" <NOCANSPAM_br...@teamsybase.com>
wrote in message news:2bf3h01jc6u5n4cif...@4ax.com...


Philip Salgannik

unread,
Aug 5, 2004, 8:59:39 AM8/5/04
to
This is the WRONG one. This one I can get too.


pbm_thisusuallydoesnothelp:-))
Philip Salgannik

"Bruce Armstrong [TeamSybase]" <NOCANSPAM_br...@teamsybase.com>
wrote in message news:69f3h09m35mediocf...@4ax.com...

Ken Balakrishnan

unread,
Aug 5, 2004, 9:17:18 AM8/5/04
to
PB Help says "If you do not pass an aFlag, the Explorer-style open file
dialog box is used." So it considers the dialog Bruce attached to be the
"Explorer-style" dialog box (as opposed to the pre-windows95 style).

"Philip Salgannik" <philema...@comcast.net> wrote in message
news:41117517$1@forums-1-dub...

Philip Salgannik

unread,
Aug 5, 2004, 9:27:10 AM8/5/04
to
This is the WRONG one. This one I can get too.


pbm_thisusuallydoesnothelp:-))
Philip Salgannik

"Ken Balakrishnan" <kNOe...@cps92.com> wrote in message

news:41123485$1@forums-2-dub...

Bruce Armstrong [TeamSybase]

unread,
Aug 5, 2004, 9:42:21 AM8/5/04
to
That *is* an Explorer style dialog.

Perhaps you're insisting that it have the places bar? If so, you
might try my PBNI implementation:

http://powerbuilder.codexchange.sybase.com/files/documents/67/802/pbnicommondialog.zip

On 5 Aug 2004 05:59:25 -0700, "Philip Salgannik"
<philema...@comcast.net> wrote:

Bruce Armstrong [TeamSybase]

Terry Voth

unread,
Aug 5, 2004, 2:40:51 PM8/5/04
to
Looks like PB is controlling the OFN_EX_NOPLACESBAR flag, which is
what you want. Looks like an API call to do what you want, if not a
PBNI object (haven't quite got my brain wrapped around the requirement
for the hook callback).

Good luck,

Terry [TeamSybase] and Sequel the techno-kitten

On 4 Aug 2004 16:45:48 -0700, Terry Voth <seq...@techno-kitten.com>
wrote:

philipsalgannik

unread,
Aug 5, 2004, 6:28:00 PM8/5/04
to
Looks like it's a PB9 bug to me - this function is not
behaving as advertised. What's the point of publishing it
with the ability to call it with the proper flags, if it
doesn't perform right?

And I have no problem doing it thru API without the hook
callback...

Looks like the problem is that PBVM is either setting
OFN_ENABLE_HOOK (and NOT OFN_EX_NOPLACESBAR) OR was compiled
with header file from old SDK where the OPENFILENAME struct
definition is missing this piece:
typedef struct tagOFN {
DWORD lStructSize; // important!
•••
// as you've always known and loved it
#if (_WIN32_WINNT >= 0x0500)
void* pvReserved;
DWORD dwReserved;
DWORD FlagsEx;
#endif // (_WIN32_WINNT >= 0x0500)
} OPENFILENAME, *LPOPENFILENAME;


Windows 2000 keys on the size of the OPENFILENAME struct AND
whether the dialog uses a hook procedure (whether
OFN_ENABLE_HOOK flag is set) to determine which dialog to
use. If OPENFILENAME has the old size, Windows 2000 uses
OFN_ENABLEHOOK to determine which dialog to use. If the
OPENFILENAME uses a hook procedure (or OFN_ENABLETEMPLATE is
set), Windows 2000 displays the old-style dialog; otherwise,
it displays the new one ...

Bruce Armstrong [TeamSybase]

unread,
Aug 5, 2004, 6:50:38 PM8/5/04
to
It's doing exactly what it's supposed to be doing. You asked for an Explorer
style dialog, and that's what you get. If you want to have an option to display
the place bar as well, submit it as an enhancement request.

On 5 Aug 2004 15:28:00 -0700,
in sybase.public.powerbuilder.general

>> =*.

Philip Salgannik

unread,
Aug 5, 2004, 7:57:35 PM8/5/04
to
I get an old style dialog. This problem is widely discussed and acknowledged
by development community outside of Powerbuilder world.


pbm_thisusuallydoesnothelp:-))
Philip Salgannik

"Bruce Armstrong [TeamSybase]" <NOCANSPAM_br...@teamsybase.com>
wrote in message news:4112b9be$1@forums-1-dub...

Bruce Armstrong [TeamSybase]

unread,
Aug 5, 2004, 9:13:14 PM8/5/04
to
The image I sent you is for an explorer style dialog. If that's what
you are getting, then you are getting an explorer style dialog. If
that's not what you want, then the issue has more to do with your
expectations.

On 5 Aug 2004 16:57:35 -0700, "Philip Salgannik"
<philema...@comcast.net> wrote:

Bruce Armstrong [TeamSybase]

Terry Voth

unread,
Aug 5, 2004, 10:21:27 PM8/5/04
to
This article illustrates the Explorer style without the navigation bar
on the left in your example:

http://www.microsoft.com/msj/0198/c0198.aspx

By this article's standards, your example is in Explorer style, but it
also has the places bar, as this other article describes and
illustrates:

http://www.microsoft.com/msj/0899/logo/logo.aspx

PB doesn't claim to control the places bar, that I can find. So,
sounds like you'll have to go non-native. Sounds like there's a
solution available on CodeXchange.

Then again, if you think you've got a bug, the Support section of the
Sybase web site is the place to report it.

Good luck,

Terry [TeamSybase] and Sequel the techno-kitten

On 5 Aug 2004 18:57:03 -0700, "Philip Salgannik"
<philema...@comcast.net> wrote:

>Here is the picture of an Explorer style dialog:


>
>
>
>pbm_thisusuallydoesnothelp:-))
>Philip Salgannik
>
>"Bruce Armstrong [TeamSybase]" <NOCANSPAM_br...@teamsybase.com>

>wrote in message news:u9d4h0ln37aat03qd...@4ax.com...

Sequel's Sandbox: http://www.techno-kitten.com
Home of PBL Peeper, a free PowerBuilder Developer's Toolkit.
Version 2.2.06 now available at the Sandbox
See the PB Troubleshooting Guide at the Sandbox
^ ^
o o

=*=

Philip Salgannik

unread,
Aug 5, 2004, 10:38:14 PM8/5/04
to

"Terry Voth" <seq...@techno-kitten.com> wrote in message
news:gep5h0hfs7ccngr4a...@4ax.com...


> PB doesn't claim to control the places bar, that I can find.

That's exactly my point - that implies that it does not set
OFN_EX_NOPLACESBAR flag, that in turn means that if the PBVM9 was compiled
with the proper header file for common controls AND does not set the
OFN_ENABLE_HOOK we should be getting a true new Explorer style dialog - with
places bar.


pbm_thisusuallydoesnothelp:-))
Philip Salgannik


Terry Voth

unread,
Aug 5, 2004, 11:13:08 PM8/5/04
to
I don't see the initial implication; I'd imagine there are lots of
"flags" that are "set" that we aren't told of at the 4GL level.
Besides, Sybase *couldn't* put it in there by default; can you imagine
how developers would complain if they have to recapture their windows'
pictures for documentation? <BG>

Of course, if you still think it's a bug...

Good luck,

Terry [TeamSybase] and Sequel the techno-kitten

On 5 Aug 2004 19:38:14 -0700, "Philip Salgannik"
<philema...@comcast.net> wrote:

Sequel's Sandbox: http://www.techno-kitten.com

Bruce Armstrong [TeamSybase]

unread,
Aug 5, 2004, 11:52:02 PM8/5/04
to
Did you notice this in the declaration of the OPENFILENAME structure:

#if (_WIN32_WINNT >= 0x0500)
void * pvReserved;


DWORD dwReserved;
DWORD FlagsEx;
#endif // (_WIN32_WINNT >= 0x0500)

The flag you're expecting them to support is only supported on W2K and
WinXP. What you are suggesting would have rendered PowerBuilder (or
at least that function) inoperable on anything other than W2K and
WinXP. PB9 officially supports NT, and is used without official
support on a number of older OSes.

On 5 Aug 2004 19:38:14 -0700, "Philip Salgannik"
<philema...@comcast.net> wrote:

Bruce Armstrong [TeamSybase]

Philip Salgannik

unread,
Aug 6, 2004, 8:44:36 AM8/6/04
to
Your statement is completely wrong. That's exactly the reason why there is a
#if (_WIN32_WINNT >= 0x0500)
in there...

pbm_thisusuallydoesnothelp:-))
Philip Salgannik

"Bruce Armstrong [TeamSybase]" <NOCANSPAM_br...@teamsybase.com>
wrote in message news:qav5h010sbcc7j4la...@4ax.com...

Tyler Cruse

unread,
Aug 6, 2004, 8:57:21 AM8/6/04
to
This sounds like something that should be added for the PB11 UI improvements
list. The NT4 issue is gone past PB9 so it makes sense to offer the
additional style
selection as an option going forward.

"Bruce Armstrong [TeamSybase]" <NOCANSPAM_br...@teamsybase.com>
wrote in message news:qav5h010sbcc7j4la...@4ax.com...

Bruce Armstrong [TeamSybase]

unread,
Aug 6, 2004, 10:32:24 AM8/6/04
to
Really? That's a compiler directive. It gets evaluated when the
compile for PowerBuilder IDE is done:

http://www.cplusplus.com/doc/tutorial/tut5-5.html

Which means that if it's done on Win2K or WinXP and the _WIN32_WINNT
is set to 500 or higher, the PowerBuilder VM will get compiled to use
the larger version of the structure. What will happen at runtime is
that PowerBuilder will pass that larger structure, and then older
operating systems that do not have that version of the common controls
will choke on the call.

The other option, the one it appears Sybase went with, is to not set
the flag so that the structure that is used is the one that is
supported on all of the OSes they support.

On 6 Aug 2004 05:44:36 -0700, "Philip Salgannik"

Philip Salgannik

unread,
Aug 6, 2004, 10:30:24 PM8/6/04
to

> The other option, the one it appears Sybase went with, is to not set
> the flag so that the structure that is used is the one that is
> supported on all of the OSes they support.

Which brings us full circle to my previous post - why are they using
OFN_ENABLE_HOOK ?
Using a direct API call I get the places bar passing in the OLD size of the
structure without any problems...
So if they did not use the OFN_ENABLE_HOOK you would get proper behavior in
all PB9 supported OSes...


0 new messages