Discussions related to Visual Prolog
danPerraud
Posts: 9
Joined: 13 Feb 2024 9:17

Migration vp 8 to vp 11, createProcess retired entity

Unread post by danPerraud »

Here is my problem:
in my version 8 project, I have this command:
vpi::createProcess(NullWin, Cde, Param, vpidomains::wsf_Minimized)

When compiling, there is this error.
"error c304: Retired entity 'vpi::createProcess/4->': Use useExe instead"

or if I indicate useExe, the compiler tells me that the useExe command is unknown

What should I replace my 'createProcess' command with?

Thank you for your help.
User avatar
Thomas Linder Puls
VIP Member
Posts: 1401
Joined: 28 Feb 2000 0:01

Re: Migration vp 8 to vp 11, createProcess retired entity

Unread post by Thomas Linder Puls »

useExe is a class. Here is a simple usage:

Code: Select all

clauses     run() :-         Program = "theProgram.exe",         Exe = useExe::new(Program),         Exe:run(),         Exe:wait(),         stdio::writef("% terminated (%x08)", Program, Exe:exitCode).
Regards Thomas Linder Puls
PDC
danPerraud
Posts: 9
Joined: 13 Feb 2024 9:17

Re: Migration vp 8 to vp 11, createProcess retired entity

Unread post by danPerraud »

ok perfect thank you.
but should we not free the object or close it with exe:close() or something else?
User avatar
Thomas Linder Puls
VIP Member
Posts: 1401
Joined: 28 Feb 2000 0:01

Re: Migration vp 8 to vp 11, createProcess retired entity

Unread post by Thomas Linder Puls »

Yes, it is a good idea to close the useExe object when you are done with it.

(But strictly speaking it is not necessary because the useExe objects have a finalize predicate that will close them).
Regards Thomas Linder Puls
PDC
Post Reply