|
Administrator H/PC Oracle Posts: | 18,011 |
Location: | United Kingdom | Status: | |
| Possibly, the runtime could have auto registered it, if you remove the DLL as well it should fail? |
|
|
|
H/PC Elite Posts: | 707 |
Location: | Europe | Status: | |
| C:Amie - 2024-01-18 2:29 PM
Possibly, the runtime could have auto registered it, if you remove the DLL as well it should fail?
That does cause it to fail! ("The control CommonDialog1 ({...} ) could not be created." |
|
|
|
Administrator H/PC Oracle Posts: | 18,011 |
Location: | United Kingdom | Status: | |
| The VB runtime is probably hunting for the DLL and sorting it out for you.
Does the cancel option work?
CommonDialog1.CancelError = True
On Error Resume Next
Err.Clear
CommonDialog1.ShowSave
If Err.Number <> 0 Then
msgbox("you cancelled")
End If
On Error GoTo 0 |
|
|
|
H/PC Elite Posts: | 707 |
Location: | Europe | Status: | |
| C:Amie - 2024-01-18 2:39 PM
The VB runtime is probably hunting for the DLL and sorting it out for you.
Does the cancel option work?
CommonDialog1.CancelError = True
On Error Resume Next
Err.Clear
CommonDialog1.ShowSave
If Err.Number <> 0 Then
msgbox("you cancelled")
End If
On Error GoTo 0
Yes, it does indeed work! |
|
|
|
Administrator H/PC Oracle Posts: | 18,011 |
Location: | United Kingdom | Status: | |
| (I just realise that I swapped over to ShowSave here and we should be using ShowOpen, did you catch that or am I being d.u.m.b?)
Does the x86 device have these on disk:
OLEAUT32.dll
commctrl.dll
MSCEComDlg.DLL
ole32.dll
Please re-regsrv them too |
|
|
|
H/PC Elite Posts: | 707 |
Location: | Europe | Status: | |
| C:Amie - 2024-01-18 2:49 PM
(I just realise that I swapped over to ShowSave here and we should be using ShowOpen, did you catch that or am I being d.u.m.b?)
Does the x86 device have these on disk:
OLEAUT32.dll
commctrl.dll
MSCEComDlg.DLL
ole32.dll
Please re-regsrv them too
I think it's fine that we're using ShowSave since that's what was causing the strange crash initially, and as far as I know both common dialogs have the issue of not returning an actual filename (let me know if I'm misunderstanding anything! )
I went ahead to check all those DLLs and re-registered oleaut32.dll and mscecomdlg.dll (the others had no entrypoint ), but nothing changed sadly |
|
|
|
H/PC Elite Posts: | 707 |
Location: | Europe | Status: | |
| This is the code I'm using in my application (it's pretty much just the sample from the eVB help file ):
Public Function GetFileToOpen() As String
Dim filefilter As String
'Set the text in the dialog title bar
CommonDialog1.DialogTitle = "Open Screenplay"
'Set the default file name and filter
CommonDialog1.InitDir = "\"
CommonDialog1.FileName = ""
filefilter = "CE Screenplay Documents (*.csp)|*.csp|All Files (*.*)|*.*"
CommonDialog1.Filter = filefilter
CommonDialog1.FilterIndex = 0
'Verify that the file exists
CommonDialog1.Flags = &H1000
'Show the Open common dialog box
CommonDialog1.ShowOpen
'Return the path and file name selected or
'Return an empty string if the user cancels the dialog
GetFileToOpen = CommonDialog1.FileName
End Function
And this is how I'm invoking it (I'm writing the contents of the main text field to disk ):
WriteFile GetFileToSave("Screenplay Document", "Save Screenplay", "csp"), txtMain.Text, 2
I wonder if there could be anything off with this, since it works on the CE6 ARM device and the eVT emulator, but not on CE5 x86. Hmm |
|
|
|
Administrator H/PC Oracle Posts: | 18,011 |
Location: | United Kingdom | Status: | |
| Worth checking it with ShowOpen just in case the behaviour is intentionally different.
I'm currently out of ideas, short of trying to find some older/newer version of commctrl.dll from CE 5's hotfixes |
|
|
|
H/PC Elite Posts: | 707 |
Location: | Europe | Status: | |
| Huh, so I tried out "HPC Notepad" (the eVB notepad app in the SCL ), and everything works just fine, common dialogues and everything. How? |
|
|
|
Administrator H/PC Oracle Posts: | 18,011 |
Location: | United Kingdom | Status: | |
| Must be some sort of state issue.
If you create a new project with just your open dialogue box code and a button, does it work then? |
|
|
|
H/PC Elite Posts: | 707 |
Location: | Europe | Status: | |
| C:Amie - 2024-01-18 3:47 PM
Must be some sort of state issue.
If you create a new project with just your open dialogue box code and a button, does it work then?
No sadly, I did MsgBox (GetFileToOpen()) and it opens the common dialog, but when I select a file it never shows the message box, not even an empty one Edited by I dunk for bananas 2024-01-18 4:45 PM
|
|
|
|
Administrator H/PC Oracle Posts: | 18,011 |
Location: | United Kingdom | Status: | |
| The msgbox event is not firing now in a blank project?! humm...
What happens if you
on error resume next
Dim varReturn as Variant
varReturn = GetFileToOpen()
msgbox ( typename(varReturn) )
if (err.number <> 0) then
msgbox ( err.number & " " & err.description )
end if
Are you using VB6 for this or eVB? |
|
|
|
H/PC Elite Posts: | 707 |
Location: | Europe | Status: | |
| C:Amie - 2024-01-18 5:12 PM
The msgbox event is not firing now in a blank project?! humm...
What happens if you
on error resume next
Dim varReturn as Variant
varReturn = GetFileToOpen()
msgbox ( typename(varReturn) )
if (err.number <> 0) then
msgbox ( err.number & " " & err.description )
end if
Are you using VB6 for this or eVB?
I'm using eVB 3.0 for this!
I tried it out and I'm getting the same exact result as before, no message box ever appears |
|
|
|
Administrator H/PC Oracle Posts: | 18,011 |
Location: | United Kingdom | Status: | |
| If you put a msgbox immediately after the end if, that appears fine, I'm guessing?
msgbox("hello") |
|
|
|
Subscribers H/PC Vanguard Posts: | 3,689 |
Location: | Japan | Status: | |
| Wasn’t it that the cab contains .dll as well? |
|
|