Thrid party DLL function call.

Hello,
I am a programming novice trying to learn more about Java. I am currently working on a project for my employer (a side project really) that is used in generating some specific alpha-numeric codes. Actually, I am re-writing an existing program into Java as a personal exercise for myself but it may have some useful applications down the line.
This project requires me to use a 3rd party DLL function call. I have been trying to follow through the process of using the JNI interface, however, I believe that I need to create a wrapper DLL to handle the function call. Does anyone know how to do this or can they point me in the right direction? I believe the 3rd party DLL was written in C++ but that's all I know at this point.
Any help is appreciated.
TIA

To those of you who will look this topic up and wonder how I was able to do that here:
(using Visual C++ for the example)
3rd party DLL : Key32.dll
wrapper DLL: Key32Liaise.dll
SWIG interface: Key32Liaise.i
wrapper class: Key32Liaise
1) Make reference to your external function call as if it were a class method. The class name should be that of your "wrapper" class. (e.g. Key32Liaise.getHashCode() ) I like to call the wrapper class the "laise" class because it acts as the go-between.
2) Download SWIG. Create your interface file and run the command: swig -java -shadow -c++ Key32Liaise.i This will generate Key32Liaise.java shadow class and Key32Liaise_wrap.cxx wrapper code.
3) Compile the Java code into Class files and generate a header file for the wrapper class (i.e. javah Key32Liaise). You will need this header file even though the SWIG site doesn't mention this.
4) Open VC++ and open a new project file Key32Liaise to create a DLL. Write the C++ code that calls up the function from the Key32.dll file. You will have to look that up from the MSDN site...too much to put down here.
5) Include the appropriate files and complile the wrapper DLL.
Hope that make sense!!!

Similar Messages

  • 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!

  • Thrid Party DLL File

    Hi,
    How to use Thrid Party DLL File through Java Access Bridge or Any other way.
    Thanks

    You should find the information at http://java.sun.com/products/accessbridge/docs/index.html

  • Error: 0X80040707 DLL Function call crashed: QTInstallCode.QuickTimePostIns

    Hi,
    After installing the latest Quicktime on my XP 64-bit OS I get the following error message:
    Error: 0X80040707
    Description: DLL Function call crashed: QTInstallCode.QuickTimePostInstallProc
    Running quicktime and iTunes has not been a problem in the past.
    I done have absolutely everything that is avaliable on the support site. And I still have had no luck. Please help, I really appreciate it.

    That worked. Thanks for your help.
    I hope I dont have to encounter this problem again with Apples next release of iTunes or for that mater Microsofts next update patch.

  • DLL function called on input change

    Hi everybody,
    I know this is very basic; but I didn't get it by my own. I'm very new to LabVIEW and wasn't able to find a solution in the forum.
    I want to call a function from a DLL every time when I press a button; but unfortunately the function is only called at start-up.
    So, how can I call a DLL function on a change of some input?
    I attached a screenshot. With the stuff I tried. It didn't work. Now the function is called twice during start-up.
    Thanks in advance and best regards,
    Chris
    Solved!
    Go to Solution.
    Attachments:
    2014-12-22 03_32_04-PwrInterface.vi Block Diagram _.png ‏7 KB

    Hi Dennis,
    Thanks that helped me out. Now I know also where to find good examples.
    Thank you also Natas!
    Best regards
    -Chris

  • How to get parameter information on DLL function call (CVI) in TestStand?

    Hi,
     I wrote a simple Instrument Driver in CVI, and it has 3 parameters Voltage, Current, Channel.
    I made a DLL in order to call this function in TestStand as an action.
    That works fine, the only problem I have is that it shows my function as DC_Conf (arg1, arg2, arg 3) and I only get the type information like double double int.
    I do not get the parameter names Voltage, Current, Channel...
    How can I get this information to be displayed in TestStand so I know which parameter arg 1-3 is Voltage,Current,Channel in case I forgot?
    or 
    Is there a way to display the help text of the driver in TestStand?
    I tried clicking on the (?) button next to the function call but it did not do anything...
    My TestStand is version 4.1
    Thanks...Ness

    Ness,
    When TestStand populates the parameter information, it does so by looking at the dll's type library.  CVI automatically creates a type library for a dll based on the function's signature, which can include the parameter names.  However, if the function prototype does not contain variable names, then CVI cannot include names in the type library.
    You can define your own type library to directly control the information available to TestStand from your dll.  If you want to define your own type library, you can do so using a .fp file.  This will allow you to use complex data types (such as structs), and to rename your parameters.
    Here's a KnowlegeBase describing the process: Embedding Type Libraries in a LabWindows/CVI DLL for use in TestStand
    Either solution proposed here will work, and they each have tradeoffs:
    You can definte the variable names in the function prototype.  This keeps the functions self-documenting, and is the easiest solution.
    You can create a .fp file and define your own type library.  This allows you the most control over exactly what you will see in TestStand, but requires you to create a new file, and to keep that new file up to date if you make any changes to your source code.
    Message Edited by Josh W. on 12-11-2009 01:08 PM
    Josh W.
    Certified TestStand Architect
    Formerly blue

  • Dll function calls from VB6 to Labview do not work.

    HI,
    We are transferring our production test systems from VB6 to Labview, and we are using "CAN-AC2-PCI" cards. When call functions of dll "canacpci.dll", UUT does not response at all, and Labview program does not report any error either. Attached are the user manual and my labview codes.
    I guess the DeviceNe_init.vi works because if run it twice, second runing will report error. To correct the error, the card has to be closed first..
    I close the card first, then initialize it. After then send the data. But I can not see any communication by DeviceNet Analyzer when sending data.
    All function parameters are copied from existing VB6 program. The VB6 program works fine.
    Please help me out,
    Thanks,
    Xiang Zhan
    Attachments:
    DeviceNe_init.vi ‏36 KB
    DeviceNet_SendDataXXXX.vi ‏18 KB
    CAN-ACx-PCI.pdf ‏139 KB

    Hi Turck,
    I'm not familar with this device, and it is difficult to say in this case.  I would recommend calling into National Instruments support or contacting the vendor of the device for additional assistance in this case.  As this isn't one of NI's Industrial Communications devices, you could also post on the LabVIEW forums for additional assistance, as there are a lot more people looking at that board than this one.
    Thanks!
    Matt S.
    Industrial Communications Product Support Engineer
    National Instruments

  • Getting the:   Error Number: 0x80040707 Description: DLL function call....

    solution that worked for me (copied from another site):
    I found this solution on another website, but I wanted to share it with all of you here. The problem seems to be with the automatic updating of iTunes. Apparently it can whack-out if you have any older version of Quicktime installed.
    Here's how I fixed my iTunes: I uninstalled both iTunes AND Quicktime and then restarted. I then went to www.oldversion.com and downloaded an old version of Quicktime. In my case I wasn't sure how old I should go, so I chose Quicktime 6.4. I downloaded and installed that older version, restarted, then UNINSTALLED Quicktime again. This install/uninstall helps clear out any older registry entries that might be interfering with the new installation. Once I had uninstalled the old version, I rebooted one more time and then installed iTunes, and iTunes is working again!
    So, to recap: Uninstall both iTunes and Quicktime, Restart, Install old version of Quicktime, Restart, then Uninstall Quicktime, Restart, Install iTunes.
    I hope this helps someone else, because I know how frustrating it can be not to have iTunes.
    dell dimension 4600   Windows XP  

    PhotoShop has its own forum:
    http://forums.adobe.com/community/photoshop
    Ken

  • Quicktime 7.0.4.0 DLL Function Call Crashed Message Error 0x80040707

    Quicktime 7.0.4.0 won't install and the above error message occurs, and because that program won't install, the latest version of iTunes won't install either. What's the solution?
    Others have posted the same problem, but I can't find any answers on this Board, thanks.
    Gareway   Windows XP   Athlon 64 dual core

    That worked. Thanks for your help.
    I hope I dont have to encounter this problem again with Apples next release of iTunes or for that mater Microsofts next update patch.

  • Error: 0x80040707 DLL Function Call Crashed: PSAPI Enum Process

    can ANYONE help me with this one. Ive just bought an iPod Nano and have tried to install the cd. It tries to go through the process but then i get this error message.
    Its really irritating cause i have searched the internet for this error and can not seem to find a solution.
    From a few sites ive been on it looks like it might be the Service Pack I have on XP. I have SP1 and i read that i need SP2 to run itunes. Is this correct?
    Any help would be VERY much appreciated.
    Yvonne

    hi thank u for ur reply. i have gone to windows update and it gives me a list of things that can be updated. It mentions service pack 1 but does not say that it will update to service pack 2. Is this something that can be definitly done or does it depend on how old or updated the computer is?
    Apolgies if i sound stupid on this one, im not too hot with computers!!!!

  • Reading a line from a third party software using call dll function.

    Hi,
    I am using a third party software in Lab VIEW.
    I am having trouble using one of the functions defined in the dll.
    I have the VI attached here, As u can see in the VI I am not sure how to use the function
    LCOM_MasterGetLine in the fourth sequence.....
    This has three parameters and they are
    (int ID,char*Buffer,int Length)
    What basically happens with this function is this...
    /* ROUTINE LCOM_MasterGetLine
    It Reads line of maximally Length characters from Slave ID into Buffer and the parameters are
    * ARGUMENT(S) ID ... Slaves ID
    * Buffer ... Where do you want chars (at least Length+1 in size)
    *Length ... How many at most (should be less than LCOM_MAXLEN)
    Can
    any one help me how to define the input parameters for this function, for example in the fourth part of the Vi attached here.
    What I understand from the function is that, the third party software when it sends a line, that line is stored in the input parameter...buffer ...that is defined to the dll.
    Can any one help me how to then read what line has been sent from the third party software.
    I am including the dll file and also the header file here.
    Thanks a lot,
    Ajit
    Attachments:
    New_Folder.zip ‏30 KB

    One problems with your solution:
    LCOM_MasterGetLine(int ID,char*Buffer,int Length)
    You should allocate a buffer large enough in LabVIEW and pass it to the Call Library Node. The dll function needs som space to actually scribble in whatever it wants to do.
    Check out the attachement this should more or less be what you will need.
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions
    Attachments:
    ex.vi ‏45 KB

  • LabVIEW call Win32 API DLL function from third party

    Hi everyone,
    I'm trying to build a LabVIEW 2010 interface on 32-bit Window XP system to configurate and communicate to an Anglient laser head through its USB expansion box. I contacted the vendor and they shared a win32 API with some dll files. I started with a function called "A55292Find", but the CLF node always pop up error 1097.I checked the MSDN to get the corresponding LabVIEW data type for CLF.
    My question is: Do I need to initialize those arguments? (How can I know the values of them if initialization is needed?)
    Could anyone help me figure out what's the problem?
    Here is what I have from API documents about this function:
    The A55292Find function returns lists of handles and board types for all the 55292 USB
    Expansion Modules connected to the system.
    A55292RC __cdecl A55292Find(
    HANDLE hBoxes[], // List of handles for the boxes found. (as Unsigned 32-bit integer numeric)
    BOARDTYPE PortABrdType[], // List of board types for slot A boards (as Unsigned 16-bit integer numeric)
    BOARDTYPE PortBBrdType[], // List of board types for slot B boards (as Unsigned 16-bit integer numeric)
    WORD *spMaxBoxes); // dimension for all of the passed arrays. (as Unsigned 16-bit integer array data pointer)
    // (function return type as Unsigned 32-bit integer numeric)
    Parameters
    HBoxes[] Array that will receive the list of HANDLES for all the 55292 boxes connected.
    PortABrdType[] An array that will receive Slot ‘A’ board type information for each 55292 box.
    PortBBrdType[] An array that will receive Slot ‘B’ board type information for each 55292 box.
    spMxBoxes Passes the maximum number of values that can be held in hBoxes, PortABrdType, and PortBBoardType arrays to the A55292Find routine and returns the actual number of boxes found
    The return value will be one of the following A55292RC return codes:
    Value Meaning
    A55292_NO_ERROR No error
    A55292_TIMEOUT Timeout accessing a shared memory
    Remarks
    This routine must be called to obtain handles and board type information used in calling all the other routines. If there are significantly more array elements than boxes, the routine will take longer to complete.
    These are the definitions: 
    typedef DWORD A55292RC; enum{A55292_NO_ERROR, A55292_HANDLE_ERROR,...}
    typeder WORD BOARDTYPE; enum{A55292_PCAL_BOARD, A55292_NO_BOARD, ...}
    Thanks a lot,
    Kang
    Solved!
    Go to Solution.
    Attachments:
    call A55292Find.vi ‏10 KB

    nkang11 wrote:
    Hi Mr. Kalbermatter,
    As you told me, I should try to use the defined enumeration words as control and indicator.
    For the previous CLF node, it successfully returned the hardware configuration (I have only connected a board at slot A):
    But I really want to see a string return as "A55292_PCAL_BOARD" which is defined by "typedef WORD BOARDTYPE; enumeration {...}; Does that mean I need to change the data type or do something like "converter"? Or initialize the array first, then convert it to string type?
    Right now, I'm trying to open the laser card by using "A55292PcalOpen(HANDLE hDev, SLOTSELECT SlotSelector);" function which requires to use the enumeration constants from " typedef WORD SLOTSELECT; enum {A55292_PORT_A, A55292_PORT_B};" but I'm confused to shot an constant control to a new CLF node.
    Since almost all of the arguments in dll function are typedefined as WORD, short and struct et al, I hope you could give me some hints on it.
    Thank you very much sincerely!
    Kang
    Depending on the actual C implementation you can simply create a LabVIEW enum with the according item names or use a ring control instead. Teh enum requires the numeric values of the items to be in consecutive order without any gaps in between. This is a given if the C definition never assigns a specific number to the item. If the C enum is not consecutive you need to go with a ring control instead.
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • Error when calling a DLL function

    Hi,
    I am using external C++ code with labView. One of the DLL functions I use serves to call files. The directory and the name of the file is is passed as a parameter for this function. When the VI is running and arrives at this function (I use the Calling Library Function Node tool), the following message is displayed:
    ERREUR de type class boost::filesystem::filesystem_error.
    boost::filesystem:ath: invalid name "D:\Documents Johan\Johan\Stitching\Fichiers de mesure\front parfait\13z2" in path: "D:\Documents Johan\Johan\Stitching\Fichiers de mesure\front parfait\13z2"
    I do not know why this message is sent to me.
    Thanks for your answer
    JF

    Hello,
    How are you passing the file path to the DLL -- are you passing it as a
    string?  If you are passing at as a string, I would do some basic
    console output to make sure that your DLL is receiving the file path
    corectly as a string and perform your appropriate C++ function in your
    DLL.  If the error is occuring with passing the file path you
    might want to check out the links below for a little more information
    on this.
    http://zone.ni.com/devzone/conceptd.nsf/webmain/7d6a20fe02edbf318625690700704cf3#4
    http://digital.ni.com/public.nsf/websearch/4E9234BA4C7C4ABE86256E3C0074760F?OpenDocument
    http://digital.ni.com/public.nsf/websearch/3B994675B17C654A86256FDD00754DD2?OpenDocument
    Hope this helps,
    Travis M
    NI
    Travis M
    LabVIEW R&D
    National Instruments

  • Calling CVI DLL Function from Visual Studio

    HI all ,
    Iv'e created a DLL using CVI and i'm tring to call one of it's function from visual studio 6.0
    I'm getting a general error , is there a specific prototype that i need to set my functions in ordrer to call them ?!  
    Kobi Kalif
    Software Engineer

    You will need to distribute the CVI RTE along with your DLL, since anything you write in CVI is going to use the RTE.
    As far as calling the DLL functions, you can use the CVI defined macros
    <return type> DLLEXPORT DLLSTDCALL <function name> (<param1 type> <param1> ...) {
    to declare your functions in the DLL for access by a VS application.
    for example
    int DLLEXPORT DLLSTDCALL myfunction (int funparam1, double func param2) {
    There are options for identifying which functions to export from your DLL, I use "functions marked for export" but there are other choices available.  I also include a type library so when you type the name of a DLL funciton in VS6 you see a balloon popup with the function signature.  This is a check box in the target settings.  You have to create a ".fp" file (function panel file) to collect the function info for the library.
    From VB6 you can access the DLL a couple of ways, but I usually add the DLL as a reference.

  • 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

  • Have a problem with Preview in CS5

    Hi, I recently upgraded from dreamweaver CS3 to CS5. In version CS3 when having made any changes to html code and/or (external) CSS files and/or (external) JS files these changes were automatically 'saved' when selection Preview to see the changes in

  • PLEASE HELP ME WITH DM PROBLEM

    Hi Guys, I kindly ask for your help with regards to my DM project. As you might recall, I am working on a project that is related to the field of agriculture and that has as an objective to find the "optimal values" of the operating conditions that a

  • QuickTime Player - no sound

    There's no sound on some .avi files I've recently downloaded. Not some, only a couple. I get a message that comes on saying I'm missing certain components/plug-ins (or whatever) that I need to download from a certain site in order for that particular

  • Information related to XI Serive Pack

    Hello SDNers, We are looking forward to upgrade our SAP_XI system. Currently we are on SP17. I would like to know the inputs from you guys if you are using either SP20 or SP21. Also, it would be great if anyone can tell me that how long have been the

  • Rep Please Verify Validity of Text Subpoenas

    Just checking the validity of the following letter/statement from Verizon I obtained from a source regarding subpoena-ing texts and the days of storage of text messaging: Message Content or ANY OTHER inquiry is not available to the subscriber under a