Calling functions from a DLL

I am currently using Oracle to retrieve a BLOB data to process it. The only way I have of intepreting the BLOB is through a function of a DLL provided by my supplier. Is there anyway of doing so?
Any Help is very greatly appreciated. Thanks

Unless you have worked with the JNI before or are long accustomed to "just figuring it out due to lack of documentation and information", you really will not glean too much information just from looking at the JNI itself.
In a nutshell, what you need to do is: create one or more Java classes which contain native methods appropriate for your use; compile these classes; use the 'javah' to process each class that contains native method declarations in each class; copy the generated C header files to C/++ source files; implement each C function (each function corresponds to precisely one native method declaration) in each C/C++ source file as appropriate for your needs (e.g., do Oracle ju-ju (this is where the real beef of the JNI comes in - functions to get data out of the VM and from the Java environment - threads, objects, and so on); compile and link the C/C++ source code into a DLL for Windoze and a shared object for Unix (note that when you compile you will actually need to include two directories from the JDK, not just one - the second directory provides the platform specific definitions of types and so forth). Having done all that, you essentially can now use that/those class/classes in the Java world to hit the Oracle ju-ju, or whatever it does, from a Java perspective.
For more information, see the Java Native Interface tutorial trial at http://java.sun.com/docs/books/tutorial/native1.1/index.html

Similar Messages

  • CVI crashes when calling function from external DLL

    I'm calling a CVI library from Test Stand 4.1.  In that CVI library I load an external DLL (using LoadLibrary) and create a few function pointers (using GetProcAddress).  The DLL loads successfully, and I get addresses for all of the imported functions.  
    However, when I one of the functions is called CVI crashes (Test Stand says it lost the ActiveX connection to CVI) when executing in an external CVI instance.  If executed in the Test Stand process I get a system level exception.
    If I step through the code in CVI, it hangs after trying to step into or over the call to the function pointer from the external DLL.
    I am able to call the functions in a small test project I created in CVI, however when integrating it into an existing test library and calling it through Test Stand it fails.
    Any ideas on how to go about debugging this issue?

    Have you tried calling into the dll that CVI calls directly from TestStand?  I am curious to know if this also crashes.
    I am also curious to know if there are any path references in the dll that is called by the CVI program.  If so are they relative, or absolute paths?
    I ask because one of the possibilities is that relative paths are being used to specify a path from the location of the code that is called, and they are not working because the current working directory is being specified by TestStand, and the paths are not relative to the working directory given by TestStand.
    Jensen
    National Instruments
    Applications Engineer

  • Call function from "CP210xManufacturing.dll"- Silicon Labs

    I am developing a production line test system that includes retrieving and setting the VID, PID, product string, serial number maximum power consumption of a Silicon Labs CP2102 USB - UART bridge using Labview 8.2.
    Unfortunately I could only call one function { CP210x_GetNumbDevices() }. Wondering any one can help me to call others.
    The Document  : http://www.silabs.com/public/documents/tpub_doc/anote/Microcontrollers/Interface/en/an144.pdf
    CP210xManufacturing.dll :http://www.silabs.com/public/documents/software_doc/othersoftware/Microcontrollers/Interface/en/an14...
    Tuong

    G'day Tuong,
    I'm having issues finding the device i want (VID / PID) on my machine using the "CP210xManufacturing.dl"and calling function "CP210x_GetNumDevices()"...
    Just wondering if you have any details on this....
    Hahaha, I just saw the date you wrote this thread... Hmmm, I might just ask you at work tomoz...
    Cheers
    Tim

  • Call function from C++ (dll file) in Flex

    Hi,
    i using Adobe Flash Builder with Flex 4 , i write a C++ Code in dll File , i need to access to my Function in dll file in Flex ?? what should i do ??

    Lets make sure you are performing the correct actions:
    1.  Place a Call Library Function node on your block diagram.
    2.  Double click the node to open up the Call Library Function dialog box.
    3.  Click the Browse button and navigate to the DLL function.  Select the proper DLL and click Open, or just double click on DLL.
    4.  On the Function Name box, click on down arrow.  A list of functions found in the DLL should be displayed.  Choose the function.
    5.  On the Calling Conventions box, click on down arrow and select C or WINAPI.  In your case, it should probably be C.
    6.  The Parameter box should show return type.  In the Type box, select the data type of the return value.  Since you won't see HRESULT here, you need to find out what data type HRESULT is in the C code.  I would guess it is a numeric so select numeric from the drop down list.
    7.  Click the Add a Parameter After button.
    8.  In the Parameter box, change the name arg1 to the actual name of your first parameter, which is byPortNumber.
    9.  In the Type box, choose Numeric, since a BYTE is a numeric in Labview.
    10. In the Data Type box, choose Unsigned 8-bit Integer, since a BYTE is a U8 in Labview.
    11. In the Pass box, choose Value.  If the C parameter was a pointer (*BYTE), you would choose Pointer to Value.
    12. Verify that the contents of the Function Prototype box contains the correct syntax according to the C declaration.
             C:  HRESULT RSPInitComm (BYTE byPortNumber)   should be in Labview: long RSPInitComm(Unsigned char byPortNumber)
    13. Click OK button.
    Try it out.
    If you get a crash, change the Calling Convention to WINAPI.
    - tbob
    Inventor of the WORM Global

  • Calling a function from a DLL, exectution in background mode.

    Dear Experts,
    We have created an ABAP report the calls a function from a DLL file. If the report is executed in on-line mode the program calls and executes the function from the DLL, but if the ABAP programa is executed in background mode it doesnt calls the DLL function.
    Do you know a way to solve the problem when executing in background mode?
    Best regards.
    Antonio

    Hi Gabriel,
    Let me explain in details about my DLL function.
    We are importing the business partners from legacy system into the SAP CRM system, so at the moment we created the BP master data via BAPI, I get the name of the BP and this moment I call the function in the DLL file. I export the parameter name and I receive back a simplified string with the name reduced to a code. This code I get back from the dll it is insert in a Z table, so there is no interaction in the screen, all must be executed in background mode, because there are a lot of business partners to be converted in SAP system.
    I am sending my code for your considerations.
    Instancia a DLL
      CREATE OBJECT dll 'MTCODE.CPFONET'.
      IF sy-subrc NE 0.
        RAISE without_dll.
      ENDIF.
    Move para a tabela interna IT_NAME os valores recebidos na TI_NAME
      it_name[] = ti_name[].
    Para cada registro importado
      LOOP AT it_name.
        CLEAR v_string_ret.
        wa_matchcode-zregid     = it_name-zregid.
        wa_matchcode-name1_text = it_name-name1_text.
        v_string = it_name-name1_text.
        CONDENSE  v_string.
        TRANSLATE v_string TO UPPER CASE.
        CALL METHOD  OF dll 'SetNome' EXPORTING #1 = v_string.
        CALL METHOD  OF dll 'ExecMatch'.
        CALL METHOD  OF DLL 'GetMCData' = v_string_ret.
        FREE OBJECT dll.
      Preenche os campos do match-code de acordo com o retorno da DLL
        SPLIT v_string_ret
        AT '|'
        INTO wa_matchcode-zparmcln
             wa_matchcode-zparmcfn
             v_empty
             wa_matchcode-name_first
             wa_matchcode-name_last
             wa_matchcode-namemiddle.
      Adiciona o registro com o match-code correspondente na TE_MATCHCODE
        APPEND wa_matchcode TO te_matchcode.
      ENDLOOP.

  • Can I call a function from a dll in LabVIEW that returns:double*string and int.?

    I have a function from a dll that return a double* string and an integer. How can I call this function from LabVIEW? There is a possibility to work in LabVIEW with a double* string?

    pcbv wrote:
    > Hello all,<br><br>The header of the function is:
    >
    > "HRESULT WRAPIEnumerateDevices(WRAPI_NDIS_DEVICE **ppDeviceList, long *plItems);"
    >
    > where WRAPI_NDIS_DEVICE have this form:
    >
    > typedef struct WRAPI_NDIS_DEVICE<br>{<br>
    > WCHAR *pDeviceName;<br>
    > WCHAR *pDeviceDescription;<br><br>}
    > WRAPI_NDIS_DEVICE;<br><br>
    >
    > The function is from WRAPI.dll, used for communication with wireless card.
    > For my application I need to call in LabVIEW this function.
    Two difficulties I can see with this.
    First the application seems to allocate the array of references
    internally and return a pointer to that array. In that case there must
    be another function which then deallocates that array again.
    Then you would need to setup the function call to have a pointer to an
    int32 number for the deviceList parameter and another pointer to int32
    one for the plItems parameter.
    Then create another function in your DLL similar to this:
    HRESULT WRAPIEnumExtractDevice(WRAPI_NDIS_DEVICE *lpDeviceList, long i,
    CHAR lpszDeviceName, LONG lenDeviceName,
    CHAR lpszDeviceDesc, LONG lenDeviceDesc)
    if (!lpDeviceList)
    return ERROR_INV_PARAMETER;
    if (lpDeviceList[i].pDeviceName)
    WideCharToMultiByte(CP_ACP, 0,
    pDeviceList[i].pDeviceName, -1,
    lpszDeviceName, lenDeviceName,
    NULL, NULL);
    if (lpDeviceList[i].pDeviceName)
    WideCharToMultiByte(CP_ACP, 0,
    pDeviceList[i].pDeviceDescription, -1,
    lpszDeviceDesc, lenDeviceDesc,
    NULL, NULL);
    return NO_ERROR;
    Pass the int32 you got from the first parameter of the previous call as
    a simple int32 passed by value to this function (and make sure you don't
    call this function with a higher index than (plItems - 1) returned from
    the first function.
    Rolf Kalbermatter
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • 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

  • Calling a function from a dll written by using visual studio c++

    Hi, how can i call a function from a dll which is written by visual studio c++ in test stand?  Although the functions in dll are exported and i've chosen c/c++ adapter, i saw no function in test stand. Is there a different step while i'm calling a function from a dll written by c++ than calling a function from a dll written by cvi?

    Hey Sadik,
    Selecting the C/C++ DLL Adapter Module should be sufficient for this. When you drag an action step for this onto the Main Step and navigate to the location of the DLL, the function list should populate and you should be able to select the function you want to use. If this is not the case, would you be able to post this DLL so that we can test this on our end?
    Regards,
    Jackie
    DAQ Product Marketing Engineer
    National Instruments

  • Calling a native function from a dll

    Hi all,
    I want to call an api function exported from a dll using java. For example l like to call a function from kernel.dll (Windows). How can i do this. Do i have to create another dll for this?

    hi,
    you need to use JNI
    you have to create de DLL , and call kernel32.dll in.
    like that:
    java_class.class ==> first_dll.dll ==> kernel32.dll

  • Using PostLVUserEvent function from Labview.dll

    I am trying to use the PostLVuserEvent function from the labview.dll and corresponding extcode.h file.  I have made my own dll using CVI that uses this function.  I then use Labview to call my dll.  My dll compiles fine.  No issues, no errors.  LabView can call my dll function containing the PostLVUserEvent function with no errors.  However, the event number LabView passes my dll is not the same event number I receive so no LabView event is triggered. 
    Has anyone had this issue? 
    We are trying to solve it from the LabView side and the CVI side but cannot seem to get it to work.  The examplesI have found here were compiled using C++ and those seem to work.  I do not know why when I compile my program in C, it creates the dll but does not work.   If I had to guess, i think it's an issue with pointers vs non-pointers.  When the LAbview program selects my function from the dll, it shows the argument PostLVUserEvent as a pointer when in my dll, it is not a pointer PostLVUserEvent....
    Any ideas?
    Thanks in advance. 

    Hello Blue
    Take a look to this one, it was created on C, I think the .c and the .h files will give a good idea, how the function should be implemented. It is important when calling the dll on LabVIEW, to use the std calling convention and run it on the UI thread.
    Regards
    Mart G
    Attachments:
    LabView EventTest.zip ‏1041 KB

  • How to Call Function from SAPSCRIPT

    I want to Call a function from my SAPSCRIPT to get some data and print the same in the form , Can I get an example for this

    Hi Nandan,
    U cannot directly call function from SAPScript... For that u have to create one include in which u need to write the code. Using Perform... EndPerform u can call the same from SAPScript. See the below example
    u need to write this code in SAPScript
    PERFORM formname IN PROGRAM includename
    USING &field1&                                      
    USING &field2&                                      
    CHANGING &field3&                                     
    ENDPERFORM                                               
    Here includename is your include type program.
    u need to write this code in your include type program..
    FORM formname TABLES in_par STRUCTURE itcsy
                            out_par STRUCTURE itcsy.
    data : var1 like field1,
           var2 like field2,
           var3 like field3.
      READ TABLE in_par WITH KEY 'field1'.
      CHECK sy-subrc = 0.
      var1 = in_par-value.
      READ TABLE in_par WITH KEY 'field2'.
      CHECK sy-subrc = 0.
      var2 = in_par-value.
    now u can call corresponding function using local VAR1 and VAR2. Here u can pass N no of USING parameters.
    After processing on VAR3...
      READ TABLE out_par WITH KEY 'field3'.
      out_par-value = VAR3.
      MODIFY out_par INDEX sy-tabix.
    EndForm.
    Here in_par and out_par are the structures which will be used to communicate with SAPScript. And this is the only way as per my view.
    I m sure this code will work fine. Here i have used dummy variables that u need to change as per your requirement. If u have more queries write me back.
    And yes if this works than dont forget to give the points.
    Regards,
    Sagar

  • Call function from data base with clob input parameter.

    Hello,
    In this project I use Jdev 11g.
    I call function from database.
    create or replace function get_fa_list (
    p_fa_id_list in clob
    return sys_refcursor
    is
    vCursor sys_refcursor;
    begin
    put_msg ('begin');
    if p_fa_id_list is null then
    put_msg ('CLOB is null!');
    else
    put_msg ('size CLOB: ' || dbms_lob.getlength (p_fa_id_list));
    end if;
    put_msg ('Save');
    open vCursor for
    select rownum as id, s.*
    from (
    select f.latitude, f.longitude, count (distinct f.res_id) as res_count, count (*) as fa_count, 16711680 as color, res_concat_distinct (f.res_id) as station_list
    from mv_frequency_assignment f, table (SplitClob (p_fa_id_list, ',')) l
    where f.ext_system = 'BI' and
    f.ext_sys_id = l.column_value
    group by f.latitude, f.longitude
    ) s;
    put_msg ('Open and End');
    return vCursor;
    end get_fa_list;
    I use TopLink in ejb.
    i use follow code for call function and get result.
    public List<TmpResPoints> findAllPointsBI(String p_id){
    UnitOfWork uow = getSessionFactory().acquireUnitOfWork();
    uow.beginEarlyTransaction();
    StoredFunctionCall call = new StoredFunctionCall();
    call.setProcedureName("get_fa_list");
    call.useUnnamedCursorOutputAsResultSet();
    ClobDomain c = new ClobDomain(p_id);
    //System.out.println(c.toString());
    call.addNamedArgumentValue("p_fa_id_list", c);
    ReadAllQuery query = new ReadAllQuery();
    query.setReferenceClass(TmpResPoints.class);
    query.setCall(call);
    List<TmpResPoints> result = (List<TmpResPoints>)uow.executeQuery(query);
    uow.commit();
    uow.release();
    return result;
    But size parameter "p_fa_id_list" is 0. (geting from temp table in Data base). this code in function >>
    if p_fa_id_list is null then
    put_msg ('CLOB is null!');
    else
    put_msg ('size CLOB: ' || dbms_lob.getlength (p_fa_id_list));
    end if;)
    How I can call this function from dataBase and get result?
    thx,
    Demka.

    What is the SQL generated?
    The argument should just be the Clob value (a String) not the domain object.
    Also try addNamedArgument, and then pass the named argument to the query.
    James : http://www.eclipselink.org

  • Send data to ECC table through RFC Call function from SAP B1 via  b1if

    Hi,
    I have created scenario in B1if which triggers from SAP B1, now I have to send this data in to ECC table, so I have created scenario for that with inbound SAP B1, outbound void and in process RFC Call atom is there but I am not getting data in receiver and also how to write xml to send data in RFC function. Function for RFC has configured from ECC end and have access of that function.
    So please help me to send data to ECC table through RFC Call function from SAP B1 (9.0) via b1if
    Thanks

    Solved by my own.

  • How can I build an application that calls functions in a dll if the associated hardware is not present?

    I am trying to build an application that use the "Call Library Function" node to call functions in a dll.
    The dll was provided by a third-party and includes functions to drive an I2C communication board.
    The problem I have is that the dll does not not properly because the hardware is not present.
    Therefore when I load the VI a broken arrow is displayed and when I am not able to build the application.
    I will not be running the application on the PC where I build the application, therefore I want to be able to build the application on a remote PC that has not all the hardware installed. Once the application will be build it will be installed on the target PC that has all the hardware.
    How can I make the application builder to build the application event if the dll is not properly loaded? (the dll will be properly loaded on the target PC)
    I want to do this on LabView 5.1.1, any ideas?

    Some .dlls don't try to attach to the driver when loaded.
    I've worked with both and unfortuately, I've not figured out a way around this problem.
    You could possibly use the Conditional Disable structure around the dll calls so they would not be loaded unless you're in the runtime engine. But i've not tried this so I don't know for sure if it's possible.
    Anyone??
    Ed
    Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
    Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.

  • Application with a vi calling a function from kernel32.dll

    I have a Labview application which runs very well.
    I had add a vi using the functio GetSystemTime from the dll kernel32.dll. The vi calling the API function runs well. Then I tried to buil the application and it does'nt run anymore . A dialog box is opened : "access to a forbidden space memory. I don't understand.
    Does anyone have an idea?
    Thank you for your response.

    I have made at test with this function but it runs on my system.
    I have used LV 6.0.2 to LV 7.0 on a Win XP Prof. You can compare your solution with mine.
    The VI will run once when the application is called. You will see current time.
    Waldemar
    Waldemar
    Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
    Don't forget to give Kudos to good answers and/or questions
    Attachments:
    GetSystemTime.zip ‏23 KB

Maybe you are looking for

  • I have encountered a different iTunes 7.0 problem from the rest if these

    ok, I have wrapped my brain around this one as much as I care to. here is "MY" problem with the new upgrade. To start, the background info I guess. I opend up my old (6.0 version) and tried to download one of my favorite TV shows (WILDBOYZ)...lol any

  • Re install iwork

    how do I re install iwork ' 09

  • Accuracy of iphone 4GS image Geotag data

    Can some one comment on the accuracy of the Geotags in the pictures taken from iPhone 4GS? Even when I take 4-5 steps and take pictures, the GeoTags in the EXIF data seem to be same. Thanks, - Srini

  • Using wireless router for Playstation Portable connection

    I've had my PSP for a little while now and I mainly use it for it's internet feature. I've been using my router (with wireless connection) for my laptops for years and so things have been completely fine logging onto the internet with my PSP. I recen

  • How do I parse "dc:format" from XMP?

    Clearly, I'm new to XMP/XML for Photoshop. I'm building a script to handle illustrator files differently than PS files, and would like to do this through the XMP as it seems to be more stable than simply File("blah.txt").type, and the other methods r