What am I doing wrong?
Code: Select all
Runtime Procedure test()
MessageBox_(#Null, "test", "test", 0)
EndProcedure
ProcedureDLL MyFunction(handle.i)
#XmlEncoding = #PB_UTF8
#Dialog = 0
#Xml = 0
XML$ = "<window id='#PB_Any' name='test' text='test' minwidth='auto' minheight='auto' flags='#PB_Window_ScreenCentered | #PB_Window_SystemMenu | #PB_Window_SizeGadget'>" +
" <panel>" +
" <tab text='First tab'>" +
" <vbox expand='item:2'>" +
" <hbox>" +
" <button text='button 1'/>" +
" <checkbox text='checkbox 1'/>" +
" <button text='button 2' onevent='test()'/>" +
" </hbox>" +
" <editor text='content' height='150'/>" +
" </vbox>" +
" </tab>" +
" <tab text='Second tab'>" +
" </tab>" +
" </panel>" +
"</window>"
If CatchXML(#Xml, @XML$, StringByteLength(XML$), 0, #XmlEncoding) And XMLStatus(#Xml) = #PB_XML_Success
If CreateDialog(#Dialog) And OpenXMLDialog(#Dialog, #Xml, "test", 0, 0, #PB_Ignore, #PB_Ignore, handle)
Repeat
Select WaitWindowEvent(10)
Case #PB_Event_CloseWindow
quit = 1
EndSelect
Until quit = 1
Else
Debug "Dialog error: " + DialogError(#Dialog)
EndIf
Else
Debug "XML error: " + XMLError(#Xml) + " (Line: " + XMLErrorLine(#Xml) + ")"
EndIf
EndProcedure