My program runs on NT and uses a paradoxtable. It performes quite well
when I start it the normal way (ie starting the program by
doubleclicking it in the explorer), but when I start it from within
another program, using Winexec, it performes in the slowest way ever.
The database transactions takes 10 times as long to perform.
Why is that and what is the cure?
If the cure is using CreateProcess instead, please give me the code for
it. I have tried CreateProcess, but I can't make i work.
Thanks in advance
Hoffa
Davie
Use either ShellExecute or the WIN32 API CreateProcess.
This is not true. WinExec is still present in Win2000, although it has
been depreciated by Microsoft.
> Use either ShellExecute or the WIN32 API CreateProcess.
I do agree that these two functions are better choices, though.
-Craig
--
Craig Stuntz Vertex Systems Corporation
Senior Developer http://www.vertexsoftware.com
Craig Stuntz wrote:
> dirk wrote:
> >
> > Do not use WinExec!
> > It's only implemented for 16 bit applications (Windows 3.x)
>
> This is not true. WinExec is still present in Win2000, although it has
> been depreciated by Microsoft.
>
And they even say that it is only there for 'backwards Compatability'. No need to
use it in a 32 bit application....
>
> > Use either ShellExecute or the WIN32 API CreateProcess.
>
> I do agree that these two functions are better choices, though.
And they are 32 bit in nature.
That is what the word "depreciated" means, isn't it?
Craig Stuntz wrote:
> Topprolmc wrote:
> >
> > Craig Stuntz wrote:
> >
> > > This is not true. WinExec is still present in Win2000, although it has
> > > been depreciated by Microsoft.
> >
> > And they even say that it is only there for 'backwards Compatability'.
>
> That is what the word "depreciated" means, isn't it?
No. It means the following:
de·pre·ci·ate (d-prsh-t)
v. de·pre·ci·at·ed, de·pre·ci·at·ing, de·pre·ci·ates.
v. tr.
1.To lessen the price or value of.
2.To think or speak of as being of little worth; belittle. See Synonyms at
deprecate.
v. intr.
To diminish in price or value.
The exact wording in the SDK from M$ is :
"Remarks
Win32-based applications should use the CreateProcess function rather than this
function. The WinExec function exists in Win32 to provide compatibility with earlier
versions of Windows. For more information about how the WinExec function is
implemented, see the Remarks section of the LoadModule function."
Todd Frankson
www.compunetresources.com
Get serious. You use the dictionary for computer terms? By your
standards we shouldn't use "automation" or "exceptions" either.
"Depreciated" is the normal term for this. Please note a more
appropriate reference:
http://www.netmeg.net/jargon/terms/d.html#deprecated
-Craig, exiting this thread, which benefits nobody...
--
Jason Wallace
SL Software
Home: Dar...@SLSoftware.reno.nv.us
Work: Jason_...@Intuit.com
"Craig Stuntz" <cstuntz@no_spam.vertexsoftware.com> wrote in message
news:393E8888.C7DA2882@no_spam.vertexsoftware.com...
>
> Topprolmc wrote:
> >
> > Craig Stuntz wrote:
> >
> > > This is not true. WinExec is still present in Win2000,
although it has
> > > been depreciated by Microsoft.
> >
> > And they even say that it is only there for 'backwards Compatability'.
>
> That is what the word "depreciated" means, isn't it?
>
> -Craig
Didn't you even notice the difference in spelling? (By the way, "deprecated"
is what MS probably did to the API call.)
Graham
"Craig Stuntz" <cstuntz@no_spam.vertexsoftware.com> wrote in message
news:393EA3A3.EBDB3BC8@no_spam.vertexsoftware.com...
>
> Topprolmc wrote:
> >
> > > That is what the word "depreciated" means, isn't it?
> > No. It means the following:
> >
> > de·pre·ci·ate (d-prsh-t)
>
> Get serious. You use the dictionary for computer terms? By your
> standards we shouldn't use "automation" or "exceptions" either.
> "Depreciated" is the normal term for this. Please note a more
> appropriate reference:
>
> http://www.netmeg.net/jargon/terms/d.html#deprecated
>
> -Craig, exiting this thread, which benefits nobody...
>
Nope.
All of this has nothing to do with the original point.
-Craig
procedure ExecNewProcess(ProgramName : String);
var
StartInfo : TStartupInfo;
ProcInfo : TProcessInformation;
CreateOK : Boolean;
begin
{ fill with known state }
FillChar(StartInfo,SizeOf(TStartupInfo),#0);
FillChar(ProcInfo,SizeOf(TProcessInformation),#0);
with StartInfo do begin
// dwFlags := STARTF_USESHOWWINDOW;
// wShowWindow :=SW_HIDE;
cb := SizeOf(TStartupInfo);
end;
CreateOK := CreateProcess(nil, PChar(ProgramName), nil, nil,False,
CREATE_NEW_PROCESS_GROUP+NORMAL_PRIORITY_CLASS,
nil, nil, StartInfo, ProcInfo);
{ check to see if successful }
if CreateOK then
//may or may not be needed. Usually wait for child processes
WaitForSingleObject(ProcInfo.hProcess, INFINITE);
end;
Anders Hofstedt wrote:
>If the cure is using CreateProcess instead, please give me the
>code for it. I have tried CreateProcess, but I can't make it
>work.
Try inserting random extra letters in your code --you'll see what the
compiler thinks of that kind of fuzziness. We all live by the precision with
which we wield our tools (words): that's why we're all "anal".
Daniel U. Thibault
a.k.a. Urhixidur
a.k.a. Sire Bohémond de Nicée
Sent via Deja.com http://www.deja.com/
Before you buy.