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 05 JUN 2003 02:44:21PM Wayne Shepard wrote:

This is silly: I my INET_ application, I call Utility("RUNWIN","C:\progname.exe"). Utility returns with no return value and the program does not run.

When I code a simple one-line program to test this strange anomaly, the call to Utility displays the error "The stored procedure can be executed in event-context only."

First question: Why do I have to be in event context to call my email program?

Second question: Why doesn't the error message display when I'm calling it from my INET_ module?

Third question: What's the workaround here? Create a window and execute it passing my mail as paramaters? Somewhere I ran across IMAP_ procedure(s) in the Works materials, but can't find it now with a search and I don't see anything in the documentation. Is there an IMAP_ procedure I can use instead?

Thanks, all.

Wayne


At 06 JUN 2003 04:01AM [url=http://www.sprezzatura.com]The Sprezzatura Group[/url] wrote:

Wayne

This is silly: I my INET_ application, I call Utility("RUNWIN","C:\progname.exe"). Utility returns with no return value and the program does not run.

Not so silly as it may sound. When your INET_ program executes under the control of your web-server it will be executing with whatever rights you've given an anonymous user. Does this user have sufficient security rights to be able to execute other programs?

When I code a simple one-line program to test this strange anomaly, the call to Utility displays the error "The stored procedure can be executed in event-context only." First question: Why do I have to be in event context to call my email program?

I suspect that much of the Utility function relies on the presentation server (OINSIGHT.EXE) to be the client exe that has made the call to the engine that is executing the program. The reason for this is that calls like Utility, and Get/Set_Property actually 'poke' data back at the client from the engine (via a req_info() call), so if they are made from an exe other than OINSIGHT (like the system editor, DWB.EXE) then it won't know how to respond to them properly.

To get around this call your program from the System Monitor window, which is part of the presentation server and therefore in event context.

Second question: Why doesn't the error message display when I'm calling it from my INET_ module?

Which error message? The Event Context one? That's specific to the System Editor and is not a generic error message so that's the only place you'll find it.

Third question: What's the workaround here? Create a window and execute it passing my mail as paramaters? Somewhere I ran across IMAP_ procedure(s) in the Works materials, but can't find it now with a search and I don't see anything in the documentation. Is there an IMAP_ procedure I can use instead?

Can't say I remember any IMAP_ stuff. If it's a simple exe you need to run check the user rights. You may also need to use the Windows API WinExec function rather than utility RUNWIN, as OECGI does not run in Event Context.

The Sprezzatura Group

World leaders in all things RevSoft


At 09 JUN 2003 02:56PM Wayne Shepard wrote:

Oops. I meant MAPI, not IMAP.

The anonymous user is set up for "Scripts and Executables" in IIS. Don't know where else to specify it.

Anyway, I'll use WinExec. And if that doesn't work, I have another workaround in line. Thanks.

Wayne


At 09 JUN 2003 05:07PM [url=http://www.sprezzatura.com]The Sprezzatura Group[/url] wrote:

Wayne,

The anonymous user is set up for "Scripts and Executables" in IIS. Don't know where else to specify it

That will only apply to programs in the web-server's cgi-bin/scripts directory. To allow access to other directories you'd actually have to go to the said directory/file and look at it's individual security settings and grant access there.

Be VERY careful when you do this as you don't want the Anonymous user getting too many rights on the system due to the security implications.

If you're using Simple MAPI (ie the kind supported in OI) you may also find that other security settings become involved due to MS's 'improved' email security in Outlook ;)

The Sprezzatura Group

World leaders in all things RevSoft


At 10 JUN 2003 08:26AM Bob Carten - Revtech Support wrote:

Wayne:

If you are running exchange server take a look at using CDONTS rather than outlook.

You can script it too, and pass in specific user id and password.

HTH

Bob


At 20 JUN 2003 05:04PM Wayne Shepard wrote:

Bob,

We're sort of stuck on that one. Some of our people use Exchange, others use Outlook. So we have an in-house-written routine that accepts command line parameters and determines which program the user is using. Then it uses the appropriate connections to send the mail. Works fine, except when called from an Inet application.

Wayne

View this thread on the Works forum...

  • third_party_content/community/commentary/forums_works/242dd93c9d4232a685256d3c0066f040.txt
  • Last modified: 2023/12/30 11:57
  • by 127.0.0.1