Labwindows CVI 2010 and GetProcessAddress()

I am using Labwindows CVI 2010 v10.0.1 after upgrading from version CVI 2010 v10.0.0. After the upgrade, I have a compile error from a statement that compiles just fine in the previous version. The error is:
"Operands of = have illegal types 'pointer to __stdcall int function(int,pointer to char,pointer to char,pointer to char,int,pointer to char,pointer to char)' and 'FARPROC'."
What causes this error is the following statement in the code:
my_FP = GetProcAddress(dll_handle, "DLL_FUNCT");
and the definition of my_FP is:
int __stdcall (*my_FP)(int x, char y[], char z[], char *m, int g, char A[], char B[]);
(function names and parameters have been changed for simplicity)
As I said, this line compiles just fine in 10.0.0, but not in 10.0.1. Is there a specific update to the compiler that will cause this error? What can be done to fix this?
Thank you very much for your time and help.
Solved!
Go to Solution.

You're correct. This was caused by a change in CVI Windows SDK headers that took place in version 2010 SP1. The change was associated with bug fix #275934. Unfortunately, this bug fix introduced this undesirable side effect of requiring a cast for any function that returns a FARPROC function poinrter (such as GetProcAddress). Upon further reflection, this side effect is unacceptable, and needs to be corrected in the next release. This is being tracked internally with bug ID #336341.
I'm really sorry for this inconvenience. Until the problem is resolved, using the typedef & cast solution that you already implemented is a valid workaround.
An alternative workaround, in case you're worried about other projects, or other functions, where this error might also pop up, is to edit CVI2010\sdk\include\windef.h and replace the following FARPROC definitions (in lines 226 and 230, respectively):
typedef INT_PTR (FAR WINAPI *FARPROC)(void);
typedef int (FAR WINAPI *FARPROC)(void);
with:
typedef INT_PTR (FAR WINAPI *FARPROC)();
typedef int (FAR WINAPI *FARPROC)();
Doing this will avoid the problem throughout a given installation of CVI.
Luis
NI

Similar Messages

  • Announcement: LabWindows/CVI 2010 SP1 Run-Time Engine Updated

    A new version of the LabWindows/CVI 2010 SP1 Run-Time Engine (10.0.1.434) is now available for download. The new version includes Security Update 5Q5FJ4QW which resolves security vulnerabilities in components installed with LabWindows/CVI 2010 SP1 and earlier and LabVIEW 2011 and earlier. Further details can be found at KnowledgeBase Article 5Q5FJ4QW: How Does National Instruments Security Update 5Q5FJ4QW Affect Me? Installing the security update will have the same effect as installing the new version of the Run-Time Engine.
    The update can be downloaded from the Drivers and Updates page. The LabWindows/CVIRun-Time Engine is a free download.
    National Instruments
    Product Support Engineer

    The correct link should be this one
    Proud to use LW/CVI from 3.1 on.
    My contributions to the Developer Zone Community
    If I have helped you, why not giving me a kudos?

  • Dynamic memory is corrupt (Labwindows/cvi 2010)

    I have a multi threaded application....where I have a buffers allocated ineternally in the threads,,...A user interface is present to abort the therad execution.
    Here is the code in one of the threads (NOTE: status is set by a user button to EXIT the program):
    int EthernetDataStructureThread (void *functionData)
        CmtSetCurrentThreadPriority (2);
        EthernetData GetData={0}, *data=NULL;
        data = &GetData;
        /* Use a buffer to read the data from the queue which is coming from TCP read with fresh data */
        const void *BufferEth;
        int BytesRead=0;
        int BytesWritten=0;
        char ReadErrorMessage[256];
        BOOL bitset = FALSE;
        if ( (BufferEth = (EthernetData*)malloc(EthernetDataSize)) != NULL)
            while ( !status )
                BytesRead = CmtReadTSQData (Queue_TCPRead_EthernetData, BufferEth, EthernetDataSize, TSQ_INFINITE_TIMEOUT, 0);
                memcpy (data, BufferEth, EthernetDataSize);
                /* Empty the queue so that we don't have data in next time. */
                CmtFlushTSQ (Queue_TCPRead_EthernetData, TSQ_FLUSH_ALL, NULL);
                //Pass on the data to the Main thread
                BytesWritten = CmtWriteTSQData (Queue_EthernetData_Main, BufferEth , EthernetDataSize, 1, NULL);
                if ( BytesWritten != EthernetDataSize)
                     free(BufferEth);
                    BufferEth = NULL;
                    exit(0);
                Delay(0.02);
            if (status && !bitset)
                free(BufferEth);
                BufferEth = NULL;
                bitset = TRUE;
        return 0;
    My problem is: free(BuffEth) always says Dynamic Memory is corrupt......When I put a breakpoint and keep seeing the resource tracking window, I can see it getting executed fine as the resource tracking window greys out the memory block....but then suddenly free wants to exceute again...and causes the "dynamic memory is corrupt" error.
    I am using LABWINDOWS /CVI 2010 SP1 in WinXP.
    Please help me ASAP....very much appreciated.
    Regards
    NITIN
    -Nharish

    Thank you for your reply Jackie.
    I am calling Free only once...there is an If condition there.
    See the attched video for my problem...Free frees the memory block (see the greyed out portion in resource tracking window but still the statement controls remains there and free executes again, throwing error).
    Do you  think it is some sort of bug in LABWINDOWS.
    See the attached video.
    -Nharish
    Attachments:
    FreeproblemLabwindows.avi ‏4781 KB

  • How to create ActiveX Control in LabWindows/CVI 2010

    I have LabWindows/CVI 2010 Full Development System (Debug Only) installed on a stand alone PC with Windows 7 (64bit).  Also I have Matlab (R2011a) (also 64bit) installed on this PC.  I tried to use "Create ActiveX Controller" under ""Tools".  I can locate the "Matlab Application (version 7.12) Type Library" in the ActiveX Controller Wizard. After click "next", I got a message "The Type Library is not intended for use on Win32".  My questions are:
    1) Is my LabWindows/CVI 32bit or 64bit?
    2) How to create my Matlab ActiveX Control?
    Thank you.

    Hi JGS,
    It means that you cannot use 64 bit libraries in CVI ti create Activex controls since CVI is a 32 bit application. You can however create 64 bit dlls, executables and static libraries. Here is a link to some information:
    http://zone.ni.com/reference/en-XX/help/370051T-01/cvi/programmerref/creating32bitappsversus64bitapp...
    Regards,
    Perry S.
    Applications Engineer
    National Instruments

  • How can I convert a project from LabWindows/CVI 2010 to a Visual Studio 2011 project?

    I have a good sized project, 12 source files, 14 headers, 1 uir, that I want to be able to edit and compile in MS Visual Studio 2011, MSVC++.
    I remember being told that LabWindows dropped support for C++ in 2008 and no longer had a wizard for converting projects. I know I can go the DLL route, but I have never created a DLL before and wouldn't know where to begin with it. What would be the best way to go about this conversion?
    Solved!
    Go to Solution.

    CVI 2010 still supports the Visual Studio Conversion Wizard for Visual Studio 2005/2008. We do plan to add support for VS 2010 in a future release.
    If you need a VS 2010 project now, you can use the Visual Studio 2008 conversion wizard, then upgrade the VS 2008 project to VS 2010.
    National Instruments
    Product Support Engineer

  • Can I create a merge module (.msm) in LabWindows/CVI 2010?

    Is it possible to create .msm files in LabWindows/CVI 10?  If so could someone just point me in right direction please?  Thank you.
    Solved!
    Go to Solution.

    You can't create merge modules in CVI but you can consume merge modules in our distribution builder. Normally, if you needed to create a merge module, you would create the merge module in a tool like WiX and then consume it in CVI. Just out of curiosity, what exactly are you trying to do? 
    Jonathan N.
    National Instruments

  • Labwindows cvi 2010 sp1 Device drivers

    Hi all
      I am trying to install cvi 2010 sp1 and it is asking for the Device Drivers for the program, where can I find the drivers for the sp1.
    To finish installing
    I have some older drivers but what is the latest for sp1
    Thanks in advance

    Hi Iriddick,
    You can choose to not install the Device Drivers with CVI and you will not get that window.  You can also cancel installing the Device Drivers without cancelling the CVI installation.  If you would like to install the Device Drivers, you can find the latest version by searching for "device drivers" at the ni.com main page.  The current latest version is the NI Device Drivers 2011.08.
    Regards,
    Brandon V.
    Applications Engineering
    National Instruments
    www.ni.com/support

  • The applicatio​n uninstalle​r ,created with Labwindows CVI, doesn´t work after upgrading to 2010 version

    Hi,
    I have been working with Labwindows CVI 2009 with no problem but after upgrading to 2010 version I have the following problem:
    When i´m going to execute the unistaller, either from Windows Control Panel or directly from the uninst.exe icon, it doesn´t work. The PC thinks a few seconds and does nothing, and it happens with all the applications I build with Labwindows CVi 2010.
    Thanks,
    Asier
    Solved!
    Go to Solution.

    Hello -
    Are you installing these distributions on a non-English operating system?  If so, the first thing to try would be the workaround listed on this known issue. 
    The known issue only lists Italian OSs as the troublesome OS, but it could actually happen on many different non-English OSs. I will update the text accordingly the next time I update the known issues list.
    NickB
    National Instruments

  • Announcement: Security Update 5Q5FJ4QW for multiple versions of LabWindows/CVI and LabVIEW

    An update for LabWindows/CVI and LabVIEW users is now available for download. This update resolves security vulnerabilities in components installed with LabWindows/CVI 2010 SP1 and earlier and LabVIEW 2011 and earlier. Further details can be found at KnowledgeBase Article 5Q5FJ4QW: How Does National Instruments Security Update 5Q5FJ4QW Affect Me?
    The update can be downloaded with NI Update Service 2.0 (which installs with LabWindows/CVI 2010 SP1 and LabVIEW 2011) or from the Drivers and Updates page. Information about the update is also available in other languages through links in the Drivers and Updates page.
    This is free update for all LabWindows/CVI and LabVIEW users.
    National Instruments
    Product Support Engineer

    The correct link should be this one
    Proud to use LW/CVI from 3.1 on.
    My contributions to the Developer Zone Community
    If I have helped you, why not giving me a kudos?

  • TDMS functions much slower in CVI 2010

    Hello everyone.
    Today I noticed that at least some TDMS functions are much slower in CVI 2010 compared to CVI 2009 SP1 and prior. I have created and attached a simple sample project that creates a TDMS file with about 3000 file level properties and tries to read it back in afterwards. On all releases prior to 2010, this needs less than 10 seconds. On 2010 it's around an hour, if not more! Unfortunateky this is pretty much a show-stopper for me. Any comments?
    Thanks, Marcel 
    Attachments:
    tdmsTimingTest.zip ‏3 KB

    Hello Marcel -
    What you've reported is actually a known issue, and is unfortunately considered to be expected behavior.  Let me try to explain:
    There was a relatively large refactoring of the underlying TDMS code in LabWindows/CVI 2010.  This refactoring was intended to more closely align our internal implementation to that of LabVIEW.  As a result of this refactoring, we were able to address some internal issues we had previously been unable to address, as well as more correctly handle the data stored in the TDMS file.  Unfortunately, this refactoring unmasked a performance issue that had always been present when reading a large number of properties one at a time.
    This performance issue was not uncovered for LabWindows/CVI 2010 because we had previously focused our performance testing on reading and writing data to a file, not metadata.  We considered it unlikely that a customer would have more than dozens of properties for any one channel or group or file, and as a result, the performance issues you've reported were overlooked.
    However, we did recently find the performance issues you've reported.  As a result, there will be a handful of undocumented functions for returning all (or a subset of) properties on a channel, group, or file in LabWindows/CVI 2010 SP1.  This will allow for performance in line with what you'd seen in LabWindows/CVI 2009 SP1 and earlier, as long as you are OK with grabbing all the properties at once.  These functions are undocumented because, in general, we don't release new features with service packs.  Also, the functions are a little more difficult to use than normal CVI APIs, so we have not yet determined how or when they will be publicly documented.  When LabWindows/CVI 2010 SP1 releases (later this summer), feel free to reply back to this post or send me a private message, and I'll work with you on the details of calling these undocumented functions.
    Out of curiosity, we'd like to know your use case for creating that many properties.  You're the first customer we've encountered using such a large number of properties, and we'd like to ensure that we are able to satisfy your use case in future versions of the API.
    Thanks for the report, and I'm sorry for any inconvenience this has caused,
    NickB
    National Instruments

  • Compiling examples closes LabWindows/CVI

    I have a NI USB-5132 module, with NI-SCOPE 3.7.  I can bring up the device in "Measurement and Automation Explorer", and sees it as "Dev1".  I can bring up NI-Scope Soft Front Panel, and toggle the device, read whatever I want to read.  However, I'm trying to run on my CVI/LabWindows 2009 platform, but when I try to compile ANY of the examples, the development software closes.  No error message....nothing.  When I try to create a new DAQmx task, it sees no available devices for ANY of the possible measurements.  
    Please help!  Otherwise, it would seem my work has purchased a very expensive method to click the exit button.

    Hi Chris, 
    I'm sorry to hear that you are having so much trouble! Could you please provide some more details regarding when you experience this crash? Does this crash occur when you compile all programs or just specific ones? What examples are you attempting to compile? If this is the first time that you are compiling and are experiencing this issue, please refer to the following known bugs in CVI 2009
    LabWindows™/CVI™ 2009 and 2009 SP1 Known Issues
    LabWindows/CVI may crash if compiling a project that includes LabWindows/CVI header files with a line containing the #pragma soft_reference statement
    Compiling a file with a syntax error can cause LabWindows/CVI to crash.
    If these known bugs are not relevant to your code, can you please post a WinDbg log. The following explains how to do this. Despite this article being applied to LabVIEW, this is relevant for CVI as well.
    Using WinDbg for LabVIEW Error Reporting
    If you are running an operating system previous to Windows 7, please refer to the following: 
    Description of the Dr. Watson for Windows (Drwtsn32.exe) Tool
    I look forward to your response. Have a great day!
    Regards,
    Jackie
    DAQ Product Marketing Engineer
    National Instruments

  • Cvi 2010 menu preventing callback execution

    Hi y'all
    i am using cvi 2010 and i am having an issue with the menu selection field not allowing the execution of the serial callback function. When you hover over the menu  without selecting it, its ok, if you click on the menu and during the time you are making a selection  the callback execution never gets called.
    the callback also seems to get inturupted by user input events ie.. selecting a numerical box, command boxs etc 
    This happens in both bebugging and the release executable.
    is this a known issue?

    unless someone knows a different solution this is what i dug up
    http://digital.ni.com/public.nsf/allkb/34D1A6C408FAF9BE86256C710080CCA7

  • Return of void functions inconsiste​ncy between CVI 2013 and older

    Hello,
    I have discovered an inconsistency using CVI 2013 (SP2 or not) compared to CVI 2010 and CVI 8.5 (the versions I have).
    I have written, by mistake, a code where I'm returning a value for a void function. CVI 2013 does not complain (but should) while other CVI versions complain (and that's OK).
    Here is the code:
    static void pouet(void)
    return;
    static void hop(void)
    return pouet();
    int main(void)
    hop();
    return 0;
    Could this behaviour be fixed for the next CVI update ?
    Thanks.
    Frédéric Lochon.

    Well it's technically not causing wrong behaviour, but may cause less than best performance depending on the compiler code generation as the register usually used for function return values might be assigned some garbage value that never will get used though.
    Causing an error is likely a bit strict, issueing a warning would be the prefered behaviour, not generating either a warning or error is a bit lazy. Problematic would be if you could write this without getting an error:
    static void pouet(void)
    return;
    static int hop(void)
    return pouet();
    int main(void)
    hop();
    return 0;
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • Add Transparency Attribute for LabWindows/CVI Panels

    Add an attribute for LabWindows/CVI panels for setting transparency.
    Currently, in order to achieve this behaviour users are forced to workaround this using Windows API.
    Having an attribute for this purpose would allow users to benefit from this functionality more easily and would make LabWindows/CVI programs more cleaner.
    Related forum discussion: http://forums.ni.com/t5/LabWindows-CVI/Transparent-Main-Panel/m-p/3172386

    Greetings LabWindows/CVI enthusiasts,
    I am pleased to inform you that the LabWindows/CVI Real-Time Module Beta Program is now open.
    If you are interested in participating in the program, we encourage you to request participation by visiting www.ni.com/beta and choosing to register for the LabWindows/CVI Real-Time beta from the drop-down menu. All previous beta users must re-register for the LabWindows/CVI Real-Time Beta to ensure we have up-to-date information. This is a separate beat program from the LabWindows/CVI Beta and must be registered for separately.
    National Instruments
    Product Support Engineer

  • Manual or Tutorial of Labwindows/CVI 5?

    Hi everybdy, i'd like to know, if anybody knows some manual, tutorial or
    how getting started , in the program LabWindows/CVI 5 or other version, in
    Internet . Thanks for your attention, and sorry for my English.

    Here's a web site that should help:
    http://zone.ni.com/devzone/devzone.nsf/webproducts/a77c886190b47fd286256785006d6ca9
    I got here from ni.com/support, selecting Measurement Studio for the first pulldown and clicking on "LabWindows/CVI: Tutorials and Examples" at the top of the page.
    Good luck,
    Brad

Maybe you are looking for