Import dll

I am trying to import a dll. All of it. I will need almost all of the functions. I have tried using the Import Library Function Node, but I realized that it is very time consuming. Also, there are functions spanning too many different header files. so I am trying to use Tools -> Import -> Shared Library (.dll). I get stuck with preprocessor directives. I am posting step by step:
The message for the first function is:
The function cannot be imported into LabVIEW. This might be caused by one of the following problems:
The function is not declared in the header file but is exported in the library.
Check the header file to make sure it contains declarations of the function.
Undefined symbols can prevent the wizard from recognizing functions and parameters. To correct this problem, check the header file to determine if you must add preprocessor definitions. Click the Back button to return to the previous page of the wizard to add a preprocessor definitionsl (for example, "NIAPI_stdcall = __stdcall" or "NIAPIDefined = 1").
GENAPIC_EXPORTS;GENAPIC_LINUX_BUILD;GENAPIC_WIN_BU​ILD;MIDL_PASS;MRTDLL;PYLONC_BOOL_DEFINED;PYLONC_EX​PORTS;RC_INVOKED;UNALIGNED;_CRTDBG_MAP_ALLOC;_CRT_​ALIGN;_CRT_ALTERNATIVE_INLINES;_CRT_DISABLE_PERFCR​IT_LOCKS;_CRT_FORCE_MANIFEST;_CRT_GETPUTWCHAR_NOIN​LINE;_CRT_MANAGED_HEAP_NO_DEPRECATE;_CRT_MANAGED_H​EAP_NO_WARNINGS;_CRT_MANIFEST_DEBUG;_CRT_MANIFEST_​INCONSISTENT;_CRT_MANIFEST_RETAIL;_CRT_NOFORCE_MAN​IFEST;_CRT_NONSTDC_DEPRECATE;_CRT_NONSTDC_NO_DEPRE​CATE;_CRT_NONSTDC_NO_WARNINGS;_CRT_NON_CONFORMING_​SWPRINTFS;_CRT_OBSOLETE_NO_DEPRECATE;_CRT_OBSOLETE​_NO_WARNINGS;_CRT_SECURE_CPP_OVERLOAD_SECURE_NAMES​;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES;_CRT_SECU​RE_CPP_OVERLOAD_STANDARD_NAMES_COUNT;_CRT_SECURE_D​EPRECATE_MEMORY;_CRT_SECURE_NO_DEPRECATE;_CRT_SECU​RE_NO_DEPRECATE_GLOBALS;_CRT_SECURE_NO_WARNINGS;_C​RT_SECURE_NO_WARNINGS_GLOBALS;_CRT_SECURE_WARNINGS​_MEMORY;_DEBUG;_DLL;_MSC_EXTENSIONS;_MSC_VER;_MSC_​VER_GREATER_THEN_13102050;_MT;_M_AMD64;_M_CEE;_M_C​EE_MIXED;_M_CEE_PURE;_M_IA64;_M_IX86;_PFT_SHOULD_C​HECK_RETURN;_PFT_SHOULD_CHECK_RETURN_WAT;_PFT_VER;​_POSIX_;_PREFAST_;_STATIC_CPPLIB;_TRUNCATE;_USE_32​BIT_TIME_T;_USE_ATTRIBUTES_FOR_SAL;_VC_NODEFAULTLI​B;_W64;_WIN32;_WIN64;_X86_;__BORLANDC__;__CRTDECL;​__GNUC__;__cdecl;__cplusplus;__cplusplus_cli;__lin​ux__;__midl;
Most of these should be undefined. For example, there is:
#ifdef GENAPIC_EXPORTS
//do A
#else
//do B
And I want it to do B. But this is complaining that GENAPIC_EXPORTS is undefined... How to get around that?
I am attaching PylonC.h file which I think is enough to help me. The rest of the whole api is available on basler's website: http://www.baslerweb.com/MV_Customer_Service_Downl​oads_pylon-Linux-Text-16855.html. I am using Pylon 3.0 64-bit , C version.
Attachments:
PylonC.h ‏33 KB

you forgot to add the genapi include directory path in the second step. Your include file references this here:
#include <genapic/GenApiC.h>
And don't try to generate wrappers for DLLRegisterServer and DLLUnregisterServer.
And last but not least, don't expect the Import Library Wizard to create magic. It can create the DLL caller VIs for you but it can not guess at how this API should be used. A C header file only gives information about how to link to the function, but none at all about how to use it. A LabVIEW VI usually also implements quite a bit about how the API is used (preparing parameters such as preallocating output buffers, etc) that is really impossible to deduce from the header file alone. It's what a C programmer continously has to worry about when calling functions and since you are incorperating this API into LabVIEW you have to worry about it too. Otherwise it will just cause exceptions.
So you will have to go through every and each VI and check it for such problems, which is really the hard work. Creating the VIs that call the functions with Call Library Nodes may seem like a lot of work, but once you have done one or two it's absolutely trivial in comparison to the real hard work that the Import Library Wizard can't do for you at all.
Rolf Kalbermatter
CIT Engineering Netherlands
a division of Test & Measurement Solutions

Similar Messages

  • Programmat​ic access to Import DLL Wizard

    Our company does a number of products, and would like to cut down time when working with the SDK. I am almost pleased with the import wizard in 2012, but I would like a few things changed. I have all the code ready to modify the output from the import DLL wizard with the scripting module, but if I could have it automatically generate and run the whole thing (possibly through a command line post-build instruction in Visual Studio), that would save some hassle.
    It's not a big deal. I just wanted to speed up the process a little, since our SDK format doesn't change. We had a custom VI generator for our SDKs before, but it gets 95% of the way there, and the wizard does everything we missed and gets about 95% of the way there as well. That, or I could try to convince my coworkers to accept the output from the wizard.
    Solved!
    Go to Solution.

    Since the SDK was already released it is probably not an option anymore, but you can certainly increase the chances for the import library wizard to do a good job by choosing standard API parameters. Basically this means to only use skalars (passed by value or reference), C strings and simple arrays. Never use structs that contain arrays (both fixed size or not). Structs only containing skalars are fine though, but don't create structosaurusses, the C equivalent of clustersaurusses in LabVIEW, big unwieldy structs/clusters.
    Then you have to review all the VIs that use output array or string buffers to let the called function write into, to make sure they are preallocated to a reasonable size for the used function.
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • Can't import DLL

    Hi All,
    I'm trying to use the libsie API to open .sie files from SoMat (there is a plugin for this data format for LabVIEW and DIAdem but it doens't work). I've previously imported dll's using the import wizard with a lot of sucess but I dont' know my way around c or c++ so am a bit stumped on this one. When I try to import the attached dll (you'll need to chage the extension from .doc to .dll) using the attached header file none of the calls show up. They are there in the header file. I'm wondering why this is. Is it a badly formattted header file or is there some other issue?
    I've attached a copy of the zip file that I downloaded from the HBM website. There is a demo .sie file in there if you want to look at one. There appears to be pretty comprehensive documentation on the API on the website.
    Any help or pointers gratefully received.
    Phil
    Solved!
    Go to Solution.
    Attachments:
    sie.h ‏27 KB
    libsie-1-0-0-bundle.zip ‏5817 KB
    libsie.doc ‏160 KB

    It doesn't matter what language was used to create the DLL, so long as it exports a C-compatible interface (which it does).
    If you make a copy of the header file and remove SIE_DECLARE(), leaving whatever is inside the parentheses unchanged, from each function declaration, I suspect you'll be able to import at least some of the functions. I don't know how well the import utility will handle the pointer data types, you might have to edit each Call Library Function Node to fix them manually after importing.

  • Labview 8.20 Crash using vi's created with import dll wizard

    Has anyone had issues with the DLL wizard or DLLs that use the USB port?
    I have used the DLL import wizard to create an instrument driver for a picoscope 3424. When I run the Initaization.vi it exicutes properly, however, if I close the vi I get the Labview must be closed, send an error report to Microsoft blah,blah. If I disconnect the PicoScope (unplug the usb cable) then close the VI no error happens.
    Once I received the Labview invstigate error and sent the data to NI (REF#7134654).
    I had a driver written with LV 7.1.1 that worked with out any issue, I converted the 7.1.1 vi's to 8.20 and I no longer have the issue. This leads me to beleive that there may be a bug in the DLL wizard.
    Andrew Alford
    Production Test Engineering Technologist
    Sustainable Energy Technologies
    www.sustainableenergy.com

    I'll try to answer your questions.
    a) Yes that is correct, the source files are avaliable for download at http://www.picotech.com/software.html.
    b) I have found some issues with the available settings in the DLL Import wizard, one is there is no availble choice for setting the parameter type to array. This is available when you right click on the CLN and select configure. I checked the configurations of the open unit and close unit nodes and they look the same. I have also noticed that the block diagrams created with the DLL Import wizard are very messy with overlaping wires and poor wire routing.
    c) The original wrapper I created was done quickly and I only created the functions I needed at the time, I was attempting to create a proper Insturment Driver project and wanted all of the functions to be created, this is why I was using the import wizard.
    I am still at a loss as to why disconnecting the instrument from the USB port prevents this crash from happening.
    For now I have reverted to the 7.1.1 wrapper converted to 8.20 as I do not have time to continue investigating this issue.
    Thank you for your response.
    Andrew Alford
    Production Test Engineering Technologist
    Sustainable Energy Technologies
    www.sustainableenergy.com

  • Import DLL with unicode in Labview

    Hi all,
    i am developing a software user-friendly to control a home-made microscope. I would like to install a Andor camera and to control it i have to import the dll of Andor SDK v3 but Labview cannot see any function from the header file because of a Unicode compatibility with LAbview (apparently Labview cannot read Unicode from the dll). Do you have any idea how to solve my problem ?
    thanks
    regards
    Philippe

    The problem you are having is a limitation with the Import Wizard. You should be able to configure the Call Library Function Node manually. As for Unicode support in general, you should read this article: http://decibel.ni.com/content/docs/DOC-10153

  • How can i import dll files in java project in eclipse?

    Hi All,
    How can i import or link dll files in java project in eclipse?....
    dll files contains
    import com.ms.com.ComLib;
    import com.ms.com.Variant;
    import com.ms.com.ComFailException;
    import com.ms.wfc.data.AdoException;
    import com.ms.wfc.data.AdoEnums;
    Any idea of this please tell me.....
    I am using eclipse 3.4 and JRE 1.4
    Is this possible?
    Please tell me!!!!!!!!!!!!!
    Voddapally

    iMovie cannot edit mpg files, unles they come directly from a supported camera.
    I would suggest that you use a free third party app to convert it.
    Get MPEG Streamclip from Squared 5, which is free.
    Drag you mpg clip into MPEG Streamclip.
    Then, FILE/EXPORT USING QUICKTIME
    Choose Apple Intermediate Codec, and save it where you can find it. You should be able to import this file into iMovie, using the FILE/IMPORT/MOVIE command.
    Note: If your file is an MPEG2 clip, you may need to purchase the Apple QuickTime MPEG2 Playback Component from Apple. MPEG Streamclip will tell you if you need this. Don't buy it unless you have to. It costs about $20. You just have to install the component. MPEG Streamclip will use it in the background.

  • Import dll callback function

    Having trouble with this line "void   (*m_callback)(_t_pciCommand *cmd);" in PciApi.h file. I have replaced it with NULL and was able to import 2 functions, PciAllocCommand and PciSendCommand. I was then able to get valid information using GetValueByPointer.VI, but crash most of the time.
    typedef struct _t_pciCommand
                    t_pciCommandType                      m_command;
                    t_commandError                          m_error;
                    long                                               m_gpVal;
                    void                                                (*m_callback)(_t_pciCommand *cmd);
                    long                                              m_param[MAX_PCI_PARAMS];
                    int                                               m_state;
                    int                                               m_retries;
                    int                                               m_expected;           
                    long                                            m_origParam[MAX_PCI_PARAMS];
    } t_pciCommand;
    All files attached. Based on this callback funtion, I can't seem to resolve 2 functions, called PciAllocCommand and PciSendCommand.
    Thanks,
    John
    Solved!
    Go to Solution.
    Attachments:
    PciApiDll7.zip ‏630 KB

    The manual is "pci_api_manual_jb.doc", The funtion I care most about is PciAllocCommand and the #1 issue I have is how to pass "m_param[0]" , "m_param[1]" and "m_param[2]" to the dll. The original h file is "PciApp(original).h" . The second issue would be if removing the callback functionality I need a VI to poll the status of "t_PciCommand "Function without writing to it.
    For example, PciAllocCommand(c_baudrate, NULL, 0). How do I set baud = m_param[0]?
    Also I am adding a TestApp.exe example of what I want to do in Labview, focusing on the Param1 and Param2
    Attachments:
    PciApiDll7.zip ‏630 KB
    TestApp.zip ‏67 KB

  • Import DLL Into Java Program

    Hi,
    I wish to import a DLL file written in Visual Basic into my Java program. How can i write such code so that I can work with the DLL files inside my Java program and pass result out to DLL files again.
    Thanks

    You need to use the Java Native Interface. You can find all the information you need here:
    http://java.sun.com/docs/books/jni/index.html

  • Import dll file into Flash 8

    Hi!
    Anyone knows if it’s possible to import a dll file into
    Flash, or, if flash can connect in some way to a dll file?
    Thanks in advance
    Paulo

    Well object expand is what I did then copy and paste, I am not certain of the reason to crop.
    this is what i got when I expanded copied and pasted. so I do not think the crop is necessary it pastes as a symbol and the symbol is clipped which I think is what you want.
    But if in this case you want the stroke as well once you select anyone of the countries they have no stroke according t the tool bar proxy and so it you give it a stroke using say a swatch and then expand copy and paste you get both the fill and the stroke if you desire the stroke as well.
    In the case of France and Paris once you paste those into Flash after you stroke and expand then you select both the city and the country and make that into a symbol so that they are one.
    And I notice from the art you sent all you have to do is select a country expand, copy, paste and then undo the expand and you are good t go do your work.

  • Import DLL library

    I have a question about DLL's. I have a DLL from an application and I need to use some functions from this DLL. How can I do that? As an exemple my dll is mydll.dll and use this dll to print, it's useful in VBA. I use the function F_PRINT from it. How can I use this same function in ABAP? I tried the SOLE tcode but doen't work. Any ideia?
    Thanks everyone.

    is it a activex dll, if yes then check out the following weblog where i had used MS text to speech control in ABAP
    Make your SAPGUI Talk
    this may give you an idea on how to go about.
    Regards
    Raja

  • Error 1904.module failed to register \importent.dll files HRESULT -10737407

    Hi,
    I'm trying to install BOE on the E drive, but i'm getting this error  "error 1904.module failed to register C:
    Program Files(X86)\Business Objects\BusinessObjects Enterprise 12.0\win32_x86\importent6.dll files HRESULT -1073740791".
          1.My question is eventhough i'm installin on E, by default i think its trying to load some folders/files on C drive. Is this error because of some permission/rights on C drive??
    2. What does this error mean?? Can we ignore this error- will it have some problems in future??
    Could someone please help me on this....
    Thanks,
    Rajini
    Edited by: Rajini V on Nov 30, 2009 8:22 AM

    Thanks Seb.
    I have the administrator rights. 
    I have now cleaned up all the instances and registry entries for the same and started a fresh installation on E drive.
    But the 'Importent6.dll' file is not getting registered.
    I'm getting the error :
    u201Cerror 1904.module failed to register E:
    Program Files\Business Objects\BusinessObjects Enterprise 12.0\win32_x86\importent6.dll files HRESULT -1073740791u201D
    Why do we get this error?? How can I overcome this??
    Regards,
    Rajini

  • J2me DLL Importing

    Hi everybody,
    I will have to develop an application which could be running on cell phones, PDA and other mobile devices.
    I am looking for a mobile technology which allow me to import DLL.
    - Does J2me can use external library writting in C or C++ ?
    - I have read an article about JNI. Is it the only solution to use native code ? As i will use a library which won't be develop by myself, is it possible to call a .dll file using the System.loadLibrary() method ?
    Thanks for your advice,
    Bye.

    to sum it up, you have the following possibilities if your existing library code is c/c++:
    - port the code to java and include it in your midlet jar. the best bet if you want to keep it portable and usable on as many devices as possible.
    - port the code to windows ce and accept that it will only run on windows mobile devices. the easiest way if it's already written for windows i guess.
    - port the code to symbian and accept that it will only run on symbian based devices. depending on the code, easy, difficult or impossible to do. symbian has many restrictions. j2me too, though.
    - port the code to any other smartphone platform, like openmoko, the iphone (using the native api or via a web service), android, maemo, ... maybe more difficult to do than the other possibilites. and the number of devices the applications runs on will be lower than for the other platforms. but you're less restricted in what you can do.

  • Import wizard dll --- fichier .h ( demo en ligne ) ---

    bonjour, j'ai visioner la démo d'utilisation du gestionnaire de dll  dans labview 8.2   ( version de d'évaluation )
    ( import dll...)
    J'ai essayé avec une dll d'une application ( free ) , mais il faut y joindre un fichier en-tête *.h
    J'comprend pas trop a quoi sert ce fichier *.h et surtout ou le trouver par rapport à une dll qu'on veut utiliser
    Faut-il le créer, ? comment ? quel nom ?
    Pouvez vous m'aider
    Merci

    mouais, j'ai fini par trouvé

  • Dll import

    dear forum.
    I cant understand a base matter about dl.
    I know how to import dll in VS and use. But in some code, i read programmers need to 
    use in C++ the LoadLibrary and GetProcAddress
    for reference to internal function .
    Why
    Thanks

    On 30/03/2015 16:16, Robiberto wrote:
    I cant understand a base matter about dl.
    I know how to import dll in VS and use. But in some code, i read programmers need to
    use in C++ the LoadLibrary and GetProcAddress for reference to internal function .
    Why
    I'm not sure what you exactly mean by "reference to internal function".
    But I'd like to share a possible scenario with you.
    Suppose that you have an application supporting some form of extensibility architecture via plugins.
    Each plugins can be implemented using a separate DLL.
    And, of course, you don't want to rebuild your application from scratch with every plugin's .lib file.
    Suppose that each plugin requires initialization, and to do so the plugin DLL exports a "PluginInit" function.
    Your application could scan the content of a given directory (e.g. a folder named "plugins" under the application's folder), and, for each plugin DLL found, it could use LoadLibrary() and GetProcAddress() to get access to PluginInit() for each
    DLL, and call it to perform plugin initialization, for each DLL.
    Giovanni

  • 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

Maybe you are looking for

  • Java Web Start application failing on my user account

    Hi All, I've been tearing my hair out over this for a while and haven't been able to get anywhere wiht it. I've finally cracked and decided to post a plea for help in here. Basically, I have a web start application that will not start under my user p

  • How to connect apple tv directly to computer using ethernet

    ok so im trying to figure out a way to plug in the Apple TV directly to my computers Ethernet port for direct streaming.  I am not allowed to use a router(College) so the only way i can possibly hook the Apple tv is directly through my computer ether

  • How can I work on a .ihtml file in Dreamweaver CS3?

    Hello, Can someone tell me how I can make Dreamweaver CS3 treat a .ihtml (html based template) file like a standard .html or .htm file? I can open the ihtml file in DW, but can only work on it in Code View. Is there a way to make DW parse the file so

  • Is PrProCS3 able to encode H.264 Blu-ray file?

    It seems I overestimated the capabilities of CS3.  I have been unable to export a file to create a Blu-ray disc. System specs: 2009 Mac Pro 4,1 3.33GHz Quad core ATI Radeon HD 4870 512 (Apple) 16GB RAM 640GB HD for OS X 10.6.4, and all programs 3x 1T

  • ICloud Outlook add-in causes Outlook to hang for 30-120 seconds each time I enter the Calendar.

    The iCloud add-in for Outlook seems to be causing some issues with my Outlook calendar: each time I go from the Mail tab to the Calendars tab, Outlook freezes for a minute or two and then resumes functioning. The problem is definitely with the iCloud