Welcome to ModelRight Sign in | Join | Help
in

ModelRight 3 automation problem/bug?

Last post 07-10-2008, 1:24 PM by gwideman. 22 replies.
Page 2 of 2 (23 items)   < Previous 1 2
Sort Posts: Previous Next
  •  07-08-2008, 10:29 PM 716 in reply to 714

    Re: MR 3044 automation: SCF "success"

    Wow.  Congratulations!  We spent all day trying to figure out why it wasnt working - with no luck.  This should at least give us more clues to pursue.  Thanks!
    Scott Reynolds
    Senior Technical Support
    ModelRight, Inc.
  •  07-08-2008, 10:45 PM 717 in reply to 713

    Re: MR 3044 automation: SCF test report WITH Initialize

    Attachment: microsft_dlls.zip
    Hmmm.  Thought I had posted a zip with all those files.  Here it is again in case it makes a difference - which I doubt - cause it doesnt seem to help on my machine.
    Scott Reynolds
    Senior Technical Support
    ModelRight, Inc.
  •  07-09-2008, 4:06 AM 719 in reply to 717

    Here's a test client program for MR automation

    Hi Scott and modelright:

    Scott's zip with MS dlls -- yeah but, aren't they supposed to be installed properly at some expected location? For me, these duplicate the ones installed by the downloaded installer from MS, so I think I'm covered.
     
    Anyhow, corroborating previous observations, turns out that if the client program calling SCF.dll is placed in the MR home directory, then things work, but take the same client and locate in some other directory -- no dice.

    That's a difficult experiment to do with VBA hosts like Excel, but my Delphi demo which is a minimal stand-alone executable (except for SCF!), is readily able to do this, and indeed demos this issue.

    I wanted to send you this demo client in an attachment, but your site is limited to 64k upload, so, it's here:

    http://grahamwideman.com/gw/misc/modelright/index.htm

    Unzip and place the exe anywhere to run (no install necessary).  I suggest start with it in the MR executable directory.  Running it opens a form with a button. Press button to exercise interaction with SCF, producing output messages showing progress through calls to SCF.

    Also in the zip is the source code (Delphi 6, but probably OK with more recent versions).  The salient part is in file MRTest_fm_Main.pas, procedure TForm1.bt_BeginClick()  ... which closely parallels the Help file Script Language API Reference demo, similar to earlier in this discussion thread.

    Results I see: Running from MR home dir, works. Run exe from elsewhere, breaks executing:
    Unk    := MRO.Children('Table')

    Capturing FileMon output was the most helpful diagnostic for me, especially while single-stepping. Since you probably don't have a Delphi environment on hand to try the single stepping, I arranged the app itself to execute the statements one at a time, waiting for user before each one.

    Don't know if this will be a great help, but it was pretty useful for me.

    Graham

     

    Filed under: , , ,
  •  07-09-2008, 6:27 AM 720 in reply to 714

    Re: MR 3044 automation: SCF "success"

    Quick note:  you can send us larger files by emailing [email protected]
    Scott Reynolds
    Senior Technical Support
    ModelRight, Inc.
  •  07-10-2008, 12:30 PM 735 in reply to 720

    Re: MR 3044 automation: SCF "success"

    Graham,

    If you add the ModelRight 3 install folder to the OS path ($PATH envirment variable) then you can run a script from anywhere. We will hopefully do that as part of the install procedure.

    Hope it helps. 

     


    ModelRight Evangelist
  •  07-10-2008, 12:58 PM 736 in reply to 735

    Re: MR 3044 automation: SCF "success"

    PATH variable!  That's so '90's!

    Sounds like it works, but if it was my DLL I'd be wanting to avoid messing with PATH, especially in connection with uninstalls, reinstalls to different directory, etc. Uggg.

    If the hitch is to do with SCF.dll finding other depended-upon dll's in the MR directory, then I'm guessing the issue is that it's attempting to load them relative to the executable's directory instead of relative to SCF.dll's directory -- and these diverge for automation clients. 

    Your code can find out the path of that dll, either from the registry (since SCF is registered for automation) or more robustly using Windows API GetModuleFileName (which can be used to get either the path of the executable, or of a specific module aka dll).

    Graham

  •  07-10-2008, 1:13 PM 737 in reply to 736

    Re: MR 3044 automation: SCF "success"

    Yes, it should work in reg-free side by side config.  Its difficult to figure out why it has problems cause the MS error messages are so meaningless.  So, you could try adding it to the path, or registering the full path name of scf.dll - just to see if either makes a difference.  I still cant get the old sample javascript inside html example to work.
    Scott Reynolds
    Senior Technical Support
    ModelRight, Inc.
  •  07-10-2008, 1:24 PM 738 in reply to 737

    Re: MR 3044 automation: SCF "success"

    Hi Scott:

    You're probably familiar with this already, but in case not -- I found that the most useful diagnostic tool on this is trusty old FileMon (or the more recent Process Monitor), as this shows you what files SCF is trying to find/load and what it's looking for when it gets stuck.

    http://technet.microsoft.com/en-us/sysinternals/bb896642.aspx

    Graham

Page 2 of 2 (23 items)   < Previous 1 2