Application crashing when open file dialog is opened

Kia Ora folks

My C10 apllication has started crashing randomly when the the file
dialogue box pops up for users to select a csv file.

Has anyone encountered this?

Marc

Is there a parameter used? and is the same definition used on both sides?
I had something like this recently that ended up being the parameter list and prototype being all out of whack.

bonjour

if code is inside a Modal Event and it calls a windows dialog you may find it does not behave as expected. Check the help on that one its lists the events it effects and states not to call any windows dialogs.

cest la vie

I hesitate to mention my experience - because I never figured out WHY it was a problem.
It didn’t (and still doesn’t) make any sense to me.

I wrote code that would dim a window when another window on the same thread was called.
I accomplished this by using SYSTEM{PROP:OpenWindowHook}
and CREATE()ing a REGION which I made semi-transparent using the API call SetLayeredWindowAttributes

I had it working, and I thought it looked pretty good.
But we found that FILEDIALOG would crash when it was turned on
and FILEDIALOG was fine when it was turned off.

Hi Sean.
Can you elaborate on what you said please? I don’t understand what you mean by ‘the same definition on both sides’.

Marc

Sure. In my case the procedure prototype and the procedure parameters were different.
I can’t remember exactly what went on now, but I remember just having to make them the same and that fixed my problem.
I’ve certainly had problems in the past with that sort of thing with multi dll where the prototypes and params in different dlls were out of sync. Can cause all sorts of fun.

@MarkGoldberg

> I wrote code that would dim a window when another window on the same thread was called.
> I accomplished this by using SYSTEM{PROP:OpenWindowHook}
> and CREATE()ing a REGION which I made semi-transparent using the API call SetLayeredWindowAttributes
*> *
> I had it working, and I thought it looked pretty good.
> But we found that FILEDIALOG would crash when it was turned on
> and FILEDIALOG was fine when it was turned off.

Dimming a window when another window within the same thread opens is exactly what I always wanted try to implement. I thought about this many times but didn’t find an easy way to do this.
Are you willing to share your code?
Maybe you could send me a small example which shows the crash.
I would test it on my site (using Clarion 8 or Clarion 11.1).

Jens

I understand now.
Everything appears fine to me.
I’m wondering if the environment might be playing a part.
I’ll keep looking.
If you have any other ideas please sing out.
Marc

This is an implementation using another approach:
test.clw (2,8 КБ)

I’m catching up from being gone. Your original post contains no information to help solve your problem.

You should post the code you use to call the FileDialog() from your program. Often the Code has a bug, without seeing code cannot help.

Do you get a crash / exception window? Post a screen capture as it shows codes.

Check the Windows Event Viewer. It sometimes will show a logged event from the OS. This is especially useful if the program just shuts down without an exception window.

The Common Dialogs do have a Get Last Error code function that is useful when it does not display, but that’s not going to help a crash. Possibly when it is working there is an error code.

Hi Carl

You’re are correct. It was a bit light on information.

Below is a crash window that pops up.

The application calls filedialog in a few places but in others it uses the DOSFileLookup control which I think calls filedialog (I’ve tried filedialogA but same issue).

This is an example of code which is calling filedialog.

LOC:DataPath = GetSetting('CWDImportFilePath','H:\')
LOC:PickScreenMessage = 'Select CWD Import File'
IF FILEDIALOGA(CLIP(LOC:PickScreenMessage),LOC:DataPath,,1010010b)
ELSE
    CLEAR(LOC:DataPath)
END

image.png

Nga mihi

Marc Brierley

Hello Marc - Your image was not properly attached. Looks like a gmail link.

There are FILE:xxx equates to make the code more obvious what you are doing. They are in the FileDialogA Help and Equates.clw. Also in the editor will popup in Intelllisense. I think the below are the equates for 1010010b

IF FILEDIALOGA(CLIP(LOC:PickScreenMessage),LOC:DataPath,, |
               FILE:KeepDir + FILE:LongName + FILE:CreatePrompt )


FILE:Save         EQUATE(1)     ! 00000001
FILE:KeepDir      EQUATE(2)     ! 00000010
FILE:NoError      EQUATE(4)     ! 00000100
FILE:Multi        EQUATE(8)     ! 00001000
FILE:LongName     EQUATE(10H)   ! 00010000
FILE:Directory    EQUATE(20H)   ! 00100000
FILE:CreatePrompt EQUATE(40H)   ! 01000000
FILE:AddExtension EQUATE(80H)   ! 10000000
                                ! 84218421
1 Like

Is the filedialog trying to open a mapped shared folder on the network and the app OS is windows 10 or 11?