This is the code I want to run. This works perfectly in my standalone (.NET 2.0) program:
I get these errors in the debugging window:
All the types are missing. And what is going on with "Writeline"?
EDIT: I must be doing something wrong. But what?!?
The sample scripts works...
Code:
'#IMPORT System.Runtime.InteropServices '<DllImport("user32.dll")> _ Private Declare Sub mouse_event Lib "user32.dll" (ByVal dwFlags As Long, ByVal dx As Long, ByVal dy As Long, ByVal dwData As Long, ByVal dwExtraInfo As IntPtr) Sub Main(ByVal param As Object) Dim params() As String = param.ToString().Split("|") GenerateMouseClick(params(0), params(1), params(2)) End Sub Private Sub GenerateMouseClick(ByVal x As Integer, ByVal y As Integer, Optional ByVal mouseclicks As Integer = 2, Optional ByVal return_mouse As Boolean = True) Try If mouseclicks < 1 OrElse mouseclicks > 3 Then hs.Writeline("MouseClick", "Only 1, 2 or 3 mouse clicks are allowed") Exit Sub End If Dim pointOldPosition As Point = Windows.Forms.Cursor.Position Windows.Forms.Cursor.Position = New Point(x, y) For i As Integer = 1 To mouseclicks mouse_event(MouseEventLeftDown, 0, 0, 0, New System.IntPtr()) mouse_event(MouseEventLeftUp, 0, 0, 0, New System.IntPtr()) Next If return_mouse Then Windows.Forms.Cursor.Position = pointOldPosition Catch ex As Exception hs.Writeline("MouseClick", "Error occured. Sorry about that..." & ControlChars.NewLine & ControlChars.NewLine & ex.ToString) End Try End Sub
I get these errors in the debugging window:
09:47:01 Executing script: remote_mouseclick.vb
09:47:01 Compile Error : Scripts\remote_mouseclick.vb : CompilerError[s] :
line:15 error:BC30456 ''Writeline' is not a member of 'Scheduler.hsapplication'.'
line:19 error:BC30002 'Type 'Point' is not defined.'
line:20 error:BC30451 'Name 'Windows' is not declared.'
line:20 error:BC30002 'Type 'Point' is not defined.'
line:23 error:BC30451 'Name 'MouseEventLeftDown' is not declared.'
line:24 error:BC30451 'Name 'MouseEventLeftUp' is not declared.'
line:27 error:BC30451 'Name 'Windows' is not declared.'
line:29 error:BC30456 ''Writeline' is not a member of 'Scheduler.hsapplication'.'
line:29 error:BC30451 'Name 'ControlChars' is not declared.'
line:29 error:BC30451 'Name 'ControlChars' is not declared.'
09:47:01 Compile Error : Scripts\remote_mouseclick.vb : CompilerError[s] :
line:15 error:BC30456 ''Writeline' is not a member of 'Scheduler.hsapplication'.'
line:19 error:BC30002 'Type 'Point' is not defined.'
line:20 error:BC30451 'Name 'Windows' is not declared.'
line:20 error:BC30002 'Type 'Point' is not defined.'
line:23 error:BC30451 'Name 'MouseEventLeftDown' is not declared.'
line:24 error:BC30451 'Name 'MouseEventLeftUp' is not declared.'
line:27 error:BC30451 'Name 'Windows' is not declared.'
line:29 error:BC30456 ''Writeline' is not a member of 'Scheduler.hsapplication'.'
line:29 error:BC30451 'Name 'ControlChars' is not declared.'
line:29 error:BC30451 'Name 'ControlChars' is not declared.'
EDIT: I must be doing something wrong. But what?!?
The sample scripts works...
Comment