Hi Franco,

Of all our communication I believe this is the first on Lingo-L. Thanks
for your reply.

Yes, baShell() and baRunProgram() provide status values, but nothing in
terms of the external app's return values. Gary told me he doesn't
believe it's possible in Windows (maybe in DOS).

> after WinMain() ends with all operations needed to create the 
> new instance, it enters the loop of the so said message pump

My exernal app has no message pump; it exits immediately, printing its
results to a console window. It's just doing some work that I can't do
within Director: reading MP2 headers & calculating some file properties.
Actually I may be able to do this with BinaryIO Xtra, now that I think
of it. Anyway, that's the data that I want to use in Director.

> BTW, if you find a solution, please let me know.

I solved this issue using MSVC.  I revised the app to dump its data to
an external file instead of to the console. Then Lingo reads & parses
the file. I've wrapped it into a method that returns what I need:

on mGetFrames( me, strMpeg2File )
  -- 1) Verify the video is there
  -- 2) Call the console app
  res = baShell( "open", exe, args, "","hidden" )
  -- 3) Verify the exe has writen its data to a file
  -- 4) Read & parse the file with FileIO
  lsMp2Data = [ #duration:dur, #framerate:fr ]
  -- 5) return the data I wanted in the first place
  return lsMp2Data.duration * lsMp2Data.framerate
end

It's more convoluted than I'd like, but it does the job. It eliminates
the overhead of using something like OnStage or DirectMedia Xtras to get
MPEG data (fine products though they are).

Best,
Rob

/*********************************
* Rob Wingate, Software Human    *
* http://www.vingage.com         *
* mailto:[EMAIL PROTECTED] *
*********************************/

[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/lingo-l.cgi  To post messages to the list,
email [EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED])
Lingo-L is for learning and helping with programming Lingo.  Thanks!]

Reply via email to