Calling primary dll which calls secondary dll

Hi all
I have a visual C++ file which calls a dll named mpusbapi.dll . The visual C++ file has some additional
functions also. I want to make this visual C++ file itself a dll and then call this dll from call library function
in labview. Please guide me in making this visual C++ file dll. 
To make functions visible in call library function what do i use.
_declspec (dllexport)  or  Extern C
I have also read the tutorial of making Writing a DLL with Microsoft Visual C++
Are there any steps required in doing this? Please tell
Regards

I want to add one more thing that in the tutorial of Writing Win32 Dynamic Link Libraries (DLLs) and Calling Them from LabVIEW
What is this for
BOOL WINAPI  DllMain (
            HANDLE    hModule,
            DWORD     dwFunction,
            LPVOID    lpNot)
    return TRUE;
Is it necessary to write this in order to create our own dll?

Similar Messages

  • Can I change which display is primary and which is secondary on my Macbook?

    I'm using an external monitor with my Macbook, and I can easily change the arrangement of the displays. However, I would like the dock and menu bar to be on my bigger external display, but I haven't found a way to do that yet. Is it possible to make my external display the primary one and my Macbook the secondary one? Thanks...

    System Preferences / Displays / Arrangment.
    The display that has the white stripe at the top is the "primary" one, in the sense that the desktop will be on that display.
    You move the stripe - it's really the Menu bar - by dragging it.

  • Simulation model which call functions in an other dll...

    I have a C simulation model that I implement like NI Model Framework template (NI_VStand_Model_Framework_Guide.pdf ). If I use this simple model I can deploy on my PXI. But I must call functions which are in an other dll. When I call functions in other DLL I can't deploy because Veristand specify that the model is not compatible.
    NI VeriStand: The specified compiled model is not compatible with NI VeriStand.
    =========================
    NI VeriStand: NI VeriStand Engine.lvlib:VeriStand Engine Wrapper (RT).vi >> NI VeriStand Engine.lvlib:VeriStand Engine.vi >> NI VeriStand Engine.lvlib:VeriStand Engine State Machine.vi >> Model Execution.lvlib:Initialize Model Loop Data.vi >> SIT Model API.lvlib:Initialize Model.vi >> SIT Model API.lvlib:Load Model DLL.vi
    <append>=========================
    NI VeriStand: Failed to load c:\ni-rt\NIVeriStand\Models\LD1_T1.dll
    If I use DLL Checker there is no bad import.  How to add a simulation model in veristand which call function in an other DLL?

    Thank you for your answer.
    I know how to import a dll in veristand. My Dll  is LD1_T1. I can import it in Veristand without error. But this DLL depends of an other dll (addition.dll) as you can see in the print screen.
    When I try to deploy to my PXI I have an error message of compatibility. 
    NI VeriStand: The specified compiled model is not compatible with NI VeriStand.
    =========================
    NI VeriStand: NI VeriStand Engine.lvlib:VeriStand Engine Wrapper (RT).vi >> NI VeriStand Engine.lvlib:VeriStand Engine.vi >> NI VeriStand Engine.lvlib:VeriStand Engine State Machine.vi >> Model Execution.lvlib:Initialize Model Loop Data.vi >> SIT Model API.lvlib:Initialize Model.vi >> SIT Model API.lvlib:Load Model DLL.vi
    <append>=========================
    NI VeriStand: Failed to load c:\ni-rt\NIVeriStand\Models\LD1_T1.dll
    For LD1_T1.dll I have use NI Model Framework template (NI_VStand_Model_Framework_Guide.pdf ).
    If I check my Dll with dll checker it's ok but I can't deploy. 
    Please somebody have an idee to deploy my model ?

  • Error 1073 when building LabVIEW app which calls LabVIEW dll

    I am trying to use application builder to build an application that calls a dll created in LabVIEW. I get an error referencing a vi within the dll (Parse Stored String(multibyte).vi) saying that "This property is writable or this method is available only when the VI is in edit mode." The only option is to Continue which cancels the build. I had sucessfully built this application prior to including vis that call the dll and the program runs fine in the development environment.
    Do you have any idea what is causing this and what I cam do about it?

    I have found a temporary workaround in which I created a dummy dll that removed all functionality from exported vis but had the same name and function signatures. I then built the application using this dummy dll. Once complete, I replaced the dummy dll with the real dll.
    This is not a satisfactory work around because we have to build and maintain two dlls. Also, I'm not sure we can do the same trick when creating the installer with application builder. So, I'd still appreciate any help you can give.

  • Is there a way to allow DLLs to call sup-application in TestStand?

    Hi,
    I've got a TestStand sequence that calls a DLL function which is generating an EAccess Violation.
    Now this particular function seems to run two seperate sub process of some kind. I can't figure out what they are, but when I run the DLL function in a CVI environment, two items appear on my windows taskbar and then disappear just prior to the function finishing successfully.
    I've been told that TestStand likes to control its environment... my current theory is that the error generated in TestStand during the funciton call has something to do with the function attempting to launch a thread (or some kind of application) and TestStand not allowing it to do so. Is there a way to let the function run mul
    tiple threads without TestStand's permission? Or turning off TestStands control for one step? Or something to that effect?
    I've tried making a DLL wrapper for the DLL function... but it has the same effect since a sub-thread is trying to be created.
    Thanks,
    Marek D.

    Hi Marek D,
    This question appears to be related to another post that you and I were working on before. Does this post -> http://exchange.ni.com/servlet/ProcessRequest?RHIVEID=101&RPAGEID=135&HOID=50650000000800000040520000&UCATEGORY_0=_8_&UCATEGORY_S=0 <- have anything to do with what you are asking now? If it does did you try the suggestion that I mentioned last in the other thread? Your use of the dll in TestStand does not follow the exact same pattern as what you demonstrated in CVI, and this would be a good starting point.
    To answer your question though, no, TestStand does not have a problem with a dll that it loads and invokes functions on trying to spawn new threads. This is a rather common scenario in fact. As I stated before it appears that since th
    e dll is loading fine and TestStand is able to access its functions ok, there is not really a problem with how TestStand interacts with the dll. In fact if there were a specific problem dealing with this dll trying to create additional threads there could indeed be a problem in that its threads are not being managed properly from within inside the dll itself. Trying to guess at how the dll operates is generally a timewaster, unless you know its exact requirements you may never be able to get it to work. It appears that there is either an external dependency you are not taking into account with this particular dll or you are using it improperly in TestStand. Trying my previous suggestion of trying to reproduce the CVI setup exactly is your best bet.
    Jason F.
    Applications Engineer
    National Instruments
    www.ni.com/ask

  • Call multiple functions from same dll with call library function

    hi,
    i am working on a project in wich we need to make a UI to read out a sensor network.
    the UI should be usable in any project, but every node needs a different piece of code depending on the type of sensor with wich it is equipt.
    so i need to be able to call different pieces of code when i need them, and still be able to use the UI in future projects with possibly new types of node we now don't have.
    so someone told me to use DLL's, cause then i would be able to call the code i need the moment i need it.
    but i have never worked with DLL's (just learned about this option 3 day's ago) so i have a question.
    i know i can dynamicly change the DLL i call with the call library function, but can i dynamicly change the function i call from that DLL ?
    or do i have to put a new call library function for each function i want to call, even if its from the same DLL ?
    kind regards,
    stijn

    nazarim wrote:
    ok so there is no (easy and ubderstandable) way for me to dynamicly change wich function i want to call from a certain DLL.
    but now i started wondering, the path on the call library function is not ment to dynamicly change a DLL
    but it does work so, if i am carefull, can i use it for that purpose or will labview give me a series of problems once i start using it in larger programs ?
    Thepath on the Call Library Node can be used to load a different DLL. Obviously since you can't change the function name your other DLL would have to export exactly the same function name and of course with the same parameters. This is seldom the case so it is not the main use of the path input to the Call Library Node. It's main use is as indicated to load DLLs at runtime rather than at load time of a VI. So that an application can run even when the DLL is missing, until the moment the functionality from that DLL is needed.
    If you can make sure that all your DLLs export the same function name with the same parameter you can use the Call Library Node to call into different DLLs through the path input. If however you would need to call different function names you would have to resolve to some DLL which does do the dispatching and invocation using LoadLibrary() and GetProcAddress(). But unless you need to go with DLLs for some reason using the Call By Reference Node can give you an even more flexible approach. 
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • Using an external DLL with "Call Library Function"

    Hi!
    I am trying to use an external DLL which is used from Visualbasic & Delphi:
    http://www.keb.de/common/tools/KEBCOMDriver.zip
    the protKEB.dll accesses the serial port to control an KEB frequency
    inverter.
    Unfortunatly there is no prototype header file for the DLL (no help on that
    from KEB).
    I only have a VisualBasic example program which works with the DLL.
    (Unfortunatly I am no Visual basic expert)
    To initialize the com port I have to use the function: setprotproperties &
    getprotproperties
    they are declared as:
    'Setting the protocol properties
    'ctrl is a pointer to a data structure of type tProtProperty
    Declare Sub setprotproperties Lib "protkeb.DLL" (ctrl As Any)
    'Reading the protocol properties
    'ctrl is a pointer to a data structure of type tProtProperty
    'the desired protocol is entered in ctrl.prottype before calling
    Declare Sub getprotproperties Lib "protkeb.DLL" (ctrl As Any)
    and tProtProperty is:
    Public Type tProtProperty
    ProtType As Long 'Type of Protocol (tProt)
    TimeOut As Long 'ALL protocols
    Baudrate As Long 'ANSI, HSP5
    Comport As Long 'ANSI, HSP5
    Flag As Long 'ANSI, HSP5: 01 = Sendslow
    / IP: 01 = UDP
    Port As Long 'IPort number
    Txtlen As Byte 'IP : length of following
    text or 0
    txt As String * 100 'IP : IP-Address or name
    (maximum length)
    End Type
    I already tried to use a cluster with tProtProperty entries as an Input for
    the function
    setprotproperty in a call library function with:
    Parameter Type : Adapt to type
    Data Format: Pointer to Handle
    but I always get an "exception within external code....."
    What am I doing wrong?
    How does a cluster & a "call library function node" look like that works?
    Any help is really appreciated!
    thanks
    tom
    ,-Thomas Kerberger Physikalisch-Technische Bundesanstalt-.
    | Abbestr.2-12 D-10587 Berlin fon: +49-30-3481338 |
    | mailto:[email protected] fax: +49-30-3481386 |
    `--------Labor 7.33 Messung thermischer Energie---------'

    Thomas,
    LabVIEW cannot call a DLL that has structures directly, you will need to create either a wrapper DLL or CIN that will take in all of the data individually construct the structure, and send it to the DLL function.
    For more information on what a cluster looks like in native code, I would suggest creating a simple cluster, creating a Call Library Function Node on the block diagram with a cluster input. Then right-click on the Call Library Function Node and choose "Create .c file". This will generate the data structure for the cluster and give you a better feel for it. I would then suggest going to the Using External Code in LabVIEW manual that can be found in the LabVIEW Bookshelf (Start»Programs»National Instruments»LabVIEW 6»LabVIEW Manuals or »LabV
    IEW 6.1»Search the LaBVIEW Bookshelf).
    There is also the following: Developer Zone: Passing a Variety of Data Types from DLL to LabVIEW.
    Randy Hoskin
    Applications Engineer
    National Instruments
    http://www.ni.com/ask

  • How to call LabVIEW dll from ATL COM dll

    I have tried to call simple LabVIEW 8.6 Dll from win32 test application, class Library.
    I have include LabVIEW generated SharedLib.h file and SharedLib.lib file in the test application which I created as simple win32 console project and also from win32 class Library. I was sucessfully able to call my LabVIEW dll funtion. 
    But when I create ATL COM project and try to add SharedLib.h file and SharedLib.lib file I used to get following erors
    Error 1 error C2733: second C linkage of overloaded function 'StrCatW' not allowed d:\program files\national instruments\labview 8.6\cintools\extcode.h 463 
    Error 2 error C2733: second C linkage of overloaded function 'StrCpyW' not allowed d:\program files\national instruments\labview 8.6\cintools\extcode.h 464 
    Error 3 error C2733: second C linkage of overloaded function 'StrCpyNW' not allowed d:\program files\national instruments\labview 8.6\cintools\extcode.h 465 
    Error 4 error C2733: second C linkage of overloaded function 'StrCmpW' not allowed d:\program files\national instruments\labview 8.6\cintools\extcode.h 466 
    Error 5 error C2733: second C linkage of overloaded function 'StrCmpNW' not allowed d:\program files\national instruments\labview 8.6\cintools\extcode.h 467 
    these many errors.
    Will some one explain me how to call LabVIEW dll from ATL COM dll.
    Thanks & Regards,
    Jay

    I also had this problem.  My application is unicode-aware, but I was attempting to link it to a library with primitive C-string arguments.  You could dynamically load the DLL as suggested (more work), modify the header files (really not recommended), or if you are feeling lucky you could try fooling the compiler, as I was successfully able to do in Visual Studio 2010, by steering the preprocessor around those functions (assuming you're not using them, of course -- otherwise this probably wouldn't work):
    // prepare for NI extcode.h inclusion. avoid linker errors for this project.
    #define StrCatW(a,b)     IgnoreLinkError_StrCatW(a,b);
    #define StrCpyW(a,b)     IgnoreLinkError_StrCpyW(a,b);
    #define StrCpyNW(a,b,c)  IgnoreLinkError_StrCpyNW(a,b,c);
    #define StrCmpW(a,b)     IgnoreLinkError_StrCmpW(a,b);
    #define StrCmpNW(a,b,c)  IgnoreLinkError_StrCmpNW(a,b,c);
    // header file for my LabView-built DLL (ASCII single-byte character arguments)
    #include <MyLibraryHeader.h>
    // clean up afterwards, put things back to 'normal'
    #undef StrCatW
    #undef StrCpyW
    #undef StrCpyNW
    #undef StrCmpW
    #undef StrCmpNW

  • EXEcutable only starting DLL when calling a popup before.

    Hello,
    1. I have created a DLL in Labview 8.2 with one VI/function.
    2. Then i call this DLL/function in a new VI
    3. Then i created an EXE-file of this VI (which calls a DLL)
    Attached a screenshot of the code.
    As you can see it contains a sequence-structure where in the first part i open a message-popup and in the second-part i call the DLL.
    When i run it like this then it works without problems.
    The funny thing is:
    When i remove the message-popup and create a new EXE-file and run it then nothing happens!
    Only the Run-arrow changes to running-mode (and stays there until i close it with taskmanager) but the outputs dont-change (they stay "0").
    (The VI in the DLL that i call is very simple. The Inputvalue "11" is added and multiplied. This two results are returned. So nothing special.)
    Whats wrong here? Seems like Labview can´t make the DLL-call starting in the second exe-file (without an popup before).
    Is this a kind of a bug?
    Thanks for your help and ideas
    Attachments:
    screen.jpg ‏26 KB

    Hmm, i´m getting a red error-message after cklicking on "install LabVIEW 8.2.1 now." in your link.
    Whats going wrong here?
    --> See attached screenshot
    Attachments:
    error.jpg ‏54 KB

  • Can not find size_t during import a dll and calling a function crash labview

    Hello, experts
    I need to use FingerLakeInstrument  DLL ( see the attached) inside Labview to talk to a CCD camera. it is built from microsoft visual studio C++
    I unzip FLI dll in my D:\proj\...\linfli-32 and import dll from there. created a c:\FLIDBG.txt as FLI dll needs to write debug message to it if FLISetDebugLevel() or others are called.
    During importing the dll, first thing I got is <sys/types.h>  ( ie size_t ) cannot be found. I have installed free version of microsoft visual studio C++
    but can not find "typedef unsigned int size_t"
    at the end, I just added
     typedef unsigned int size_t;
    in the libfli.h. Having done that, I am able to import all functions into Labview and have a user library called libfli.
    However, as soon as I start calling a simple function in a test.vi, such as FLIGetLibVersion(char* ver, size_t len), which involves nothing other than the library, the labview will crash.
    I created a simple C test.exe which calls many functions without any problem
    any suggstion?
    regards
    xiaofeng
    Solved!
    Go to Solution.
    Attachments:
    libfli-32.zip ‏93 KB

    Hi, Smercurio_fc
    thanks for your reply. Yes, you are pointing to the right place.  I have solved the crash problem.
    when importing DLL into Labview using Tools\import\Shared Library (.dll), Labview automatically set the calling convention as C not as stdcall (WINAPI).  it is this that later the labview crashes when a function is called.  as soon as I manually re-selecte calling convention as stdcall, my test.vi works OK (see attached).
    I tried Call Library Function too to call libfli.dll, as long as I select stdcall as call convetion. the test.vi works.
    How do I know which Call convention I need to choose if  there is no infomation from DLL provider?
    as for the size_t,
    I add   #include <crtdefs.h> in libfli.h and 
     add additional include path as
    C:\Program Files\Microsoft Visual Studio 10.0\VC\include.  this  solved the "not found" issue.
    for this case I know that the DLL is built from VC++,  is this right way? 
    again, thanks for your time.
    xiaofeng
    Attachments:
    test.vi ‏13 KB

  • Can a VI compiled in dll be called in LV?

    Hello,
    I have some dll´s, which use some common VIs. This means, each time when I compile a dll, the VI will be compiled within the dll. What habbens, if I compile the same VI in another dll, and call the dlls in the same time. Will be there a collision, that the VI is already loaded , by calling the second dll?
    regards
    Mitulatbati

    Maybe I did not understand the question correctly...
    If you have a vi that is compiled into a dll and then from another vi (main) you call both the original VI and the dll, it should not collide as you would be calling different objects.
    Have you tried it and having problems?

  • Necessary system dll before calling SAPbobsCom.dll

    Hi:
    I am using an application which allows me to call dll files in a specific folder. Hence, when I call SAPbobsCom.dll, the application needs related dll's supporting SAPbobsCom.dll. Could you tell me whatelse dll's are needed for calling SAPbobsCom.dll?
    More detail: A normal application will check dll's registerred in the OS and use them. However, what I am using is not. Hence, I need to know what dll's registered to the OS are required by SAPbobsCom.dll. Thanks a lot

    Hi
    You can use e.g. Microsoft's "Dependency Walker" (<b>depends.exe</b>).
    It is part of the tools shipped with MS Visual Studio, the Windows Resource Kit Supplements etc. (see the Microsoft home page for more: search e.g. for "depends.exe" or "198038 +depends.exe").
    HTH,
    Frank

  • Is it possible to step into a CVI dll when called by TestStand?

    As the question says: "Is it possible to step into a CVI dll when called by TestStand?"
    I am sure Ray F. may have a few tricks up his sleeves...  Hope you see this post, Ray!
    I compiled a dll using CVI.  The dll is called as a test by TestStand.
    I do have an "exe" version of the code that I use for debug with a testbed, but the behaviour is not the same as testing the actual target while running TestStand.  My goal is to get as close as possible to the real events.
    Thanks,
    JLV

    Sorry about that,
    There are two ways as I was saying:
    1. You can configure the CVI adapter to Execute Steps in a External Instance of CVI (requires CVI 6.0 or greater).
    Only go to Configure->Adapters and select the LabWindows CVI adapter and click on configure and select the corresponding option.
    After that set a break point in the step that you want to debug.
    An external instance of CVI will be launched where you can set break points and step into the code.
    2. From CVI Specifying an external process:
    In CVI go to Run Specify External Process and enter the seqEdit.exe as the program name (you have to browse to the location <TestStand>\Bin\SeqEdit.exe).
    As the argument you enter the name of the sequence file you want to debug.
    Now just select Run->Debug SeqEdit.Exe
    The Sequence Edtior will be launched and you can set break point in your CVI code and step into it when the step is executed.
    Check the Using LabWindows/CVI with TestStand reference manual for more information.
    I hope it helps you to get started.
    Regards.

  • Error 0x80040707 - DLL function call crashed QTInstallCode

    Installing QuickTime Stand-Alone QuickTimeInstaller.exe Version 7.0.4.0 I get the following error and QuickTime will not load or function:
    Unhandled Exception
    Error Number: 0x80040707 - DLL function call crashed: QTInstallCode.QuickTimePostInstallProc
    Setup will now terminate.

    I was able to solve this, but I had to uninstall all instances of iTunes, ipod and QuickTime, delete their directories, use http://support.microsoft.com/kb/290301/
    to delete the installations of each and then use msconfig to remove them from the Startup.
    After that I rebooted and did a new install with the QuickTime Stand Alone and it worked!

  • Call a special function in the dll using Call Library Function Node????

    Dear all,
          I am calling a special function in the dll using call library function node. There is a input parameter that it is a enum type in this function. I don't know how to deal this parameter for calling this function.Has anybody solved this problem?Please advise!
          I am appreciated of you anytime. 

    Most of the times an enum is just a U8/U16/U32, internally so probably you can call it with just a U8/U16/U32 or something. For the correct value you have to look at the definition.
    Ton
    Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
    Nederlandse LabVIEW user groep www.lvug.nl
    My LabVIEW Ideas
    LabVIEW, programming like it should be!

Maybe you are looking for

  • HT1766 Choose File Devices Back up is greyed out and not an option?

    i smashed the screen on my 5s ... i got a new one... File > Devices > Back up does not seem to be an option when i plug in my iphone with the cracked screen..... so i tried to plug in my smashed one to back it up and transfer using my itunes that i j

  • Computer Won't display video

    Ok so yesterday I went to put my computer into sleep mode, and when I did the power button started blinking orange. So I tried waking it up from sleep mode and it wouldn't wake up. I turned the computer off by pushing the power button and now when I

  • Cross-Tab Report Custom Date

    Hello everyone, I need some help with changing the date interval in Cross-Tab Reports. I ran the report annually; however, the dates I want to run is really specific. How can I change the date intervals? Is this possible? Date below are 01/01/12 - 12

  • Common doDML method for  EOs

    JDev 11.1.2.3.0 I have more than one entity objects and all have some common columns: Last Update By, Last Update Date. Instead of going to each Entity classes and overriding doDML method for setting the last update date values for every DML transact

  • I have a valid copy of Premiere Elements 11 that does not open past the Elements 11 Organizer Adobe Software License Agreement

    My copy of Premiere Elements 11 will not open. I'm on a PC with System 7. When I double-click on the PE11 desktop icon, the window opens that says Elements 11 Organizer Adobe Software License Agreement. I select English (North America) and "Accept".