 |
SoftTree Technologies
Technical Support Forums
|
|
Author |
Message |
whornak
Joined: 21 Aug 2008 Posts: 10 Country: United States |
|
GetJobList not working in Visual Studio 2005 |
|
I am trying to execute the GetJobList or GetJobListEx using C# in Visual Studio 2005 to prove that the connection that I have established is truly connected and functional.
I have tried as many ways as I can think of and continue to get the following message:
"No method was found matching the name and argument list."
Below is the code that I am using based on examples found in the documentation.
Type tRemote24x7 = Type.GetTypeFromProgID("24x7 Remote Control");
object oRemote24x7 = Activator.CreateInstance(tRemote24x7);
Object[] oMethodArgs = { sUserName, sPassword, "Winsock", sHost, sPort, "", false };
Object oRtnValue = tRemote24x7.InvokeMember("OpenSession", System.Reflection.BindingFlags.InvokeMethod, null, oRemote24x7, oMethodArgs);
Object[] oJobListArgs = { sWorkString, false, "DISABLED,FOLDER_NAME" };
oRtnValue = tRemote24x7.InvokeMember("GetJobListEx", System.Reflection.BindingFlags.InvokeMethod, null, oRemote24x7, oJobListArgs);
Any help would be very much appreciated.
Thanks in advance.
|
|
Fri Sep 05, 2008 2:39 pm |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7949
|
|
|
|
I'm not C# expert, but I think the parameters specified for GetObjectListEx are incorrect. Note that the first parameter must be passed by reference, and not as a safe array copy.
That's why you get "No method was found matching the name and argument list" message, because method doesn't exit with the parameters that you are trying to pass.
For examples calling COM methods returning parameters ByRef, see http://msdn.microsoft.com/en-us/library/aa332512(VS.71).aspx Lots of examples can be also found on the web.
24x7 Also support a couple of interfaces that do not return values via Parameter references and use COM object instance variable for the returned data. Please see "Supported COM Interfaces" topic in the 24x7 COM Reference for more info.
|
|
Sun Sep 07, 2008 1:15 am |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|