External call to DLL function

Hi Experts,
can anyone tell me the best way to call a dll function from within ABAP?
Thanks,
Jennifer

Hi, I don't have any experience in calling DLLs, but you may want to give this a try.
report zrich_0001.
data: path type string.
path = 'C:WINDOWS<the_file_Name>.dll'.
call method cl_gui_frontend_services=>execute
   exporting
     application            = path
  exceptions
    cntl_error             = 1
    error_no_gui           = 2
    bad_parameter          = 3
    file_not_found         = 4
    path_not_found         = 5
    file_extension_unknown = 6
    error_execute_failed   = 7
    others                 = 8.
Regards
Rich Heilman

Similar Messages

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

  • Can Ora_ffi call ActiveX DLL function???

    Hi, Can I call an ActiveX DLL function using ora_ffi or by any other means? Ora_ffi documentation says that it can call C dll functions.Can I call VB dll functions from forms PL/SQL.

    Hi, I don't have any experience in calling DLLs, but you may want to give this a try.
    report zrich_0001.
    data: path type string.
    path = 'C:WINDOWS<the_file_Name>.dll'.
    call method cl_gui_frontend_services=>execute
       exporting
         application            = path
      exceptions
        cntl_error             = 1
        error_no_gui           = 2
        bad_parameter          = 3
        file_not_found         = 4
        path_not_found         = 5
        file_extension_unknown = 6
        error_execute_failed   = 7
        others                 = 8.
    Regards
    Rich Heilman

  • 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 a dll function that as a structure

    I'm trying to call the following function with the Call library function node:
    XLstatus xlLinSetChannelParams (
    XLportHandle portHandle,
    XLaccess accessMask,
    XLlinStatPar statPar)
    The statPar parameter is a stucture which is define as follow
    typedef struct {
    unsigned int LINMode
    int baud rate;
    unsigned int LINVersion;
    unsigned int reserved;
    } XLlinStatPar;
    I used a cluster to pass the data to the function but labview is crashing everytime. The  C output of the CLFN is :
    typedef struct {
     unsigned long LinMode;
     long baudrate;
     unsigned long Linversion;
     unsigned long reserved;
     } TD1;
    long _xlLinSetChannelParams28(long portHandle, uInt64 accessMask,
     TD1 *statPar);
    Why is labview sending a pointer to the struct instead of the structure itself? Is this the cause of my problem? Any Solution?

    The CLFN ouput shown in my previous message was done with the "handle to value" parameter. As you stated, it sends a reference to the struct memory location.The problem is that i need to pass the structure value as an input and not a pointer to it (well, that's what i think the problem is). I read the various documents about CLFN and I tried the examples but they are all have function of that kind:
    returnval ExampleFunc (structPointer *struct)
    While the function in my dll is made like that
    returnval ExampleFunc (structValue struct) (see the real function in my first message)
    I included the dll and Vi and documentation for the xlLinSetChannelParams function.  The CLFN node that calls it is the fourth one (the one with a cluster as input). The first 3 CLFN are used to call the initialization function:init driver,get channel and open port.
    Attachments:
    LIN test.zip ‏130 KB

  • How to call the DLL functions through Java

    Hello,
    I have already got a VC++ generated DLL. It has serveral functionalities. I need to call those functions from my Java Application. Now i know that it can be possible only through writing Java JNI Interfaces.
    Everywhere i only see they give an example where in they tell to create an DLL. Now how do i will call if an DLL is ready and exists.
    If anyone can give an example then it will be very helpful to me. Please mail me at [email protected] .
    Thank you
    vvpatro

    You can't call functions in an arbitary DLL form Java. You need to use JNI to produce a 'wrapper' DLL that maps Java methods to the methods in the target DLL. The purpose of the wrapper is to allow type conversion between Java types and C/C++ types. The complexity of this task depends largely on the types used in th target DLL. If the targer DLL uses only primitive types such as char, byte, int, long, string, the translation is simple and the wrapper DLL will be 'thin'. If however, the target DLL passes arrays and objects, or employs callbacks, these more work to do, and the wrapper will be correspondingly 'thicker'.
    Hope this helps.

  • Calling lvanlys.dll functions in C language

    Hi all,
    I have a program in LV that I want to porte in C/C++.
    The program calls fucntions of lvanlys.dll.
    I'd like to call them in C but I don't know the prototype.
    There are some handle as input parameters but in LV program they are not attributed.
    Have you got an idea ?
    Maxime

    Hi Maxime,
    Following nrp instructions, you should be able to know the prototype of the functions you want to call.
    here is a link that may be helpfull:
    http://digital.ni.com/public.nsf/allkb/8AE57BDA995ACCB486256AEA0062B3C6?OpenDocument
    Sincerely
    Flo
    Open Diagram First

  • Calling DLL function using LabVIEW 7.1?

    Here's the scinario:
    I have LabVIEW 7.1 and i'm trying to call a DLL function using 'CALL LIBRARY FUNCTION NODE'.
    I have used this in the past with no problem. But right now, when I use this node and link it to the
    library and function name, i get 'ERROR loading Dllname.dll' message.
    NOTE that the DLL is generated using VStudio2003 or VStudio.NET. Could this be a problem??
    Also, i noticed that there are some JUNK characters before & after the function name that show
    up in function prototype:
    long ?EcpvsSign@@YAHHPBEH0HPAE1@Z(long Signer, CStr NonRMsg, long NonRMsgLen,
    CStr RMsg, long RMsgLen, CStr SigR, CStr SigS);

    tbd wrote:
    Hi rkpat,
          You might check-out this thread on building WIN32 DLLs - expecially the bit re: "mangles names" under the paragraph titled "C Language Source File".  My recollection is that 'extern "C"' directive in the header file for the DLL solved the name-mangling problem, but it's been a few years!
    Cheers!
    Message Edited by tbd on 03-01-2007 11:19 PM
    tbd is right. You have to first disable name mangling as it creates all kind of troubles. Other issues might be that your Visual Studio 2003 or .Net edition links in dynamic runtime libraries that are not standard available on every Windows PC so that you need to redistribute the according runtime library installer together with your app for the DLL to be even loadable.
    Rolf Kalbermatter
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • 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

  • Forms 6.0/user_exit call to DLL--Thoughts anyone?

    I have 6.0 Forms that call to DLL functions where the DLL was built using MS VC++ 5.0--works fine.
    Upgraded to MS VC++ 6.0 and rebuilt DLL (no code changes). Pointed FORMS60_USEREXITS registry to new DLL but now get the following message when trying to call any functions from the new DLL:
    FRM-40800 User exit <somename> does not exist.
    Anyone?
    TIA

    It has been a while since I fixed this problem, but I think you have to run FRM50SEC.sql and then grant select on the FRM50_ENABLED_ROLES view to your target audience.
    Try This...
    create or replace view FRM50_ENABLED_ROLES as
    select urp.granted_role role,
    sum(distinct decode(rrp.granted_role,
    'ORAFORMS$OSC',2,
    'ORAFORMS$BGM',4,
    'ORAFORMS$DBG',1,0)) flag
    from sys.user_role_privs urp, role_role_privs rrp
    where urp.granted_role = rrp.role (+)
    and urp.granted_role not like 'ORAFORMS$%'
    group by urp.granted_role;
    create public synonym FRM50_ENABLED_ROLES for system.FRM50_ENABLED_ROLES;
    create role ORAFORMS$OSC;
    create role ORAFORMS$DBG;
    create role ORAFORMS$BGM;
    -- Added
    grant select on frm50_enabled_roles to public;
    null

  • FRM-40734 when calling external DLL Function from Forms 6

    Even though some answers were given to my previous help request ("Again: Forms 6 and user-defined data types") I wasn't able to solve the problem of passing a parameter of an user-defined type to an external DLL function residing in the SECURSIGN.DLL library (the closest solution was to declare that "composite" parameter using the ROWTYPE clause referencing a custom-made table created just for the sake of defining that perticular datatype).
    So I concentrated on SECURSIGN.DLL functions using more trivial data types, like a function requiring just four character strings as parameters.
    I generated the necessary PL/SQL support using the FFI.
    I discovered that also the simplest calls to external functions fail at runtime with the generic error FRM-40734.
    I located the error: it happens just at the moment of calling the function from within the FFI-generated package body. Before that, the DLL is loaded with no problem, the function is correctly registered, and a function handle is regularly returned.
    As long as I can regularly issue the very same call with the very same parameters from Visual Basic, I can't understand what's going wrong (ALL the needed DLL are in the same directory as the FMB/FMX forms).
    I will greatly appreciate any help that You may be able to provide.

    I have noticed just now that a dump file having a name like ifrun60_dump_299, is generated by FORMS every time I issue the aborted call to the foreign function.
    Inside the form dump file, apart from useless info like Registers and so on, the message:
    "Could not find Module32First"
    By a FILE/FIND/CONTAINING TEXT I searched all the DLLs, and I noticed that Module32First is a routine that can be found within each of the following DLLs:
    Cl32
    d2kwut32
    d2kwut60
    I tried to load those DLLs along with SECURSIGN.DLL by modifying the PROCEDURE LoadLibrary into the FFI-generated PLL code, and I have apparently no problem in loading all the DLLs that I wish, but the error persists, and that dump file is constantly generated, always looking for the "Module32First" routine.
    How can I avoid all that mess and the FRM-40734 error??

  • Error in the call of a DLL function

    Hello,
    I'm trying to control a Switch Matrix of Agilent (HP5250A) with LabView 6.1. The connections are realized with GPIB. In fact, I have some problems with the DLL called "hpe5250a_32.dll". If I try to start my VI, this error occurs:
    "An exception occurred within the external code called by a Call Library Node. This may have corrupted LabVIEW's memory. You should save any work to a new location and restart LabVIEW. VI "hpe5250a Open List - modified.vi" was stopped at Call Library Function Node 0x844 of subVI "hpe5250a Open List - modified.vi" "
    Must I install the DLL in a special location as C:\VXIpnp\WinNT\Bin? I have nothing about HP5250 instrument
    here... and it is maybe the problem.
    Thank you very much for your help.

    Le problème a été résolu par mail directement.
    Il était dû au fait que l'utilisateur n'avait pas l'habitude des "instrument handle" dans labview et voulait utiliser certaines fonctions directement sans passer par les étapes de configurations.
    Cordialement
    David D.
    Ingénieur d'Applications
    NI France

  • Error 1097 after calling dll function which allocates memory inside

    Hello!
    When a call one my functions in my dll from LabView, i get an error 1097. My function takes a few arguments and then allocates some memory for measurement.
    It's not returning any pointers to that memory area, it is just allocates that memory for itself. I don't know what could be the problem, probably i am missing something.
    Could you help please?
    Best regards,
    Tamas
    Solved!
    Go to Solution.

    Are you sure that the allocate function is the problem?
    Error 1097 simply means something inside the external code wrote into memory locations that it was not meant to write. That is usually because of output buffer parameters that are not allocated (large enough) in LabVIEW when passed to the external code fucntion, so the function assuming it received a buffer of a certain size happily writes into that buffer but overwriting other information it should not have.
    But that is by far not the only possibility to cause this error. A simple bug in the external code can cause the same problem when a pointer goes astray or such. The fact that you used that library elsewhere already without seeing any problem is unfortunately no guarantee that the function is not buggy. The LabVIEW exeception handling around the Call Library Node has gotten rather picky and can detect violations that do not have to cause visible problems at all. But the violations it detects are real violations so just silencing them is not a good idea, as they could cause all kinds of problems including overwriting vital data structures in your program that either cause a crash later on or simply wrong results in other parts of your program. Especially the last one is a total bummer to debug.
    Without seeing much more of your code it is basically impossible to point out where the problem could lie. The particular Allocate function doesn't look like there is much that could be done wrong, but I would assume that you call several other functions too somewhere, which could cause the problem. If you can absolutely positively say that you never ever call any library function with a to short (or unallocated) buffer parameter, then you will have to take it up with the manufacturer of your lib, as it would seem very likely that there is some problem in there.
    Also you pass a handle to the library function but your Allocate function does not have this as a parameter! Where does this handle come from? Are you sure you have allocated and prepared it properly before calling this function? A handle is quite often a pointer, although usually a so called opaque pointer meaning the user of the library does not and should not know anything about the structure this pointer points to. It is only known internal to the library.
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • FRM-40734 when calling a foreign function requiring more than 1 dll

    I have been experiencing difficulties in calling external DLL functions from SECURSIGN.DLL. This time no peculiar type of parameter is involved, just four varchar2.
    A dump file "ifrun60_dump_nnn" is generated by FORMS every time I issue the aborted call to the foreign function.
    Inside the form dump file, apart from useless info like Registers and so on, the message: "Could not find Module32First"
    I know for sure that SECURSIGN.DLL needs also other DLLs, and that the first foreign function I call, calls other functions in other DLLs. I found that Module32First is a routine within each of the following DLLs:
    Cl32
    d2kwut32
    d2kwut60
    I copied all those DLLs in the current work directory along with my FMB/FMX, in ORANT\BIN, in C:\WINNT\SYSTEM.
    I modified the PROCEDURE LoadLibrary (part of the FFI-generated PLL code) to load those DLLs along with SECURSIGN.DLL: no problem in loading all the DLLs that I wish, but the error persists.
    How can I avoid all that mess and the FRM-40734 error?? Is there a specific problem in resolving the references to other DLLs?
    Please notice that - on the same computer - in Visual Basic everything (and the very same call in particular) works perfectly.

    I have noticed just now that a dump file having a name like ifrun60_dump_299, is generated by FORMS every time I issue the aborted call to the foreign function.
    Inside the form dump file, apart from useless info like Registers and so on, the message:
    "Could not find Module32First"
    By a FILE/FIND/CONTAINING TEXT I searched all the DLLs, and I noticed that Module32First is a routine that can be found within each of the following DLLs:
    Cl32
    d2kwut32
    d2kwut60
    I tried to load those DLLs along with SECURSIGN.DLL by modifying the PROCEDURE LoadLibrary into the FFI-generated PLL code, and I have apparently no problem in loading all the DLLs that I wish, but the error persists, and that dump file is constantly generated, always looking for the "Module32First" routine.
    How can I avoid all that mess and the FRM-40734 error??

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

Maybe you are looking for

  • Is there a jabber client for iPad that will connect to Apple's iChat/jabber server?

    I've just purchased a third gen iPad and I'd like to be able to use the VPN connection in conjunction with an iChat client to communicate with my office's internal iChat/jabber server. However, none of the apps I've tried are able to successfully con

  • Dispute case auto closing

    Hi, I have created a dispute case on customer noted item, when i will reverse the noted item the dispute case is not auto closed, it is still in open status. can any one give me solution for this. Regards, Prakash

  • File Adapter - Content conversion parameters at Receiver

    Hi all, I'm trying to translate a XML message to a text line file. My XML message is this: <?xml version="1.0" encoding="UTF-8"?> <ns1:Proveedor_100011 xmlns:ns1="http://sap.com/xi/webservices/buyordint"> <config> <directory>c:/tmp</directory> <filen

  • My iPad was at 100% and then it suddenly shut down.

    Once my iPad shut down, I thought my battery died so I sent it in for battery replacement. They also charged my iPad for me. I brought it home and enjoyed my iPad until it completely ran out of charge. I plugged my iPad in and thought it was charging

  • Related to measures in a request in obiee

    Suppose we have two measures in request. Can we show one at X axis & other at Y axis?