Join The Works program to have access to the most current content, and to be able to ask questions and get answers from Revelation staff and the Revelation community

At 13 JUL 2021 12:25:07AM cmeyer wrote:

Is SHELEXECUTEA not being defined in OI10.0.8.1

Chris


At 13 JUL 2021 02:18AM Donald Bakke wrote:

Is SHELEXECUTEA not being defined in OI10.0.8.1

Chris

In this post, Carl explains that the Windows APIs have been name spaces with "MSWIN_". So, there is a MSWin_ShellExecute function but OI 10 does not include a ShellExecute function.

Don Bakke

SRP Computer Solutions, Inc.


At 13 JUL 2021 05:08AM Carl Pates wrote:

Hi Chris,

As Don mentioned we moved all of the raw Windows API function calls _we_ use into the "MSWIN_" namespace to try and bring them back under some sort of control. However, there is nothing to stop you re-prototyping SHELLEXECUTEA and using it in your own application if you wish.

Having said that, there are two "official" ways of using ShellExecute in v10:

If you have a desktop application (i.e in "event context" ) you can use the SYSTEM object's SHELLEXEC method:

   RetVal = Exec_Method( "SYSTEM", "SHELLEXEC", OwnerForm, Operation, File,  Parameters, WorkingDir, ShowCmd )

Otherwise you can use the RTI_ShellExecuteEx() stored procedure, which is a wrapper around the ShellExecuteEx Windows API function:

   RetVal = RTI_ShellExecuteEx( hwnd, operation, file, parameters, workingDir, showCmd, hProcess )

The latter takes an extra parameter which will return the handle of the new process. It also uses Set_Status() to return error details.

Regards,

Carl Pates


At 13 JUL 2021 07:56PM cmeyer wrote:

Is it possible to have RTI_ShellExecutetEx in OI9.4.6 so I can replace ALL my routines prior to another conversion. I am still developing in OI9.4.6. Does the routine end in "etEX" with the "t" or is this a spelling error.

Chris


At 13 JUL 2021 08:41PM Barry Stevens wrote:

Is it possible to have RTI_ShellExecutetEx in OI9.4.6 so I can replace ALL my routines prior to another conversion. I am still developing in OI9.4.6. Does the routine end in "etEX" with the "t" or is this a spelling error.

Chris

Maybe, in OI 10 do:

create sysprocs record DLL_PBC_SHELL32

with

PBC_SHELL32

HANDLE STDCALL ShellExecuteA( HANDLE, LPCHAR, LPCHAR, LPCHAR, LPCHAR, INT )

then do the declare_fcns


At 14 JUL 2021 04:40AM Carl Pates wrote:

Hi Chris,

That's a spelling mistake (now fixed), which I'm blaming on the small font size in the web-page editor here :)

I don't think it's likely to get ported back to v9 because there's other components that it uses that would need to make the journey too, and then it starts getting messy.

If I was in your position (and I have been) I would create a simple stored procedure for your application and in that use conditional compilation to call whichever version you need to.

e.g.

compile function pbc_ShellExecute( hwnd, verb, file, parameters, directory, nShow )



#ifdef REVENG64

   // Compiled in v10

   declare function rti_ShellExecuteEx

   return rti_ShellExecuteEx( hwnd, verb, file, parameters, directory, nShow, "" )

#endif

#ifndef REVENG64

   // Compiled in v9

   declare function ShellExecuteA

   return ShellExecuteA( hwnd, verb, file, parameters, directory, nShow )   

#endif

That way it will compile fine on your v9 system and when you migrate it to v10 it will compile the correct version there too.

Carl Pates


At 14 JUL 2021 04:59AM Carl Pates wrote:

Hi Barry,

Creating DLL Prototypes on v10 is handled differently than v9. You can still use the v9 method and it will work, but in v10 DLL Prototypes were moved into the product as full repository entities so there's a dedicated tool for creating them now rather than editing raw records.

To use it load the Create New Entity dialog and select "Dll Interfacing" and then "DLL Prototype Record". You should then see the "DLL Prototype Designer". (You can use Open Entity to see existing ones, like the MSWIN ones that we supply with the product - see MSWIN_SHELL32 DLL for the ShellExecute prototype for example).

You enter the DLL Name (which is the first line in the old "DLL_" record and some comments if you wish. The grid at the bottom is to enter the function details and there are options dialogs and dropdowns to help you enter the type information.

You can enter a value in the namespace box and click "apply namespace" and it will creating aliases for your functions prefixed with that namespace.

Once you're happy hit F9 to save and compile - this does the same job as the old declare_fcns routine and creates the DLL stubs the SYSOBJ.

Carl Pates


At 14 JUL 2021 07:56PM Barry Stevens wrote:

Hi Barry,

Creating DLL Prototypes on v10 is handled differently than v9. You can still use the v9 method and it will work, but in v10 DLL Prototypes were moved into the product as full repository entities so there's a dedicated tool for creating them now rather than editing raw records.

To use it load the Create New Entity dialog and select "Dll Interfacing" and then "DLL Prototype Record". You should then see the "DLL Prototype Designer". (You can use Open Entity to see existing ones, like the MSWIN ones that we supply with the product - see MSWIN_SHELL32 DLL for the ShellExecute prototype for example).

You enter the DLL Name (which is the first line in the old "DLL_" record and some comments if you wish. The grid at the bottom is to enter the function details and there are options dialogs and dropdowns to help you enter the type information.

You can enter a value in the namespace box and click "apply namespace" and it will creating aliases for your functions prefixed with that namespace.

Once you're happy hit F9 to save and compile - this does the same job as the old declare_fcns routine and creates the DLL stubs the SYSOBJ.

Carl Pates

Thanks Carl


At 15 JUL 2021 04:01AM cmeyer wrote:

Thanks Carl,

I have modified ALL 78 procedures from ShelexecuteA to pbc_shellexecute as per above.

Chris

View this thread on the Works forum...

  • third_party_content/community/commentary/forums_works/8c9a447ee57a9d4faaf4a89c71fc72e0.txt
  • Last modified: 2024/01/04 20:57
  • by 127.0.0.1