Return incorrectly ActiveX control wrapper function

Hi all

Thank you for taking the time to read and respond (I hope).

I work with an instrument driver that I created from a control ActiveX the ActiveX controller Wizard.  However, I have a function that does not return one of his arguments, but he will return to the other.  See below.

The goal is to open a device called the EV2300.  GetFreeBoards() should return the number of devices (plates) found and the names of the rooms.  He finds and returns the number of thin devices (2 If two devices are connected, 1 if a connected device and 0 when no devices are connected), but where it does not return the names.  The character array passed as reference remains empty and no error is reported.

char msgStr[256];
char *BrdName;
ERRORINFO error;
CAObjHandle EV2300_Handle;
int returnVal;
long nBrdsFound = 0;

mainpanel = LoadPanel (0, "TE_User_Interface.uir", MAIN_PANEL);

GetObjHandleFromActiveXCtrl (mainpanel, MAIN_PANEL_BQ80XRW, &EV2300_Handle);

BrdName = msgStr;

returnVal = BQ_EV2300_GetFreeBoards (EV2300_Handle, &error, 16, &nBrdsFound, &BrdName);

The wrapper function generated by the wizard:

HRESULT CVIFUNC BQ_EV2300_GetFreeBoards (CAObjHandle objectHandle,                                         ERRORINFO *errorInfo,                                         long nNumBrdsToGet, long *nNumBrds,                                         char **listBrdNames){   HRESULT __result = S_OK;  unsigned int __paramTypes[] = {CAVT_LONG, CAVT_LONG | CAVT_BYREFI,                                   CAVT_CSTRING | CAVT_BYREFI};

 __result = CA_MethodInvokeEx (objectHandle, errorInfo, &BQ_IID_EV2300_,                                 0x7, CAVT_EMPTY, NULL, 3, __paramTypes,                               nNumBrdsToGet, nNumBrds, listBrdNames);

   return __result;}

Using the same controller configuration and hardware ActiveX in VB6 works perfectly: the name of the EV2300 is returned, and I can't continue to use in other functions:

Dim Bq80xRW1 As Bq80xRW
Dim BrdName As String
Dim nBrdsFound As Long

Bq80xRW1.GetFreeBoards 16, nBrdsFound, BrdName

Any ideas what I could do wrong?

Something is definitely wrong, because the last two parameters are the two output parameters and yet they are being defined as input parameters. So either the ActiveX control has bad IDL inside or the ActiveX controller Assistant made a mistake.

You might try a little experiment by changing two CAVT_BYREFI references in the table of __paramTypes to CAVT_BYREFO to see if that makes a difference. Rationale: for strings, CA_MethodInvokeEx has probably convert c type a BSTR string for the input parameters and BSTR chain C for output parameters. Though she doesn't think that a parameter is an output parameter, my guess is that it probably don't back conversion. For long (which are a native type of ActiveX) should not do all the conversions.

Tags: NI Software

Similar Questions

  • VB6 activex control does not not in labview 8.5

    I am currently trying to get out of VB6 and Laview for some applications to test automated for secondary (rechargeable) batteries.

    We use Texas Instruments fuel gauges to my business and communication with them requires an EV2300 USB box.  I have the drivers installed for the box, and it works without problem in VB6.  I need to get Labview to talk to the box in the same way.

    I use 8.5 at the moment, and I thought that I had the good idea to use the BQ80xRW.dll file that is already installed on my machines to VB6 application.  The only problem is that I don't have the source code of the DLL, only the dll and ocx in my win32 directory files.  Here's what I did:

    (1) import the activeX control to palette (bq80xRW.dll)

    (2) place the bq80xRW on my VI activex control

    (3) place call nodes for the functions I want to test (GetFreeBoards--> OpenDevice--> ReadSMBWord)

    (4) to include nodes with appropriate controls (integers, strings, etc.)

    (5) run the VI

    I've included the VI I developed with this post.  Nword must, in my view, be on 16 while Cmd should be set to 1 c (to read the serial number of the part)

    When I run the program, while the USB module is connected, the GetFreeBoards node returns the following string:

    \\?\usb#vid_0451&pid_0035#5&1c93b2c6&0&2#{8eb0fa22-a67c-4a27-9913-df9ab307d886},

    If I run the program without the attached USB module, the string is empty.  Without spaces or characters at all.

    If the activeX control is something.  It's just not what I want it.  And since I don't have the source code of the dll, I don't know why.

    This big long string starting with \\?\usb is the name of the Board of Directors.  Get rid of the trailing comma and passing under the name of your Board of Directors in opendevice().

  • Wrap the ActiveX control in a lvclass?

    I am trying to wrap an ActiveX control in a class. I use a Refnum of the automation of the private cluster for containing the reference to the class, create the open instance of ActiveX Automation and the private refnum allows access to the class. Very well. But without the destructor semantics how can I make sure that the ActiveX object is released properly? Also, private refnum ActiveX seems to come back to null when I transition vi at vi. I have to do an automatic open after unbundling the refnum every time?

    Nobody prevents you from implementation of constructor and destructor of yourself. Create a static dispatch VI, which creates an instance of your ActiveX object and create a dynamic distribution VI in order to release it (you can inherit from your class if you need to). The semantics of use your wrapper is the same as working with plain ActiveX refnums: you call your Shredder VI explicitly, you would have to do with "close Reference primitive." I wrapped a full hierarchy of objects this way COM and it works fine. BTW, you can take a look at Endevo GOOP Developer Suite: it simplifies the use with classes and provides a class with the constructor and destructor model, as described above. Unfortunately I have no idea why your automation refnum becomes invalid. Do you use it outside your class and accidentally somewhere close? Maybe OT, but if you need an accessor for the private refnum, you can use a trick to protect to close: wire your original refnum for both inputs of a primitive "Data Variant" and return to the refnum resulting: so you increment the counter of your COM object reference You can (and should) close the refnum safely without affecting your private.

  • ActiveX control in CVI Edit substep

    I'm under CVI 2010 (10.0.1.419) and TestStand 2010 SP1 f1 (4.5.1.144).

    I came across a problem today and I know that I must be missing something easy. I am trying to create a step with a stage to change type. The lower level change called a CVI function to its module code. The CVI function opened a panel that contains an ActiveX control.

    When I try to use the lower level edit (by clicking the button in an instance of the step type), I got an error that the DLL cannot be loaded. Changing the setting of adapter CVI to run the steps in an external Instance of CVI let me see that ICB receives an ERROR of EXECUTION NO DEADLY that 'ActiveX controls cannot be created in a thread which the concurrency model is apartment multithreaded (MTA).

    I know that Edit substeps are supposed to use STA threads (there is a post of Doug somewhere around here... ah, here). So I did not know what went wrong. I created the simplest example I could think of nothing else than a control IE WebBrowser on a Panel in a .uir and still have the same error.

    More strange is that I got the error When you run one of the TestStand examples! I tried the example \Examples\StepTypes\CVI\HP34401a and got the same error:

    NON-FATAL RUN-TIME ERROR:   "c:\...\StepTypes\CVI\HP34401a\HP34401aStepType.c", line 356, col 5, thread id 0x00001694:   Library function error (return value == -176 [0xffffff50]). ActiveX controls cannot be created in a thread whose concurrency model is multithread apartment (MTA)
    

    There must be something I am doing wrong, or an option that is out of order. Any ideas?

    -J

    Change substeps are executed in a threaded so executed in the process. If you are running in an external CVI, then you will get a MTA thread. You probably don't want generally be run some edit sub-steps in a CVI outside themselves, that is why there is a checkbox "Always run in the process" on the CVI module specification table (I recommend to all developers step using CVI modules for substeps type use this setting for all of their sub-stages). Your original question was probably unrelated to the COM threading model I recommend that you debug and debug the process of with CVI seqedit.exe rather than your modules running in an external CVI.

    Hope this helps,

    -Doug

  • Two main problems; can be combined (display/activeX controls to image)

    I first noticed the issue several weeks ago, but I can't determine any single event that triggered (for example no virus, no software installation, etc..) Since that time I was pulling on my hair, searching the Internet to find answers, answers MS Search, book search for answers - without success.  I am now trying to put this as a presentation at the forum, and I'll switch to FireFox immediately after, because no clear solution seems to be around.

    Please - someone help me; I have tried everything I have seen/read:

    Question 1: Some web pages display images without problem (www.microsoft.com, www.newegg.com, www.tigerdirect.com, etc.) while others fail to show images at all and seems more text based GUI based. A good test for this was that several web sites including www.amazon.com , which breaks down to show the book covers, Ted images etc., while other pieces show correctly positioned text and links work when you're floating above them and click.

    What I tried (1):

    -During the running MS Internet Explorer for FixIt. clear all the cache (password, internet files, temporary, cookies, forms, etc.); Reseting "default." running a registry cleaner application. After each setting on the net I could find and the similar value, removing all list management web sites. (This is true for both versions of Internet Explorer - 32B or 64B)

    Question No. 2: Installation of the safe places known ActiveX control (for example, Microsoft) do not settle. This applies to both versions of Internet Explorer (32B and 64B). To try to understand what is the problem, I even searched the Internet and followed everything I can find.

    -Linking MS FixIt for IE; clear all the cache (password, internet files, temporary, cookies, forms, etc.); reset to "factory" by default; Run the registry cleaner application. After each setting on the net as I could find and the value as well. remove all list management web sites.

    FAILURE on all fronts... :(

    Additional information:

    After switching to FireFox (if all goes well for only a short time), I followed the instructions to remove Internet Explorer my system.

    It did not work... IE (32B and 64B) remained. Not only he remained, he kept what is wrong with it as well. Still no satisfaction.

    If anyone can help, I would really appreciate it...

    Anyone know of any solution anywhere - little matter how painful?

    Please let me know answer here or by sending a private message or how ever best works for no matter what - I'm going to try anything at this point.

    Thank you in advance.

    FYI: I posted this same question to: http://social.technet.microsoft.com/Forums/en-US/ieitprocurrentver/thread/00d14d60-92e2-46b8-8ecb-5c0beb445f44

    However, this forum does not seem to be technical enough to still offer ideas... I don't know that's the hope!

    Hi Jim,.

    I see that you have some problems with the display of the images, and active x controls on Internet Explorer. I'll help you with this problem.

    I suspect that the use of registry cleaners could have caused some problems.

    Method 1.

    If possible, use the system restore to a date before the problem occurred.

    System Restore: http://windows.microsoft.com/en-us/windows7/products/features/system-restore

    Important: System Restore will return all system files not as documents, email, music, etc., to a previous state. These files of types are completely affected by the restoration of the system. If it was your intention with this tool to recover a deleted file to non-system, try using a file instead of system restore recovery program.

    Method 2.

    If the method above does not help, then run SFC/scannow. After control scan to see if the problem occurs.

    I suggest that you can exercise SFC scan and check if that helps. The SFC/SCANNOW command analyzes all protected system files and replaces incorrect versions with appropriate Microsoft versions.

    For more information how to make SFC / scan, please follow this link: http://support.microsoft.com/kb/929833

    Let us know if you need assistance with any windows problem. We will be happy to help you.

  • Using ActiveX controls to the old user interface

    I tried to build a User Interface for TestStand 4.1.1 using LabView 8.6.1 (on Windows XP)

    However, ActiveX controls keep showing in the old non - 3d "block" style.

    This seems to be a problem when you build a new exe. If you use the included UI (Full Featured) in TestStand it appears correctly.

    I was able to replacte this problem on two other development systems (a new windows XP, LabVIEW 8.6.1 & TestStand 4.1.1 install).

    (1) take a copy of the full-functional UI of LabVIEW.

    (2) open the project file

    (3) rebuild the exe file

    It's only a problem when you use the exe file. When you run from the LabVIEW development system it looks good.

    Hi Simon,.

    For your UI to take on XP
    Theme controls, you will need to place a manifest file that specifies the activex control topics in the same
    directory as your executable file. TestStand comes with a manifest file for
    INTERFACE c# you can also use for the UI of LabVIEW. Just go to the \User Interfaces\Simple\CSharp and copy the file TestExec.exe.manifest in the directory of the LabVIEW User Interface executables.

    Note that the manifest file must have the same name as your executable file LabVIEW UI. For example, if you name your user interface, "MyCustomTSUI.exe", you will need to name the manifest file 'MyCustomTSUI.exe.manifest '.

    Please let me know if this solves your problem or if you have other questions. Thank you!

  • Problem of event reminder of the registry with Linkam ActiveX controls

    Hello

    I have a problem in configuration reference VI to interface with Linkam ActiveX control with an event callback function to register. I created a VI strictly typed with re-entrant execution, with all the correct connectors, as shown in the picture below, but LabView complains of a broken wire. The only difference between the input and the output seems to be that the result stands as an asynchronous function, and the entrance wants (synchronous) normal function? I can't find any option to make my VI reference become synchronous. Does anyone have any suggestions as to what to try next? Thank you very much

    Davide

    Hello

    Make a right-click on the terminal 'Ref VI' choose 'create the callback VI '.

    Do not try to build it yourself, it never works. :-)

  • The 'Excel.FormatCondition' activeX control class opening

    I am using activeX controls for excellent including the classes Excel._Application, Excel._Workbook and Excel._Worksheet. I used an open refnum of automation of opening of the application class, then I used nodes of property to join the workbook and worksheet classes. Now, I want to use the Excel.FormatCondition class. I couldn't go to class with nodes and its methods, so I use a refnum automation open as before, but I get "Error 3005 occurred at the opening of Automation".

    I found another post with advice to record the commands, but I read that the excel activeX controls need not to be recorded - they work under windows.

    If I do not need to record something, I don't ' know not what. I'm using LabVIEW 8.6 and Office 2007.

    Andrew

    This is not true. As I mentioned in another threadas an example, you get out of the status of the format of the collection after you have added using the Item method. In Excel 2003, which returns a FormatCondition type directly. In Excel 2007, it returns a variant. Therefore, you can use the variant data between the FormatConditions.Item () method and the FormatCondition.Interior property, as I showed in response No. 14, to convert the variant to a FormatCondition type.

  • How to find the references to the ActiveX control

    Is it possible to determine where an activex control is used in a labview project?  I have a moderately important project who have used a combination of ad-hoc XML parsers, including the parser XML ActiveX for Microsoft (MSXML).  I am trying to replace all occurrences of MSXML with of builtin labview VI XML or our own DLL calls that make more complicated sequences of calls to XML-Xerces/Xalan libraries.  I want to assure you that I replaced all references to the MSXML parser without having to inspect all the VI in the project.  I was hoping that I could right-click on a function block "Automation Open" and select the option "Find all Instances", but apparently it is not available because it is for a VI I created.  In addition, I was hoping that if I went to the Project Explorer, it would show that the msxml.dll file was listed as a dependency where I could do a 'find Caller' as a regular dll referenced via a "call library function node".  Does anyone have a suggestion on how I can automate this search?

    Thank you.

    'Find all Instances' is only available for the screws that you create, but you can always find the function of automation opening in your project. Just open your project and open a VI. Then select Edit-> find and replace. In this dialog box, you can search for specific functions throughout the project.

  • How can I activate the appearance of the information bar for the purpose of the installation of the ActiveX controls?

    Windows XP SP3 32-Bit Kaspersky Pure 2.0, IE8. I try to run Windows Update or Microsoft. The "check for Updates" returns very briefly and I get the message that I need to install the ActiveX control to run the update. I see clear instructions right click of the 'information bar' and follow the instructions.

    My problem is I do not have the information bar and have spent hours trying to allow him or have it Update ActiveX to recognize appear to be installed. Thank you.

    Internet Explorer 8 information bar: frequently asked questions
    http://windowshelp.Microsoft.com/Windows/en-GB/help/a7a14db1-f0ce-40b0-a8ee-3c2df2ffd8121033.mspx

    Check your settings to make sure that it is not off.

    • Open Internet Explorer by clicking on the button start , and then click Internet Explorer.
    • Click Tools and then click Internet Options.

    • Click the Security tab and then click Custom level.

      • Do one or two of the following ways:
      • To disable the InfoBar for ActiveX controls, scroll to the section ActiveX controls and plug-ins from the list and then, under prompting for ActiveX controls, click Enable.

    • To disable the InfoBar for downloads, scroll to the section of downloads from the list and then, under prompting for file downloads, click Enable.

    • Click OK, click Yes to confirm that you want to change, and then click OK again.

    If your settings are set as above, then the information bar stops.

  • ActiveX control error: your current security settings prohibit running ActiveX controls on this page.

    Original title: problem with Activex controls

    I m trying to open my scanner program, but windows shows me the below msg: Please help me solve this problem...

    one or more activex controls couold appears no not because either:

    (1) your current security settings prohibit running ActiveX controls on this page.

    (2) you have blocked an editor of one of the controls.

    As a result this page may not display correctly.

    Hi euriskofiles,

    The problem may occur if the security settings for the Local computer zone are configured to prevent the ActiveX content to run.

    Important This section, method, or task contains steps that tell you how to modify the registry. However, serious problems can occur if you modify the registry incorrectly. Therefore, make sure that you proceed with caution. For added protection, back up the registry before you edit it. Then you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, click on the number below to view the article in the Microsoft Knowledge Base: 322756

    Steps to follow:

    (a) click Start, click run, type regedit, and then click OK.

    (b) expand the following registry subkey:

    HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\0

    (c) in the right pane, right-click right 1200and then click change.

    (d) in the value data box, type 1, or 0 to replace the existing value of 3. Then, click OK.

    Note If you type 1 in the value data box, you receive the following message when you start Microsoft Project:

    You want to allow software such as ActiveX controls and plug-ins to run?

    In addition, you receive this message at other times when you use Microsoft Project. If you do not receive this prompt, type 0 in the value data box.

    The values 0, 1 and 3 are associated with the following behavior:

    o 0 = on, or the action is possible

    o 1 = Prompt

    o 3 = disabled, or action is not allowed

    (e) exit the registry editor.

    See if that helps. Kind regards

    Shinmila H - Microsoft Support

    Visit our Microsoft answers feedback Forum and let us know what you think.

  • I can't use Microsoft dates. He tells me to "Install ActiveX control" BUT

    I have everything that I can't use Microsoft dates.  He said "Install ActiveX control" but the instructions or take the following steps to solve the problem is to work for me.  I had the bulk of security installed for some time, but my PC is really slow and stop the little pop ups of what risk etc occur.  I ran the security scan, microsoft set the scan, the malicious software removal tool and the free antivirus, antispyware and they all return that there is no problem.  I need to get the ActiveX control Setup so I can receive all the dates at the top.  Can some one please give me advice on how to do it.  Thank you very much in advance, Ms. ESP :>)

    Is this the same computer as in this thread more early of yours? -Online http://answers.microsoft.com/en-us/ie/forum/ie8-windows_xp/getting-webpage-error-details-user-agent-pop-up/a09f3911-5e9d-4176-86d6-55edf1d78a9e

    And this one? -Online http://answers.microsoft.com/en-us/protect/forum/protect_scanning/my-windows-online-scranner-window-just-appeared/b1a41787-0658-44fe-b6be-66ce46316215

  • Internet Explorer blocks ActiveX control that allows me to upload my photos to Hotmail messages to family.

    For months, Hotmail did not have the ActiveX control which allows users to compress and upload photos to include with the e-mail.  So I went to post pictures on Picasa.  When the ActiveX control has been restored recently, I went to use Hotmail for my photos - much more practical than Picasa.  Now, suddenly, I got the following message in Internet Explorer when I try to download my photos: "Internet Explorer has blocked this site by making a dangerous ActiveX control.  As a result this page may not display correctly. "This I return to use Picasa to send my own photos to my own list of contacts?  Even though I was ready to change my security settings to the lowest possible level (which I don't do), I can't figure out which "categories" of the web site to my Hotmail account belongs to that!  Will you please help me find a way to bypass this blocking, so I can resume sending my photos in Hotmail.  Is there really that much danger to my PC if I do this?

    Hotmail forums:

    http://www.windowslivehelp.com/forums.aspx?ProductID=1

    They will help you when repost you your question in the Forums above for Hotmail.

    See you soon.

    Mick Murphy - Microsoft partner

  • The flash player activex control?

    Hey, you have another question for the experts... I have a SWF and an activex media player on a page... stream URLS are in my flash movie and I wish I could choose which stream to play in the media player by clicking on a button on the swf...

    This is where I am currently in detail... skip down if you want the quick description

    In flash, I connect to my webservice and pick up the three tables. One called 'seen', one called "vc" and one called "vt".

    'vu' contains about 5-10 urls in service date here... vu1, vu2, vu3, vu4, vu5, etc...

    "vc" contains the name of the company in streaming... "vc1" is the source of "vu1" etc.

    "vt" contains the name of the actual flow

    function getVideoList() {}

    var pen: PendingCall = ws. GetVideoList();

    pen.onResult = {(res) function}

    var i = 0;

    NVID res =. NVID;

    for (i = 0; i < nvid; i ++) {}

    saw [i] = res.vid [i] .url;   databasecode

    VC [i] = res.vid [i] .src;   databasecode

    VT [i] = res.vid [i] .trk;   name

    }

    }

    }

    I then use localconnection to send vc [i] saw [i], and [i] vt to a second swf that I just want to control what is happening via a media player also on the same page

    var outgoing_lc = new LocalConnection();

    startbutton.onRelease = function() {}

    outgoing_lc. Send ("videolist", "leisure", seen, vc, vt) ;} ;

    This second swf picks it up and displays the names (vt) in text fields Dynamics (called vx1-20) located on top of buttons. The company continuously (vc) is displayed in another field of text dynmaic upstairs.

    var incoming_lc = new LocalConnection();

    incoming_lc. Connect ("videoList");

    incoming_lc.thefunction = function (param1, param2, param3) {}

    var i = 0;

    for (i = 0; i < = param1.length - 1; i ++) {}

    VX [i] .text = param1 [i];

    saw [i] = param2 [i];

    VC [i] = [i] param3;

    }

    };

    flash.external import. *;

    function SelectVideo (n) {}

    VideoSrc.Text = vc [n];

    HOW does send seen [n]?

    IM lost in the place where I want to by clicking on a button and pulling the "(n) SelectVideo" to send the url (see [n]) the reader multimedia activex on the same page and play... don't know how...? Looks like a simple concept, having the two communicate, but I had no chance. ExternalInterface is something ive tried but I can't seem to get it right on the side of actionscript and deleted from the code above... In Dreamweaver, the name of the drive multimedia activex is "mediaPlayer" and if ExternalInterface allows you to speak in javascript I have this function here...

    < script language = "Javascript" >

    function setVideoUrl (a) {}

    document.getElementById("mediaPlayer").setURL = has ;}

    < /script >

    This is the code for the Media Player object.

    < object classid = "CLSID:6BF52A52 - 394 A-11 d 3-B153-00C04F79FAA6"

    " codebase ="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=, 1,52,701"" "

    type = "application/x-oleobject" width = "340" height = "240"

    standby = "loading Microsoft Windows Media Player... components." »

    id = "mediaPlayer" >

    < param name = "url" value = "video10.png" >

    < param name = "uimode" value = "none" >

    < param name = 'stretchToFit"value ="true">

    < param name = 'enableContextMenu"value ="true">

    < embed type = "application/x-mplayer2".

    src = » http://www.mysite.com/video10.PNG "width = 340 height = 240 > "

    < / embed >

    < / object >

    SO... again... my question is... How to pushing me a button in a SWF fire a function that sends and plays the url of that feed in the same page activex media player?

    So you're on the right track. The best way I found to do is Google search for Flash and Javascript and create a flash test file and the html file. You should be able to make your javascript in your html page simple to launch a new window and go to yahoo or something. That's how you know you're in communication with the javascript function correctly. Then put it in what you are doing and if it does not, you know it's a problem of javascript to the media player not Flash to javascript. That should help a bit.

    I could do this from as2 to a popup which held an as3 document and their release back to build a screen shot and then saved. So I'm sure passing a string to a media player is possible and fairly easy

  • How to resize the activex control?

    I want to dynamically resize an ActiveX control in LV 7.0.  How can I do?

    I tried to manipulate the container manually, using the HWND parent, but although the ActiveX think than its resizing it na not really.  Looks like the window is to be rigged and then the image is cut off?

    Anyway, if there is a solution, I would greatly appreciate knowing.

    Thank you

    Adrian

    Don't know if this can help, but...

    Try right - click at the end of the container on the FP and select Create the property node >...

    If your ActiveX control is like mine which should give you the properties of the container.

    Ben

Maybe you are looking for