Hi Cor,

Message de Cor Nouws  date 2007-05-18 16:16 :
Since (to me) it is not clear what happens if a librabry is already loaded (is a new reference made or not?) one can add a check.

According to IDL description of XLibraryContainer.loadLibrary it is useless to test if already loaded: "Causes the accessed library to be loaded from its storage if it hasn't already been loaded."

Now when more than one libraries are needed, one gets a sequence as:

  If (Not Globalscope.BasicLibraries.isLibraryLoaded("Tools")) Then
    Globalscope.BasicLibraries.LoadLibrary("Tools")
  End If

  If (DialogLibraries.isLibraryLoaded("x")) Then
    DialogLibraries.LoadLibrary("x")
  End If
  oDlg = CreateUnoDialog(DialogLibraries.x.dlgx)

In my experience, this regularly leads to runtime errors on the line with CreateUnoDialog.
I think that has to do with timing.
Error message (my translation:
    "Action not supported.
    Invalid call of procedure."


Try to simply load the library and see if the problem persists.
I have never experienced such error.
It may be due to the names of your dialog library and module.
Personnally I prefer the getByName method:

DialogLibraries.LoadLibrary("x")
myLib = DialogLibraries.getByName("x")
myDialog = myLib.getByName("dlgx")
oDlg = CreateUnoDialog(myDialog)

______
Bernard

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to