Welcome to the SRP Forum! Please refer to the SRP Forum FAQ post if you have any questions regarding how the forum works.
How to test methods of COM control in OpenInsight platform
Hello,
I've developed one COM control in .Net and the Prog ID is "ProgIDClassLibrary.TestCOM" and my application has one method with name Test() (sample method) which returns "Hello" as a popup. My control has come to the open insight interface by entering Prog ID in the text column in the form designer window. Please provide me the steps to test my procedure Test() in open-insight platform.
My sample method:
void Test()
{
MessageBox.Show("Hello");
}
Please provide the steps to call the above method from Open Insight platform.
User: Babu
I've developed one COM control in .Net and the Prog ID is "ProgIDClassLibrary.TestCOM" and my application has one method with name Test() (sample method) which returns "Hello" as a popup. My control has come to the open insight interface by entering Prog ID in the text column in the form designer window. Please provide me the steps to test my procedure Test() in open-insight platform.
My sample method:
void Test()
{
MessageBox.Show("Hello");
}
Please provide the steps to call the above method from Open Insight platform.
User: Babu
Comments
What version of OpenInsight are you using?
User: Babu
Then try this:
Obj = OleCreateInstance("ProgIDClassLibrary.TestCOM") Result = OleCallMethod(Obj, "Test")
Please find the steps what I've done:
Please suggest me the steps, where I should write the above code given by you
Please assist me on where should I write the lines to test the method "Test"
User: Babu
Anyway, is your COM object meant to be a visible control, like ActiveX or is it meant to be just a OLE object that you can talk to via an API?
User: Babu
I assume, then, that after you put your Prog ID in the Text field on the Form Designer that you can see the control on your form. Correct? If so, then the way you communicate with your control will be different than what I originally suggested. In this case, you need to do something like this:
Ctrl = @Window : ".MY_OLE_CONTROL" rv = Send_Message(Ctrl, "OLE.Test")
Obviously you need to change MY_OLE_CONTROL with the name you used in your form. The code I posted would go somewhere easy for you to execute, like the CLICK event handler of a push button control.I tried to type this code in the Edit Events, but it is not showing my method output.
User: Babu
I don't know what you mean by "Edit Events". I suggested you put it in the CLICK event handler of a push button control. Is that what you are trying to do? Does the code even execute? For instance, if you add a debug statement do you get the debugger to appear?
Thanks for the post and now I'm able to test my method. Suppose if I enter value in editline or editbox, how could I retrieve in another editline or to some string. Also, can I know the method to deploy my developed .Net COM control in remote/target computers.
Getting the property of a control follows this syntax:
Value = Get_Property(ControlName, PropertyName)
So, an example of what you are trying to do would look like this:
Text = Get_Property(@Window : ".EDITLINE", "TEXT")
I am not sure what you need to know regarding deploying your control. This would be different than deploying any control for any software.I've developed COM control in .net using visual studio 2008. I've successfully integrated with OpenInsight platform and now would like to deploy my COM control in target computers so that they can use it. Please suggest me the steps in deploying the COM control.
User: Babu
Like I said, you would deploy as you would for any other environment. This is a .DLL or .OCX file, is it not?
I've .dll and .tlb files. After I created the setup project and installed the setup in the target computer, the control doesn't show in openinsight after I entered the ProgID in the text field. While this is going correctly in the development machine, I would like the same to happen when the same ProgID is entered in the target computers to get my control.
User: Babu
I have some ideas about this (like is the control registered on the target machine) but this topic has extended beyond normal OpenInsight help and tips. In my opinion we are delving into the world of consulting, which is how we earn our living. Please contact us directly if you would like some direct assistance with this.
User: Babu