To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.cadOpen lugnet.cad in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 CAD / 12693
12692  |  12694
Subject: 
Re: LPub
Newsgroups: 
lugnet.cad
Date: 
Sat, 21 May 2005 17:02:17 GMT
Viewed: 
3257 times
  
In lugnet.cad, Travis Cobbs wrote:
> In lugnet.cad, Kevin L. Clague wrote:

<snip>
> > I just tested LDView and ldglite on windows 98.  ldglite worked just fine.
> > 
> > LDView does not work well.  In both cases I create a batch file with all the
> > things needed, and then do a CreateProcess in which to run them (using $COMSPEC
> > /C ldview.bat > ldview.out).
> > 
> > What happens is that LPub sees LDView as finished, before LDView actually
> > finishes.  LPub does not find the rendered image, and barfs.  When I examine the
> > Images directory (in computer time *much much* later) the image exists.
> > 
> > Does anyone have any ideas?
> 
> I'm not sure off-hand, but I believe that LDView behaves differently from
> ldglite since it doesn't have a console.  If you run LDView from the command
> line, LDView launches, and the command line immediately gets control back, even
> though LDView is still running.  If you run LDView with command line arguments
> to generate an image, the same thing happens.  I'm not sure what happens if you
> put LDView in a batch file (whether the batch file continues to run before
> LDView exits).
> 
> Note that I think all this behavior is directly related to the fact that LDView
> isn't a console application.  Does ldglite show a console when you run it?  (I
> seem to remember that it does.)
> 
> If LDView's non-consoleness is the problem, it should be fairly straightforward
> to create a small launcher console app that runs LDView with the given command
> line, and then waits for LDView to exit using Windows Process Control API calls.

Hi Travis,

  I used to do a CreateProcess on LDView (rather than the batch file) with the
same parameters as I provide in the batch file, and I get blank images.

  This is why I reverted to a bach file.  Here is the code that I use:

  STARTUPINFO         startupInfo;
  PROCESS_INFORMATION procInfo;

  startupInfo.cb               = sizeof (STARTUPINFO) ;
  startupInfo.lpReserved       = 0 ;
  startupInfo.lpDesktop        = NULL ;
  startupInfo.lpTitle          = NULL ;
  startupInfo.dwX              = 0 ;
  startupInfo.dwY              = 0 ;
  startupInfo.dwXSize          = 0 ;
  startupInfo.dwYSize          = 0 ;
  startupInfo.dwXCountChars    = 0 ;
  startupInfo.dwYCountChars    = 0 ;
  startupInfo.dwFillAttribute  = 0 ;
  startupInfo.dwFlags          = STARTF_USESHOWWINDOW;
  startupInfo.wShowWindow      = SW_MINIMIZE;
  startupInfo.cbReserved2      = 0 ;
  startupInfo.lpReserved2      = 0 ;

  // Create full path name of LDView

  AnsiString exec =
    renderer_paths->Strings[renderer_index] +
    "\\" +
    renderer_execs->Strings[renderer_index];

  // cmd string is all the parameters passed to LDView.

  if (CreateProcess(exec.c_str(),
                    cmd,
                    NULL,
                    NULL,
                    FALSE,
                    0,
                    NULL,
                    cwd.c_str(),
                    &startupInfo,
                    &procInfo) == FALSE) {

I know very little about this level of Windows, so any help would be greatly
appreciated.

> 
> --Travis

Kevin



Message has 2 Replies:
  Re: LPub
 
(...) Don't know if this is significant, but I usually put everything in the second argument, both the .exe name and the parameters. In this way even 16-bit programs can be started (and I think I've read about some program having problems when (...) (21 years ago, 21-May-05, to lugnet.cad)
  Re: LPub
 
(...) I commented on CreateProcess in another message. Here I just wanted to say, that explains why the console window keeps showing up in the windows taskbar. That should stop happening if CreateProcess is used to launch LDView. --Travis (21 years ago, 21-May-05, to lugnet.cad)

Message is in Reply To:
  Re: LPub
 
(...) I've seen the described problem when I select a file from the recent files list, and then try to render it. Everything works fine if I manually open the file, but it definitely fails if I select it from the recent files list after having (...) (21 years ago, 21-May-05, to lugnet.cad)

15 Messages in This Thread:





Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact

This Message and its Replies on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR