How to call DLL

i have a .DLL file made in VB6, this file return me some info in String format.
how can i call this file and get data.
any suggestion....?

sabre150 wrote:
http://java.sun.com/developer/onlineTraining/Programming/JDCBook/jni.html
I've heard that jna is easier to use, haven't had to go native myself for a long time though.

Similar Messages

  • How to call DLL in BSP

    hi,
    1. Can anyone suggest me how to call a dll in a bsp. if you can help me with a sample code it'll be helpful.
    2. Is it possible to call VBScript in BSP
    Thnx in Advance
    Vinodh

    It is done the same way you do in normal HTML.
    A BSP is only an HTML page which ABAP is compiled into during runtime just like a JSP page or ASP page.
    <htmlb:content design="design2003">
      <htmlb:page title = "Test submit ">
        <htmlb:form id="myform" method="POST" enctype="multipart/form-data">
        <htmlb:inputField id="myFile"
                    visible="true"
                    width="300px" /><br>
        <htmlb:listBox id="filelist"
                    width="300px" />
        <script>
        function selectFolder(){
          var myText = "Browse for file";
          var objShell = new ActiveXObject("Shell.Application");
          var ssfWINDOWS = 0;
          var objFolder;
          objFolder = objShell.BrowseForFolder(0, myText, 0, ssfWINDOWS);
          if (objFolder != null) {
             document.forms.myform.myFile.value=objFolder.Items().Item().Path;
             getFileList(objFolder.Items().Item().Path);
        function getFileList(id) {
          var FSO = new ActiveXObject("Scripting.FileSystemObject");
          var myStartingFolder = id;
          if ( myStartingFolder != null || myStartingFolder != "" ) {
            var myFolder = FSO.GetFolder( myStartingFolder );
            var myFileList = new Enumerator(myFolder.files);
          // First clear all entries
            document.forms.myform.filelist.options.length = 0;
          for (; !myFileList.atEnd(); myFileList.moveNext()) {
              document.forms.myform.filelist.options[document.forms.myform.filelist.options.length] = new Option(myFileList.item().name,FSO.GetFileName(myFileList.item()));
         } // start folder found
        } // getFileList
        </script>
        <htmlb:button id="myButton"
                onClientClick="selectFolder()"
                text="Browse" />
        </htmlb:form>
      </htmlb:page>
    </htmlb:content>
    Just remember with ActiveX you have security issues to keep in mind!

  • How to call dll from Java

    Hi everybody,
    I am trying to call a dll from my java application. Pls tell me how to do it, I seached and found JNI. Is it true
    pls help me and send me some examples
    Thank you and have a nice day

    java_and_me wrote:
    I am trying to call a dll from my java application. Pls tell me how to do it, I seached and found JNI. Is it trueYes, it is true. JNI is the way to go. You'll probably have to write some C code on your own as well, as the DLL is unlikely to be in the format expected by Java already.
    pls help me and send me some examplesOf course. [Here you are|http://www.lmgtfy.com/?q=JNI+tutorial].

  • How to call dlls for valve system

    I need to call the dll file I made from visual C++.The main theme is to control valve system from labview. I put the control switches(booleans) in labview and now want to connect it to the initial C++ program I made for valve control.Is there any way that I can use the on/off switchs(booleans) and code interface node for the system to work?Please help.I am having problems with dll calling .

    I got the message" call library function :function not found in library".
    I had checked for the function name,its same as is on the header file.I had tried for both C and stdcall calling conventions,still it didnot work.
    please suggest what could be wrong.

  • Calling Dlls from LabVIEW

    LabVIEW Gurus:
    I am working with some software engineers who have no experience in LabVIEW. Unfortunately I have little experience in C/C++ to make sense of their inquiry.  
    Basically we are dealing with “Data Marshalling”. I will call a DLL and issue a command (string) and get back a 2-D array and an integer. So far so good.
    The C/C++ programmer requested that I provide them with a pointer/memory address in which they will store data, so I can read it once the dll returns the array and integer. I browsed through the example online http://decibel.ni.com/content/docs/DOC-1690 and thought that if I wanted to read from the dll, the process is a simple as calling the appropriate function and configure the parameter (no pointers needed).
    So, is there a specific way that they need to write the C/C++ code to be used in LabVIEW? Or what else to I have to take into consideration?
    Thank you,
    Santiago 

    That example is pretty simplistic as it only deals with integers. In this case no pointers are required since everything is returned by value. When you're dealing with arrays, however, you need to deal with pointers. If you open the Example Finder (Help -> Find Examples) and search for "dll" you will see the "Call DLL" example. That contains many examples of how to call DLL functions with a wide variety of datatypes. I strongly suggest looking at that example. There is also a chapter in the LabVIEW Help on calling DLLs (Fundamentals -> Calling Code Written in Text-Based Progamming Language).
    You have 2 things to consider:
    You're dealing with arrays - this means you typically need to pre-allocate the memory in LabVIEW, and it sounds like that's what the DLL expects you to do. This amounts to using the Initialize Array function to create your 2D array of the appropriate size and datatype.
    You may be dealing with a C++ DLL. LabVIEW can only interface to C DLLs. This doesn't mean that you can't create a DLL in C++, but it does mean that the C++ programmers need to add an extern "C" modifier to the function calls, otherwise you get name mangling, and LabVIEW won't be able to call the DLL. The DLL programmers should know what that means.

  • How to call a labview dll from excel-VBA?

    How to call a simple Labview DLL from Excel VBA?
    I have seen examples of DLL calls from VB but does it work the same way for VBA? I have 2000 excel and Labview 8.5. I created the DLL and tried to call it from VBA using the same type of code as in NI's website example(ofcourse its a bit diff with 8.5)
    http://zone.ni.com/devzone/cda/tut/p/id/...
    BUT it errors out when called from excel
    ERROR: The object invoked has disconnected from its client

    You would need to provide more details about the LabVIEW DLL, such as the prototypes of the functions (VIs) that you're trying to call, and your actual VBA code. Specifically, what object you're trying to create. You should also make sure the Run-Time Enginer is installed, as well as any required libraries such as the VISA Run-Time if you're using VISA. Have you made sure to enable the ActiveX server for the DLL?
    A search yielded the following items that you may wish to peruse:
    http://forums.ni.com/ni/board/message?board.id=170&message.id=261345&requireLogin=False
    http://forums.ni.com/ni/board/message?board.id=170&message.id=45099&requireLogin=False
    http://forums.ni.com/ni/board/message?board.id=170&message.id=299209&requireLogin=False
    http://forums.ni.com/ni/board/message?board.id=170&message.id=195846&requireLogin=False

  • "HOW to use Labview call Dll compiled by VC++"

    "hello,I use VC++ compile a DLL,and i want to call DLL Function in LABVIEW program.But there is a dll function
    when i call it in labview.There is error.The prototype of Dll Function that make error is "USHORT DLLFUN __stdcall IBWRT(unsigned short dev_address,const char *pstrWrite)",The second paramenter is a char pointer,
    and the paramenter pass a command which content is
    "MEASURE:CURRENTC? 1A,0.001MA".
    When i use VC++ to call this function,i program followed:
    CString m_wrt;
    int ReturnW;
    m_wrt="MEASURE:CURRENTC? 1A,0.001MA";
    char buffer[40];
    strcpy(buffer,m_wrt);
    ReturnW=IBWRT(4,buffer);
    and this call is correct.
    But when i use labview to call this function.ther
    e is
    error.So, who can help me,to tell me how to call this
    function.Thanks."

    Are you asking about porting code or calling C++ code in LabVIEW?  As far as porting code, there's no easy way to move code back and forth between LabVIEW and C++.  However, if you are trying to call C++ code in LabVIEW, you can compile it as a DLL and call it in LabVIEW using the Call Library Function node.
    Chad B. » National Instruments » ni.com

  • How to call the DLL writing in Vb6.0 from testsatnd?

    Hi,
    I want to call a dll writting in VB6.0 from teststand. But as i see from the "Step Setting" in teststand, only the C/C++ Dll can be selected in the "adapter" type. I try to use this one as my adapter to call my VB6.0 dll, in result, there is no function can be seen in the "function" tab in teststand.Anyone know how to call the DLL writing in Vb6.0?
    Solved!
    Go to Solution.

    Hi Ivan,
    Just to be sure that your DLL is not wrong
    you have check if all functions are well and present.
    There is  tool called "Dependency Walker"   You can download it at http://dependencywalker.com/ .
    With it you can look "inside" your dll
    If you will see your functions there, you will see them (in my case !!always!!) in TestStand, too.
    Hope this helps 
    Greetings
    Juergen
    =s=i=g=n=a=t=u=r=e= Click on the Star and see what happens :-) =s=i=g=n=a=t=u=r=e=

  • How to call a c++ dll from oracle

    plz can someone help me how to call a c++ dll (not ocx coz 10g cant see ocx) from oracle 10g ?
    Edited by: jihad jag on Apr 23, 2009 1:40 AM

    I guess your request is timed out but to call shared libraries look for 'External Procedure Call' in Oracle documentation.

  • How to call a VB dll with boolean parameter in labview

    hi ,
         I havea problem with labview calling dll.
         I need to call a customer's dll(VB) , but I find labview have no  boolean type parameter, so how can I do it ?
         I have used labview 7.1 and only have dll without source code.
    sonic
    Sonic
    Diffrent Strokes for Different Folks

    hi   semercurio :
        I have bulid a dll by lv 7.1 with boolean and  then call lt  from LV7.1,but i have some issue of it .
        I also use U8 and I16 type and all pop up a errer message,you can see it from accathed.
        do you have any suggestion about it ?
    Sonic
    Diffrent Strokes for Different Folks
    Attachments:
    15.JPG ‏17 KB
    SharedLib.h ‏1 KB

  • How to call Labview DLL from VB2005

    Dear all expert,
    I'm a student and very new in Labview programming.
    Currently i have build a simple vi and need to convert it to dll so that i can call it from my VB.net. But the problem is how to call the labview dll from my VB.net?
    I know we must declare function something like this,
    Auto function Bodeplot Lib"..\\Bodeplot.dll" (Byval Val1 as double, Byval Val2 as double,...) as double
    but how to determine Val1, Val2 (and so on) is input for which data?  if my vi have 10 input (frequency, Kc,Fcz,Fcp,Wzrhp,Wp,k,Wz,Beta and Operation) ? and how to select the output (my application have 3 possible output : magnitup loop,phase loop, and degree loop)
    In addition, since I'm using Labview 8.0 , and as i know apllication  builder for this version cannot convert vi to dll which contain Mathscript (but unfortunely, my vi all use Mathscript), so really hope someone can help me to convert my vi to dll using Labview 8.2 (which remove this limitation).
    here I'm attach my Vi and really hope someone willing to help.
    Thank you.
    Attachments:
    bodeplot.vi ‏1049 KB

    On Sep 17, 6:40 am, cckoh <[email protected]> wrote:
    > Dear all expert,
    > I'm a student and very new in Labview programming.
    > Currently i have build a simple vi and need to convert it to dll so that i can call it from my VB.net. But the problem is how to call the labview dll from my VB.net?
    > &nbsp;
    > I know we must declare function something like this,
    > &nbsp;
    > Auto function Bodeplot Lib"..\\Bodeplot.dll" (Byval Val1 as double, Byval Val2 as double,...) as double
    > &nbsp;
    > but how&nbsp;to determine Val1, Val2 (and so on) is input for which data?&nbsp; if my&nbsp;vi have&nbsp;10 input (frequency, Kc,Fcz,Fcp,Wzrhp,Wp,k,Wz,Beta and Operation)&nbsp;? and how to&nbsp;select the output (my application have 3 possible output : magnitup loop,phase loop, and degree loop)
    > &nbsp;
    > In addition, since I'm using Labview 8.0 , and as i know apllication&nbsp; builder for this version cannot convert vi to dll which contain Mathscript (but unfortunely, my vi all use Mathscript), so really hope someone can help me to convert my vi to dll using Labview 8.2 (which&nbsp;remove this limitation).
    > &nbsp;
    > here I'm attach my Vi and really hope someone willing to help.
    > &nbsp;
    > Thank you.
    > &nbsp;
    >
    > bodeplot.vi:http://forums.ni.com/attachments/ni/170/272124/1/bodeplot.vi
    If you insist on using Labview with your project then you should
    consider using ActveX in place of using a dynamic link library to
    interface to your VB.net code. You don't need "Application Builder"
    if you use ActiveX. The Student, Basic and Full development versions
    of Labview for Windows come with ActiveX capability. For more
    information on ActiveX look up the subject ActiveX in Labview's Help
    File.
    Howard

  • 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

  • How to call one vc++ dll inLabview?

    I am a new user of Labview,but I don't know how to call one dll compiled by vc++ in Labview,please the experts tell me how to call it and use what function .
    thanks a lot !!

    Hi 214552213;
    There are several references at NI Developer Zone that explain how to access a dll from LabVIEW. You need to know the function prototype of the function you are calling in order to make the right call from LabVIEW. If you have LabVIEW 6, it allows you to see the different functions, but not the necessary arguments. If you have LabVIEW 5, you can use a vi available from NI<
    /a> to view all the functions exported in a dll. Follow nchernin instructions...
    Using External Code in LabVIEW, which you can access from LabVIEW's help or access through the link above.
    If you are writing the dll, check the several articles in NI website. There is a lot of documentation, but specially for doing it using Microsoft's VC++.
    Regards;
    Enrique
    www.vartortech.com

  • How to call a dll which has one VISA name as input

    Hi there,
    The Labview application builder can generate a dll file from a vi which is a simple serial comunication program using VISA name as one control.
    The problem is how to call the dll file in Labview which has a VISA name as INPUT?
    Thanks!
    George

    I would suggest modifying the LabVIEW VI so that the input is a string control instead of a visa control. The LabVIEW application will work the same and there is no need for any casting. All visa VIs can take a string as an input. Then when you recreate the dll make the input a string. Then you can easily pass a string to the dll from any API.
    -Josh

  • How can I call DLL's Through Forms5.0

    I've done the following exercise for calling DLL's
    I tried to put thier dll in orant/bin directory but unable to get the values from DLL. I used user_exit D2K built in function but not able to get the result..
    Ex:
    DLL is = api1.dll
    This dll having n number of functions in that one of the function is GetUid..This contain one in parameter which will take length of userid and one out parameters which will return Userid from DLL..
    The syntax I used in D2K is as follows.
    First I hv put this dll in orant/bin directory
    and used following syntax in D2K
    user_exit('GetUID(:global.uid,20)');
    But it was dispalying the msg GetUID does not exist..
    I have put one entry in registry like FORM50_USEREXITS orant/bin/api1.dll.
    But the same error repeats..
    Please revert as to how I can go about it.
    null

    Assuming that you don't need to do anything with that pointer aside from pass it around, you can declare that parameter as a "ByVal Long image" in your declaration.  Declare a variable (as a Long) to pass in to the image parameter. 

Maybe you are looking for

  • ILife 4.0 will not install

    I have a G4 MDD 1.25 MHZ machine with OS 10.3.9. I am installing a new hard drive and installing all my apps fresh. I am trying to install iLife 4.0 but get the following message: iLife cannot be installed on this computer. This installation cannot p

  • Billing document not getting created.

    Hello SAP gurus, I have a situation where billing document is not getting genrated. Its a delivery related billing and i have checked following. Sales order is complete Delivery is complete No billing blocks at header or item level GI is also done. H

  • Thumbnails appear as a white box with dotted line  -WHY?

    My library is still intact, however, my thumbnails are appearing as a white box with a gray dotted line. If I click on the box to open them, then they are there. I took my computer into an Apple store 2 days ago, they reset the computer and it was wo

  • Save Custom Recording options as a set?

    I thought from reading about the features in Captivate 2 that I could save my own sets of custom recording options. Every time I change files, I have to set up my custom recording options again. It would save me time if I could save these as custom s

  • Method to get the server time

    Hi, Is there any method in the TopLink API that returns an Date or Calendar or Timestamp (etc) with the server/database time?? I need to use this time and I want to avoid creating a query to do that (I think creating the SQL query will let my applica