Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 5 of 5
  1. #1
    Join Date
    Mar 2004
    Location
    Portugal
    Posts
    7

    Need Help with code

    Hi everyone,

    I'm developing a CD with a presentation in AutoPlay. As there are 3 different types of screens in the market, I developed 2 different presentations for 800x600 and 1024x768. These two are full screened. Less than 800x600 it will ask the user to change the screen def, any thing bigger will use a kiosk window.

    The problem is that I have to create a Master Project that gets the System.GetDisplayInfo() and then should start (or not if it's less than 800x600) one of the presentations.

    The part of the code that should do this is placed in the ontime action (Just to give some time for the user to read a message saying that we're finding out what is the screen def) and is as follows (disregard the Portuguese language )

    Page.StartTimer(500);
    -- Get the user's display information.
    display = System.GetDisplayInfo();

    if (display ~= nil) then
    -- If the user's running less than 800 x 600, display a dialog.
    if (display.Height < 600) then
    Dialog.Message("Informação", " Lamentamos, mas a sua resolução está definida para "..display.Width.." x "..display.Height..".\r\n"..
    "tem de ajustar a definição a um minimo de 800 por 600 para poder visualizar esta aplicação.", MB_OK, MB_ICONINFORMATION);
    elseif (display.Height < 1100) then
    File.Open("C:\Documents and Settings\User\Os meus documentos\AutoPlay Media Studio 5.0 Projects\BpEurope800x600\CD_Root\autoplay", "", SW_SHOWNORMAL);
    else File.Open("C:\Documents and Settings\User\Os meus documentos\AutoPlay Media Studio 5.0 Projects\BpEurope1024x768\CD_Root\autoplay", "", SW_SHOWNORMAL);

    end
    end

    Page.StopTimer();
    Application.Exit();

    The problem is that this does not open the AM5 autostart file as I wanted it to.

    What am I doing wrong?

    I get no error message. Just does nothing at all. (except display = System.GetDisplayInfo(); this one it does).

    I can't think anymore.

    Can anyone give me a hand please?

    Thanks

    Pampas

  2. #2
    Join Date
    Jul 2002
    Location
    USA
    Posts
    3,959
    In your file paths, you need to double up on the backslashes

    Code:
    File.Open("C:\\Documents and Settings\\User\\Os meus documentos\\AutoPlay Media Studio 5.0 Projects\\BpEurope800x600\\CD_Root\\autoplay", "", SW_SHOWNORMAL); 
    else File.Open("C:\\Documents and Settings\\User\\Os meus documentos\\AutoPlay Media Studio 5.0 Projects\\BpEurope1024x768\\CD_Root\\autoplay", "", SW_SHOWNORMAL);

  3. #3
    Join Date
    Mar 2004
    Location
    Portugal
    Posts
    7

    Double up on the backslashes

    Tks Worm but it didnt't work. I mean, nothing still happens. Having 1 or 2 backslashes dosen't seem to have any diference. Basically I seem to be getting now where after I get display = System.GetDisplayInfo();.

    Display gets the correct info from system, but then dosent open the AM5 autorun.

    Do you know if I should use a file.open or a file.run?

    Tks

    Pampas

  4. #4
    Join Date
    Jul 2002
    Location
    USA
    Posts
    3,959
    I would use File.Run and you need to double the backslashes in a Path . Be sure to use the whole file name too, i.e. autorun.exe

    "C:\test\folder\here"
    would be
    "C:\\test\\folder\\here"

    Other than that, make sure your paths are correct. You probably will eventually want to use the _SourceFolder variable instead of a static path.

  5. #5
    Join Date
    Mar 2004
    Location
    Portugal
    Posts
    7
    Thanks Worm. Will try that.

    Pampas

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts