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

Comments

  • Babu,

    What version of OpenInsight are you using?
  • OpenInsight - 9.4.0 (Evaluation version)

    User: Babu
  • Babu,

    Then try this:
    Obj = OleCreateInstance("ProgIDClassLibrary.TestCOM") Result = OleCallMethod(Obj, "Test")
  • I'm very new to OpenInsight platform. Could you please give me the steps so that I can replicate.
    Please find the steps what I've done:
    1. Opened Forms Designer Window, selected new form - put one OLE-Interface on to it and entered ProgID in the "text" field.
    2. I got the control now into the interface.

    Please suggest me the steps, where I should write the above code given by you
  • Hello Don,

    Please assist me on where should I write the lines to test the method "Test"

    User: Babu
  • I'm very new to OpenInsight platform. Could you please give me the steps so that I can replicate.
    Please find the steps what I've done:
    1. Opened Forms Designer Window, selected new form - put one OLE-Interface on to it and entered ProgID in the "text" field.
    2. I got the control now into the interface.
    Working with COM and OpenInsight is normally an advanced topic. If you are new to OpenInsight then you will struggle without some fundamental training.

    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?
  • My control is visible. It is just a pictorial representation. I need now to call the method "Test" which just returns a string value.

    User: Babu
  • 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.
  • Hi Don,

    I tried to type this code in the Edit Events, but it is not showing my method output.

    User: Babu
  • 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?
  • Don,

    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.
  • Babu,

    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.
  • Hi Don,

    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
  • Babu,

    Like I said, you would deploy as you would for any other environment. This is a .DLL or .OCX file, is it not?
  • Don,

    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
  • 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.
  • Thanks Don. I will get back to you if i require anything in OpenInsight. Once again thanks

    User: Babu
Sign In or Register to comment.