1
Answer

Calling method of another dll of interface

Photo of Mrudul Ganpule

Mrudul Ganpule

10y
763
1
In my code , extern alias OnlineQBO is my alias of DevDefined.OAuth.dll, i have second dll is XeroApi.dll
whenever my following line of code is executes , conReq object creating by the DevDefined.OAuth.dll , but object call the Get() method of XeroApi.dll , so error ocuring as An explicit conversion exists(are you missing a cast?)

OnlineQBO::DevDefined.OAuth.Consumer.IConsumerRequest conReq = oSession.Request();
 conReq = conReq.Get();

Can you suggest any anwser please?

Answers (1)

0
Photo of dominic scanlan
NA 2 0 15y

Process
p = Process.GetCurrentProcess();
int i = p.Id;
0
Photo of Lalit M
NA 6.7k 48k 15y
use this code sample to get PID

using System.Diagnostics;
private void GetProcessStatus()
{
try
{
//If you know the name of the process
Process[] myProcesses = Process.GetProcessesByName("mspaint");
//If you know the PID of the process use the commented line below
//Process[] myProcesses = Process.GetProcessById("2341");
//Check to see if the process array length is greater than 0
if(myProcesses.Length > 0)
{
MessageBox.Show("The Process Microsoft Paint(mspaint) is currently running.", "Process Status", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
else
{
MessageBox.Show("The Process Microsoft Paint(mspaint) is currently NOT running.", "Process Status", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
catch(Exception ex)
{
MessageBox.Show("An Exception Occoured: " + ex.Message, "Process Status", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}


check also