Handling events of ActiveX controls in TestStand!rol

Hi,
I want to use the Microsoft WINSOCK control with existing ActiveX Automation Adapter of TestStand. These control generates an event in case of incomming data.
Question:
Is there any way to treat the events of such controls in TestStand (same problem with MSCOMM control) or can this only be realized by polling the size of incomming buffer?
In case of answer two, i would be interested in any realized example.
Regards,
Sunny

Hi Sunny,
Currently, you cannot call ActiveX controls using the ActiveX Automation Adapter in TestStand. To do this, you would need to call a code module that was set to display/utilize the control, and retrieve all of the events generated by the control. TestStand can only currently call ActiveX servers (either DLL or EXE) that support the IDispatch interface. Hope this answers your question.
Regards,
Bob

Similar Messages

  • Disable mouse events in ActiveX control

    Hi,
    I am using the Quicktime COM/ActiveX control for Windows from C# but want to change its default behaviour slightly.
    Currently when the mouse is pressed on the player control it pauses, resumes when double clicked or if already playing reverts to fullscreen mode.
    How can I disable this behaviour so that mouse clicks on the control do nothing?
    I can respond to mouse down events and intercept the message in WndProc but the control still seems to recieve the message before my application code.
    I get the feeling that I just need to change a property of the player, but which one?
    Thanks in advance for your help.
    James

    Mate, you are a total life saver!!!!!!!!!
    Thanks so much again.

  • How to handle events for Tab Control

    Hi,
    I have a Tab control with 4 tabs and I would like when I go to a specific tab all the contents of that tab being updated. Could you please help me with this?
    How should I set the event structure
    Thanks

    Tab Control->Value Change is the event you want.  You can then use a case structure to do whatever you need it to based on the "New Value".
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • Handling event for Tree Control Collapse

    Hi,
    Can any one suggest how to handle an event for 'Tree Node Collapse' . I have checked with all the exised tree events.
    thanks,
    Venu

    Hi Venugopal,
        If you are doing tree control programmin then i can suggest you a approach for tree node collapse and expand.
    for doing this follow these steps.
    1. create a toolbar (use class cl_gui_toolbar), add a button and assign a FCODE to it.
    2. here you register the following the event for the toolbar.
    gs_event-eventid = cl_gui_toolbar=>m_id_function_selected.
    3. here you set the handler for the toolbar events
      SET HANDLER  gref_application->handle_function_selected
                FOR  gref_toolbar.
    4. now in your class for gref_application you write a definition and implementation.
    definition
    handle_function_selected FOR EVENT handle_function_selected OF cl_gui_toolbar IMPORTING fcode.
    implementation
    CASE fcode.
       when 'collapse'.
          CALL METHOD xref_tree->collapse_all_nodes.
    this method might change depending upon the class you use for creating the tree.
    i hope this will help you.
    in case of clarification do get back to me.
    regards,
    Kinshuk Saxena
    PS mark helpful answers

  • Using ActiveX controls in GUI application, which uses TestStand API

    When using ActiveX controls in TestStand Operator Interface GUI,
    CVI reports User Interface Library error no.-143:
    "ActiveX control Error" on attempt to load panel, which contains ActiveX controls.
    The same code, which takes care of user interface, but not references
    TestStand ActiveX API (i.e. not creates TS Engine), works properly.
    What's wrong?

    Hello again Misha,
    Sorry about my previous answer, I overlooked the fact that you were saying this error was caused by placing ActiveX controls in your Operator Interface (OI) GUI (as my example shows I thought the problem was with GUIs displayed from step code modules).
    Nevertheless, the problem is still being caused by the same issue, and is solved in a similar fashion. The source for the CVI OI initializes the TestStand engine before it loads/displays the UI panels. The calls to initialize the engine seem to be CoInitializing the main GUI thread as multithreaded apartment (MTA) mode whereas you will need it to be single threaded apartment (STA) mode in order for the ActiveX control container to work properly. The TestStand engine is compatible with either modes, but only one can be in place at a given time. If we CoInitialize the OI's main GUI thread as STA this will solve the problem (the subsequent attempts of setting it to MTA will fail, but again this is ok since the engine is compatible with STA).
    In order to perform this functionality you will need to put a call to CoInitializeEx in the main function of the CVI OI source (this will also require that you #include the "windows.h" file at the top of the source also). Here is what the main function in your main.c file for the CVI OI will look like once you have done this:
    int main(int argc, char **argv)
    int retval = -1;
    sArgc = argc;
    sArgv = argv;
    if(InitCVIRTE(0, argv, 0) == 0) /* Initialize CVI libraries */
    goto Done; /* out of memory */
    // Intialize main GUI thread as STA to prevent other attempt to make it
    // MTA, which will not allow ActiveX controls to be used.
    CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
    /* initialize the test engine */
    if(!InitEngine())
    goto Done;
    if(!InitErrorDialogStrings())
    goto Done;
    if(!InStandaloneExecutable() && !DisplayRunningInEnvironmentWarning())
    goto Done; // get out now
    if(!ProcessPreLoginCmdlineArgs())
    goto Done;
    if(!CfgFile_Load())
    goto Done;
    if(!CfgFile_RestoreOptionSettings())
    goto Done;
    if(LoadGUIPanels() < 0)
    goto Done;
    if(!InitFileQuickList())
    goto Done;
    /* set initial gui state */
    if(!InitGUI())
    goto Done;
    RunUserInterface();
    retval = 0; /* normal exist status */
    Done:
    /* cleanup */
    SeqFileList_DeleteAllSequenceFileRecords();
    ExeList_DeleteAllRecords();
    IconList_DeleteIconList();
    SaveAndCleanupFileQuickList();
    CfgFile_SaveOptionSettings();
    CfgFile_WriteAndCleanupForExit();
    AdaptList_DeleteAdapterList();
    DestroyToolMenus();
    CloseEngine();
    FreeErrorDialogStrings();
    return retval;
    Note: Remember to #include "windows.h" at the very top of the main.c file and to include ole32.lib in your project file list in order to link in the definition for CoInitializeEx.
    Jason F.
    Applications Engineer
    National Instruments
    www.ni.com/ask

  • How Use ActiveX Control Item!

    Please Let me know how use OCX Control with ActiveX Control Item in forms6i,
    and send me Sample code(*.fmb).
    Especially, I want to know how handle 'Event' of OCX Control in forms 6i.
    When use VBasic, code is descibed in 'Event' of OCX Control, and then how handle 'Event' of OCX Control in forms 6i.
    return to mail - [email protected]

    I think that if you use an activeX container, property and invoke nodes will work for the document/file or whatever you have in it, so I recommed you to use references to the file you want to use, open an activeX reference in the block diagram, and pass this reference to open, write, save and exit. This can be done easyly using the invoke and property nodes you already know... If not, check for errors between them, sometimes one error makes the rest of the code not to work... Hope this helps.
    If you want me to check the program, you can send an example here, but be sure it's LV 5.0, I've nor 5.1 nor 6.0, it can be a way of knowing the problem.

  • Setting up and using an ActiveX control

    Trying to use an ActiveX control I added to my CVI project.  I use the ActiveX Controller Wizard to create an ActiveX control.  Then I tried using one of the ActiveX control functions but it requires I get an Object Handle.  The ActiveX Control Help says I can get the Object Handle by using GetObjHandleFromActiveXCtrl or an ActiveX method or property.  I looked through all the functions my ActiveX control has and could not find anything that would get an Object Handle.  The GetObjHandleFromActiveXCtrl function requires a panel handle which my project does not have or use.  Any suggestions on what to do next?
    The ActiveX control I am using is Mint Controls Build 5708 from ABB. 

    Hi
    New in ActiveX controls...I cannot help to recreate examples like Media Player (which works perfectly on my PC).
    Well I take the first method of"Programming with ActiveX Controls" topic:
    From the Tools menu of any LabWindows/CVI window, select Create ActiveX Controller. When you run the wizard in this manner, you need to select the ActiveX server that corresponds to your control.
    First I find two "Windows Media Player", which one ? Some trials lead me to the second one, where I retrieve functions names of the example (?).
    Next window : I let Instrument Prefix as "MediaPlayer", I browse a target fp file as "wmp" in my project directory, let the default compatibility options.
    Next window : I don't change any "Advanced Options", success...
    I find a new intrument "Windows Media Player", and 5 files wmp.fp/c/h/sub/obj. OK.
    But I want to see the control on a panel : I open my uir, go to "Create/ActiveX", select "create control".
    But what about "Validate servers" check box ? Il let it unchecked.
    I find "Windows Media Player" (only one) in the list, and the control appears on the panel, but the aspect is different from the example (some property changed?):
    If I edit the control, I find a property list that seems different from the example (even if I expand all) :
    Well it seems that controls are different ?
    I insert some lines in my code ("hello.mp3" is in the project directory):
    GetObjHandleFromActiveXCtrl (PanelHandle, PANEL_WINDOWSMEDIAPLAYER,&mediaHandle);
    MediaPlayer_IMediaPlayer2SetFileName (mediaHandle, NULL, "Hello.mp3");
    MediaPlayer_IMediaPlayer2Play (mediaHandle, NULL);
    Build OK. But nothing played. Error code from "SetFileName" function = -2147467262, error text : "Cette interface n'est pas prise en charge" something like "this interface is not supported" :
    Any idea ?
    Thanks in advance !
    JP
    (Windows XP/CVI2010)

  • It seems that NI dropped the Activex Events from the Control Panel in LabVIEW 7.0. Why???

    I have Labview 6.0/6.1 Activex vi's that no longer work in LabView 7.0 There are no longer ActiveX Events vi's in the Communications->ActiveX control set. What is the deal with that??? Pretty much makes my $2400 upgrade investment worth nothing as far as I can see.

    kup,
    Are you sure that your VIs no longer work? They should. The support VIs are located in "vi.lib\Platform\ax-events.llb". The functionality was not taken away, the VIs were simply removed from the function palette. Also, ActiveX Events may now also be handled using calback VIs. This is much better, IMO. Seach the examples for "ActiveX" and "callback".
    -Jim

  • Event in ActiveX or dll when call it in TestStand

    Hi
    I have a problem with ActiveX or dll build in event when call it in TestStand.
    I have a VC++ code in which there is a Com port event and I deal with it in the code, then I build a dll an export some interface functions, the event and event handler is unknow from the outside, but I want to use TestStand to call this dll and I do not know whether the event can load to memory correctly and monitor the event during the whole process. In every TestStand step, is TestStand free the step content when this step is finished? or it is always residing in the memory.
    I consider to build it as a dll or an ActiveX
    *The best Chinese farmer*

    I'm not familiar with ActiveX. But I found the turtorial on ni.com, hope it's useful:
    http://zone.ni.com/devzone/cda/tut/p/id/2984
    There are some links about the problem you mentioned:
    http://forums.ni.com/ni/board/message?board.id=330​&message.id=2388&requireLogin=False
    http://forums.ni.com/ni/board/message?board.id=330​&message.id=4215&requireLogin=False

  • InsertionPalette activex control key down event

    Hi,
    Can any one know how to get the key down event of InsertionPalette activex control.
    I have handled the KeyDownEvent but it is not fired while the control is active and key is pressed.
    regards,
    Ceaser

    Ceaser,
    what is the application developement environment you are working with?
    Norbert 
    CEO: What exactly is stopping us from doing this?
    Expert: Geometry
    Marketing Manager: Just ignore it.

  • Capturing events fired by ACtiveX control

    How can i capture events fired by ACtiveX control. i am using RegEventCallback vi, but that controls user driven events. i have an activeX control that fires events at unspecified time, now i want to know how to handle such events in LabView.
    Rubina

    Hi InformaticsComplex,
    Using the Register Event Callback VI is the correct method to capture events generated by an ActiveX control. Register Event Callback registers a VI to be called when the event occurs. I suggest checking out the LabVIEW Help articles Using ActiveX with LabVIEW and Register Event Callback as well as the following examples. I hope this helps!
    Examples (all found in NI Example Finder):
    ActiveX Event Callback for Excel VI: labview\examples\comm\axevent.llb
    ActiveX Event Callback for IE VI: labview\examples\comm\axevent.llb
    NET Event Callback for Calendar Control VI: labview\examples\comm\dotnet\Events.llb
    NET Event Callback for DataWatcher VI: labview\examples\comm\dotnet\Events.llb
    Mike Lyons
    National Instruments
    http://www.ni.com/devzone

  • TestStand ActiveX control compile warnings in WPF 2012

    hello everyone,
    I am using TestStand ActiveX controls(ApplicationMgr, SequenceMgr, ExcutionMgr) in my project written in WPF 2012.
    After I put the controls on the form, there are some referrences automatically included in my project. But when I compile, I got the following warnings in the output window:
    CSC : warning CS1762: A reference was created to embedded interop assembly 'c:\Windows\assembly\GAC_MSIL\NationalInstruments.TestStand.Interop.UI\5.1.0.226__ad9244eb3b825cd8\NationalInstruments.TestStand.Interop.UI.dll' because of an indirect reference to that assembly created by assembly 'c:\Program Files (x86)\National Instruments\TestStand 2013\API\DotNet\Assemblies\CurrentVersion\NationalInstruments.TestStand.Interop.UI.AxControls.dll'. Consider changing the 'Embed Interop Types' property on either assembly.
    CSC : warning CS1762: A reference was created to embedded interop assembly 'c:\Windows\assembly\GAC_MSIL\NationalInstruments.TestStand.Interop.UI.Support\5.1.0.226__ad9244eb3b825cd8\NationalInstruments.TestStand.Interop.UI.Support.dll' because of an indirect reference to that assembly created by assembly 'c:\Program Files (x86)\National Instruments\TestStand 2013\API\DotNet\Assemblies\CurrentVersion\NationalInstruments.TestStand.Interop.UI.AxControls.dll'. Consider changing the 'Embed Interop Types' property on either assembly.
    CSC : warning CS1762: A reference was created to embedded interop assembly 'c:\Windows\assembly\GAC_MSIL\NationalInstruments.TestStand.Interop.API\5.1.0.226__ad9244eb3b825cd8\NationalInstruments.TestStand.Interop.API.dll' because of an indirect reference to that assembly created by assembly 'c:\Program Files (x86)\National Instruments\TestStand 2013\API\DotNet\Assemblies\CurrentVersion\NationalInstruments.TestStand.Interop.UI.AxControls.dll'. Consider changing the 'Embed Interop Types' property on either assembly.
    CSC : warning CS1762: A reference was created to embedded interop assembly 'c:\Windows\assembly\GAC\stdole\7.0.3300.0__b03f5f7f11d50a3a\stdole.dll' because of an indirect reference to that assembly created by assembly 'c:\Program Files (x86)\National Instruments\TestStand 2013\API\DotNet\Assemblies\CurrentVersion\NationalInstruments.TestStand.Interop.UI.AxControls.dll'. Consider changing the 'Embed Interop Types' property on either assembly.
    When I change the "Embed Interop Types" property, I got errors instead. Can someone give some advise? What does the warning message mean? How should I get rid of the warnings or should I just ignore them?
    thanks a lot!
    Regards,
    Solved!
    Go to Solution.

    Embed interop types should always be set to false for teststand interop assemblies. TestStand interop assemblies are installed to the GAC so can be accessed from any location and thus do not need to be embeded or copied locally. Embedded interops do not support enum types which TestStand uses.
    How exactly did you add the reference to the teststand controls? What errors do you get when you set embed to false?
    -Doug

  • Flex ActiveX Control Event is Missing

    Hi,
    I wrote an ATL CAxDialogImpl based dialog DLL to host a flash
    activex control. When I launched the DLL dialog box from a command
    line C# program, I can get all the events sent from the flash
    activex control to the dialog instance object, e.g. fscommand,
    FlashCall, OnReadyStateChange, etc.
    Now, I try to load the dialog DLL in IE using a simple local
    html with VBScript, the dialog box shows up and the flash shows up
    too. But I can no longer get fscommand, and FlashCall events from
    the Flash activex control to the dialog instance object,
    interestingly, I can still get the OnReadStateChange events.
    I don't know if this is a known problem already, or it's a
    bug, or is there any workaround for it, or I simply did something
    wrong.
    Your help is highly appreciated.
    Best Regards,
    EJIANG

    Hi,
    This is due to security functionality introduced in Flash
    8.0. I have read the
    Security
    Changes in Flash Player 8 and pages linked in the
    fscommand
    function documentation several times but it's unclear for me in
    which sandbox are put files opened in hosted ActveX Flash control.
    If someone knows this would be very helpful.
    Adobe states that embeding Flash Player ActiveX is not
    supported and stays quiet. Maybe SliverLight guys will be more
    comunicative.
    We have resolved this by using AxWebBrowser control and
    hosting the Flash player in a webpage instead of hosting it in
    Flash ActiveX.
    Another solution if you are using only local files is to try
    to use "file://YOUR_PATH_TO_FILE" as an argument for LoadMovie
    method. But this works only on local files.
    Hope this helps

  • Event structure does not capture mouse click event on toolbar activeX control

    Hi
    We have a toolbar activeX control on FP.  It works perfectly on my computer, but on my coworkers deskyop,  somehow the event structure doesn't capture mouse click event.
    Any idea?  Thanks a lot for any help.
    Anne

    It's a standard activeX control.  I attach a simple vi .
    thanks  for any help.
    Attachments:
    toolbar test.vi ‏41 KB

  • Events from C# Control ? Urgent !!

    Hi all,
        Is there any way to handle events from a C# customcontrol in ABAP?
        When I used ActiveX controls, it was easy - just check by EventID in DISPATCH, and RAISE EVENT that would then be handled...
        But now, with C# controls, events are "delegate" functions, and I just can't figure out how to make ABAP subscribe to this tricky kind of event...
        Please, help!!!
    Thanks,
    Arnaldo.

    This article will explain how to declare and use the C# events in your application as Event Control. You can design your event control in couple of mints, making your event as control will be easy for GUI developers to implement events in client side.
    Here are the steps:
    Create one Windows Application Project
    Add “Component Class” using "Add New Item". This is going to be your Event Control.
    Declare your delegate in your Event Control under your namespace
    Now declare your event inside your Event Control class.
    Also add the FireTheEvent method to fire the event.
    Build the project.
    Go to Form, then ToolBox, add the Event Control using “Add/Remove Items” menu by right clicking on the tool box.
    Drag and drop the new control. Using the property window of the control you can easily implement the Event method in your application.
    Call The FireTheEvent method in your button click after adding new button to your form.
    Run the application and click on your button, you should see your Event firing.
    Here's a list of all the events for the DataGrid control:
    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemWebUIWebControlsDataGridEventsTopic.asp.
    After referring to the DataGrid Event Handler (http://msdn.microsoft.com/library/en-us/cpref/html/frlrfsystemwebuiwebcontrolsdatagriditemeventhandlerclasstopic.asp) information, I think you'll want your code to look something like this:
    <%@ Page Language="C#" AutoEventWireup="True" %>
    <%@ Import Namespace="System.Data" %>
    <script language="C#" runat="server">
    void Page_Load(Object sender, EventArgs e)
    // Set things up...
    void Item_Data_Bound(Object sender, DataGridItemEventArgs e)
    // Your event code
    </script>

Maybe you are looking for