This is in a DLL project. I load a Modal form in an exported function but when I close the form the whole process crashes, also taking the calling program with it. This worked all fine when compiled in FF2, same code, but now in FF3 something upsets Windows.
So far I have only tested to call the function from a VB6 app, as that's my main project using the dll, but will create a small test app in FF3 to make sure VB isn't to blame, but as I said it all works when compiled in FF2.
This is the PB/FF3 function where the form is loaded
Function ViewAtlas Alias "ViewAtlas" (ByVal hParentForm As Long, StrCountry As String) Export As String
Local nReturn As Long
Local StrReturn As String * 94
sCapText = GetString(28)
sInfoText = GetString(29) + $CrLf + $CrLf + GetString(30) + $CrLf + $CrLf + GetString(31) + $CrLf + $CrLf + GetString(32)
CurrPlace = Extract$(1, StrCountry, ":")
CurrCountry = Remain$(1, StrCountry, ":")
nReturn = FRMATLASVIEW_Show(hParentForm,%TRUE, 1&)
If nReturn Then
Type Set StrReturn = uCurrPlace
Function = StrReturn
Else
Function = ""
End If
End Function
I had a problem loading this form before but it was finally solved by help from "Master Paul" spotting something evil in my code. It's quite possible I have more evil code contribing to this, but first of all thought I should get clear I actually closes the form in a correct way?
Function FRMATLASVIEW_CMDGET_BN_CLICKED ( _
ControlIndex As Long, _ ' index in Control Array
hWndForm As Dword, _ ' handle of Form
hWndControl As Dword, _ ' handle of Control
idButtonControl As Long _ ' identifier of button
) As Long
FF_CloseForm hWndForm, %TRUE
End Function
'--------------------------------------------------------------------------------
Function FRMATLASVIEW_CMDCANCEL_BN_CLICKED ( _
ControlIndex As Long, _ ' index in Control Array
hWndForm As Dword, _ ' handle of Form
hWndControl As Dword, _ ' handle of Control
idButtonControl As Long _ ' identifier of button
) As Long
FF_CloseForm hWndForm, %FALSE
End Function
Is this enough or do I need to do some clean up regarding controls on form etc.? As it works fine when compiled in FF2 I think this really shouldn't be needed though. Well troughing out this in case someone may have a hint of someting to test, while I try to digg deeper, but I am a bit clueless as there isn't much more to trap once the form closes and _Show never return any value before it crash. Well maybe the DLL support in FF3 still is a bit shaky and unmature as well, I don't know.
Wow! Master Paul sent me a new FF exe fixing an issue with changes to FF_Libmain not saving, and possible more magic as it actually solved my form crash.
I am delighted!