This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal


Sep 8, 2014, 4:23 PM
21 Posts

Illegla Circular USE: Win32 Apis

  • Category: Notes Client
  • Platform: Windows
  • Release: 9.0.1
  • Role: Developer
  • Tags:
  • Replies: 2

Hi,

I have been working on an agent in which I am using win 32 apis in a process to build an Outlook email on the fly and making use of the keyboard events etc ...

ie,

keybd_event 17, 0, 0, 0 ' CTRL key down
keybd_event Asc ( "(End)" ), 0, 0, 0 ' End Key down
keybd_event Asc ( "(End)" ), 0, 2, 0 ' End Key up
keybd_event Asc ( "V" ), 0, 0, 0 ' V key down ( Paste )
keybd_event Asc ( "V" ), 0, 2, 0 ' V key up
   
Sleep (1)
 
keybd_event vKHome , 0, KeyDown, 0 ' Home key down
keybd_event vKHome , 0, KeyUp, 0 ' Home key up
keybd_event 17, 0, 2, 0 ' CTRL key up

I  have added 'Use "Win32 Apis"' into Options of the agent.

I also have LSConst here but don't believe that would affect anything.

And I have 'Const VKHOME = &H24' also declared as I don't know what the Asc option is for 'Home'. Hence the mix of code. "(Home)" doesn't work.  

Agent works a treat on my DEV server.

I run the same agent on one of our live servers and get the error stated in the subject of this post.

Am a bit perplexed so can anyone throw any light onto my issue at all .. ?

I am continuing to Google but am drawing a blank so far .. !

Many thanks in advance.

Andy

 

Sep 8, 2014, 4:52 PM
107 Posts
Guessing
Well, this is kind of a shot in the dark, since we don't know much about the "Win32 Apis" LotusScript library you are using.

My best guess is that the LS library contains statements of the kind
    Declare Function xxx Lib "yyy"
where yyy is the name of a Win32 API dll. Given that your code  executes fine on your DEV server, but not on a production server, then most likely either the required dll is not present on the production server, or the agent signer (probably yourself) does not have sufficient privileges to run "unrestricted methods and operations" on the production server. Those privileges are needed whenever LotusScript code tries to access the file system directly, which is the case when Win32 API calls are executed. The privileges are assigned through the relevant server document in the Domino Directory; see tab 'Security', section 'Programmability restrictions'.

Other things to check:
Is the production server the same Windows version as your dev server?
Do both servers have the same architecture (aka. bitness)?
Sep 9, 2014, 8:53 AM
21 Posts
Whoops ....

Hi Jochen,

Many thanks for the reply.

Had a look on server and all the same and permissions are OK.

Of course it does help if I copy over the Win32 APIs script library as well as my agent ..!!

All working as expected now I've done that.

I just copied the agent over and ran it. When I checked the agent itself, the Use statement was throwing the error, which pointed me towards the script library.

Apologies for wasting your time. Schoolboy oversight on my part.

Andy


This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal