General XMetaL Discussion

  • elias

    Loading XAC in XMAX

    Participants 0
    Replies 1
    Last Activity 11 years, 6 months ago

    I use XMAX 6.0. I've written some event handlers in the mcr-file and build the corresponding xac-file.
    How one can load xac file without any xml files?
    For example, let us consider a mcr file which shows 'Hello, world!' messagebox when the mcr has been loaded.
    What is the right scenario in this case?
    I mean a subset of XMAX properties and/or methods for doing this.
    What will happen if we set xml property to an empty string?
    Why does On_Macro_File_Load event handler sometimes fail when we simply set xml property to an empty string and xac property to the existing xac-file with zip-embedded mcr-file?   


    Derek Read

    Reply to: Loading XAC in XMAX

    Such a XAC file would be considered “application-level” and only XMetaL Author has this concept. In the case of XMAX any application-level code belongs in your host application (the container that you are hosting XMAX inside).

    What you are trying to do (which is to try to trick the product into loading an empty file, which amounts to not loading anything) will probably cause problems because XMAX really expects to be loading a string or file (depending on the API being used). It is possible to load a document as well-formed but the scenario you are attempting (one might argue that an empty file is technically “well-formed” I guess) is not something we have designed the product to handle.

    My recommendation is to move any code that should be application-level into your containing application. Probably the simplest test to decide what is “application-level” is when you answer “yes” to either of the following questions:
      Does the code need to run when no documents are open?
      Does the code need to be able to run regardless of which document type is open?


  • You must be logged in to reply to this topic.

Lost Your Password?