Calling CAT API from lavbiew

hello,
I have this CAT (CAN Analyzer Tool). (http://www.ime-actia.com/web_can/software/cat_api_​driver.htm) and I using their API. I am having trouble with following API function. Can someone please help. I need to call this function from LV. Function is in their API dll.
I copy this from their VC++ code.
//////////////////////////////////////////////////​////////////////////typedef started///////////////////////////////////////////​//////////////////////////////////////////
typedef union {
  tCATOBJ_LogObj_Data Dat;
  tCATOBJ_LogObj_Error Err;
  tCATOBJ_LogObj_TriggerOnly TriggerOnly;
} tCATOBJ_LogObj,* PCATOBJ_LogObj;
typedef struct {
  unsigned char ChipStatus;
  unsigned char ChipErrorCodeCapture;
  unsigned char ChipRxErrorCounter;
  unsigned char ChipTxErrorCounter;
  unsigned short AccuRxErrorCounter;
  unsigned short AccuTxErrorCounter;
} tCATOBJ_ErrorInfo;
typedef struct {
  unsigned char Length;
  unsigned char ObjID;
  unsigned char ObjSubID;
  unsigned char EvenAddressFillupByte;
  unsigned char LogStatus;
  unsigned short LogNbrOfInBuffObjs;
  unsigned short LogOverflowCounter;
  unsigned short LogTriggerPoint;
  unsigned short DiagLogNbrOfInBuffObjs;
  unsigned short DiagLogOverflowCounter;
  tCATOBJ_LogObj LastTransferedObj;
  tCATOBJ_ErrorInfo ErrorInfo;
  unsigned short LogWritePointer;
  unsigned short DiagLogWritePointer;
} tCATOnlineData0,* PCATOBJ_GetOnlineData0;
//////////////////////////////////////////////////​/////////////////////////////////typedef finished//////////////////////////////////////////​//////////////////////////
unsigned char     *RecvBuffer;
 unsigned short nObj;
 tCATOnlineData0*   GetData0;
status = CATIDLL_ReceiveOnlineData(&RecvBuffer, &nObj);
GetData0 = (tCATOnlineData0*)RecvBuffer; 
GetData0->LastTransferedObj.Dat.FrameInfo;
 and so on.........
My question is how do I call this  CATIDLL_ReceiveOnlineData function in LV?
Is it possible to do in LV?
I have attached DLL and complete documentation for API. Please help.
Here is help from DLL***********************************************​*
CATIDLL_ReceiveOnlineData
The CATIDLL_ReceiveOnlineData function receives the online data from the CAT hardware board.
int CATIDLL_ReceiveOnlineData(
  unsigned char** ppRecvBuffer,
  unsigned short* pObjNum
Parameter
ppRecvBuffer
[out] Specifies the buffer for receiving the online data. You have only to specify the pointer. The memory will be allocated in this function internally.
pObjNum
[out] Specifies the number of received communication objects (PCATOBJ_GetLogObjs)
Return Values
If the function succeeds, the return value is CATI_OK. If the function fails the return value is defined in CATIERR.H
Remarks
Before you call this function, you have to call CATIDLL_RequestOnlineData.
The buffer ppRecvBuffer will contain the communication objects if there are some data available in the online buffer on the CAT hardware board. The communication objects have a dynamic length and they are mapped one after the other in the buffer. The first byte of every communication object contains the length of the own object. So, if you want to get a pointer to the second communication object, you have to add the value of the first byte from the first communication object to the pointer of the first communication object. See 'CatiAPI DemoDlg.cpp' OnBUTTONGetOnlineData() for a reference implementation.
Thanks.
CVI 2010
LabVIEW 2011 SP1
Vision Builder AI 2011 SP1
Attachments:
CAT.zip ‏235 KB

Brian B wrote:
Hey Sheetal,
    With LabVIEW, you can import dlls by using the Call Library Function Node VI.  Here is a link that describes its use.  Also, you can use the import dll wizard.  Here is a link describing that functionality.  There's also a good KnowledgeBase article about using external code in LabVIEW, and it includes other links that may be of use to you with this issue.
Yes but is that tool smart enough to handle this complex API? :-)
This one is using double referenced pointers allocated in the function itself and I'm sure the person would very much like to reference the data in there too. This is going to be a pita to do all in LabVIEW and I doubt a tool will be able to handle that automatically. Personally I would write a C wrapper function to handle this translation into more LabVIEW friendly data structures.
And Sheetal, you miss important information in your documentation. It is quite some guesswork as to how that function will fill in the character buffer with the data structures (the definition of the elements of the Log structure are nowhere defined), and even more so what data alignment it will use.
It is certainly doable but with quite some work. You have to define both parameters as an uInt32 passed by reference and find out the exact byte length of the entire GetData0 structure (this is really handwork if you do not write some intermediate translation DLL) and then allocate a long enough byte buffer (IntializeArray function with type uInt8 and the length computed with the size of your data structure multiplied by the number returned in the second parameter of your function. The using MoveBlock as explained in some other threads copy the data from the first uInt32 that is really a pointer into the byte buffer you just allocated and then extract the data from the byte buffer.
You could make it all a bit simpler in the runtime part by instead creating a cluster resembling your data object. But watch out LabVIEW uses byte packing while most DLLs use 8 byte alignement so yuo will likely need to add padding bytes in your structure to match the actual memory layout. Once you have the correct cluster you can just allocate an array of those clusters with the size indicated by the second parameter of your function and copy the data from the pointer into that array cluster with MovBlock and the computed byte size. This will avoid typecasting into the cluster later on and all the necessary byte swapping. 
Rolf Kalbermatter
Message Edited by rolfk on 12-11-2006 12:36 PM
Rolf Kalbermatter
CIT Engineering Netherlands
a division of Test & Measurement Solutions

Similar Messages

  • Calling Java API from ABAP using JCo (Part 2)

    Hello,
    This is an additional question to thread Calling Java API from ABAP using JCo
    Has anyone managed to get the input parameter value
    input.getString("REQUTEXT")
    that is being passed from ABAP?
    If yes, what kind of setting you need to do? Because when I execute, it has no value.
    Thus, the below ECHOTEXT parameter returns blank value:
    output.setValue(input.getString("REQUTEXT"),"ECHOTEXT");
    When I debug by printing the below line, the input XML is indeed without value:
    System.out.println(input.toXML());
    Anybody knows how to pass input variable from ABAP to JAVA using JCo?
    rgs,
    hiroshi

    Hallo Hiroshi,
    as far as I can see, you are doing it the right way. The problem might be that the ABAP program does not fill in this parameter because something went wrong in the SAP System.
    Have you tried setting a breakpoint (an HTTP session - remote breakpoint) and tried checking step by step if the value is being processed and put into the REQUTEXT field?
    Bye,
    Sameer

  • Calling Java API from ABAP using JCo

    I need to call Java API from ABAP & BSP also. For this I have got useful information related to JCo from following blog:
    /people/gregor.wolf3/blog/2004/08/26/setup-and-test-sap-java-connector-outbound-connection
    But, I am facing one problem. On executing Java program myExample5.java (recommended by Gregor Wolf) from command line I get following error message:
    Server JCOSERVER01 changed state from [ STOPPED ] to [ STARTED ]
    Exception in server JCOSERVER01:
    com.sap.mw.jco.JCO$Exception: (129) JCO_ERROR_SERVER_STARTUP: Server startup failed at Thu Apr 26 13:46:32 IST 2007.
    This is caused by either a) erroneous server settings, b) the backend system has
    been shutdown, c) network problems. Will try next startup in 1 seconds.
    Connect to SAP gateway failed
    Connect_PM  TPNAME=JCOSERVER01, GWHOST=gateway, GWSERV=3300
    LOCATION    CPIC (TCP/IP) on local host
    ERROR       hostname 'gateway' unknown
    TIME        Thu Apr 26 13:46:32 2007
    RELEASE     640
    COMPONENT   NI (network interface)
    VERSION     37
    RC          -2
    MODULE      ninti.c
    LINE        336
    DETAIL      NiPGetHostByName2: hostname 'gateway' not found
    SYSTEM CALL gethostbyname_r
    COUNTER     1.
    Can anyone please help me out. Do I need to do any setting?
    I'll surely reward points.
    Thanks & Regards,
    Nilesh Kumar

    Hi Nilesh,
    From the error i think that the error is with the hostname.
    Please enter the the Application Server IP/Hostname.
    If you are loggin to SAP System "XX1" from SAP GUI. Then click the change Item tab and see Application server name/IP let say "XX2" for hostname or "xx.xx.xx.xx" for IP.
    Replace <i>srv[0] = new Server("gateway","sapgw00","JCOSERVER01",repository);</i>
    with <i>srv[0] = new Server("XX2","sapgw00","JCOSERVER01",repository);</i>
    If App Server is IP then replace with
    <i>srv[0] = new Server("xx.xx.xx.xx","sapgw00","JCOSERVER01",repository);</i>
    Let me know if it is throwing any error.
    Thanks,
    Prashil

  • How to call Java API from BSP?

    I have a requirement to call Java API from BSP application.
    I have checked the forum and found that it is possible by using some ABAP codes.
    However there is no pointer on how this is done.
    Can someone explain the details on how to call Java API from BSP is done?
    I found class CL_EJB_JAVA_OBJECT_METHODS to call a method in EJB but can't find function or SAP class to call Java API.
    Actually is there any BSP extention which can used to call Java API?
    Thanks,
    Hendri

    check out these weblogs, it should give you an idea how to go about it.
    /people/ignacio.hernndez/blog/2006/12/04/speech-synthesis-listen-the-application-server-is-talking-to-you
    /people/puru.govind/blog/2006/12/20/let-abap-speak
    Regards
    Raja

  • Re: Calling Windows API from Tool

    Hi,
    If it's only for the UserName on NT you can get the environment variable
    USERNAME.
    Hope this helps,
    Daniel Nguyen
    Freelance Forte Consultant
    Url : http://perso.club-internet.fr/dnguyen/
    Tim Sawyer a &eacute;crit:
    Hi George,
    I think you need to find out which Windows DLL implements the function and
    then wrapper it, using Fort&eacute;'s C Wrappering technique. I'm going to be
    doing this for the GetUserName() function, so we can login to our
    application automatically, using the username that the user logged into NT
    with.
    Hope this helps!
    Tim Sawyer
    PanCredit
    Leeds, UK.
    From: Aberdour George <[email protected]>
    Date: Thu, 6 May 1999 09:08:03 +1000
    Subject: Calling Windows API from Tool
    Hi,
    Does anyone know how to call Windows API calls such as WinExec,
    CreateProcess, RegSetValue, etc directly from TOOL ?
    These are just examples calls. I know some Windows API calls can be called
    via equivalent OperatingSystem method calls, but I would really like toknow
    if it is possible to call Windows API routines directly.
    Thanks in advance,
    George Aberdour
    TAFE NSW-
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>-
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>

    I'm afraid we have to make it work for NT, 95 and probably 98 too, so we're
    looking for something a bit more robust than the environment variable.
    Thanks,
    Tim Sawyer
    PanCredit
    Leeds, UK.
    From: Daniel Nguyen[SMTP:[email protected]]
    Reply To: [email protected]
    Sent: 07 May 1999 20:40
    To: Tim Sawyer
    Cc: '[email protected]'; '[email protected]'
    Subject: Re: Calling Windows API from Tool
    Hi,
    If it's only for the UserName on NT you can get the environment variable
    USERNAME.
    Hope this helps,
    Daniel Nguyen
    Freelance Forte Consultant
    Url : http://perso.club-internet.fr/dnguyen/
    Tim Sawyer a &eacute;crit:
    Hi George,
    I think you need to find out which Windows DLL implements the functionand
    then wrapper it, using Fort&eacute;'s C Wrappering technique. I'm going to be
    doing this for the GetUserName() function, so we can login to our
    application automatically, using the username that the user logged intoNT
    with.
    Hope this helps!
    Tim Sawyer
    PanCredit
    Leeds, UK.
    From: Aberdour George <[email protected]>
    Date: Thu, 6 May 1999 09:08:03 +1000
    Subject: Calling Windows API from Tool
    Hi,
    Does anyone know how to call Windows API calls such as WinExec,
    CreateProcess, RegSetValue, etc directly from TOOL ?
    These are just examples calls. I know some Windows API calls can be
    called
    via equivalent OperatingSystem method calls, but I would really like toknow
    if it is possible to call Windows API routines directly.
    Thanks in advance,
    George Aberdour
    TAFE NSW-
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>

  • How to call remote API from root SharePoint 2013 domain (not an app)

    I'm trying to follow the article
    http://msdn.microsoft.com/en-us/library/office/fp179895%28v=office.15%29.aspx
    For a SharePoint 2013 hosted under O365, do I need to create an app to use the SP.* methods in sp.js? I need to call a remote API from the root domain (https://mycompany.sharepoint.com). But the app, as mentioned in the article
    above, deploys on a whole different URL (https://mycompany-a2d3f4t454.sharepoint.com).
    I need to be able to call the API from pages like https://mycompany.sharepoint.com/pages/default.aspx. Is this not possible?

    Hi,
    According to your description, my understanding is that you want to call remote API from the root domain site.
    Yes, you can use SharePoint hosted app to achieve it. SharePoint hosted app has app web and host web, you can create an app to call the remote api in the host web from app web.
    Here are some detailed articles for your reference:
    http://blog.ctp.com/2014/06/23/data-access-in-sharepoint-hosted-apps/
    http://msdn.microsoft.com/en-us/library/office/fp179925(v=office.15).aspx
    Best Regards
    Zhengyu Guo
    TechNet Community Support

  • Calling HRMS APIs from a DotNet plateform

    Hello,
    I am new on this forum and I have difficulty in beginning, i don't know if it's the right category to post my question.
    I'm working in a project looking for a solution of revision of the self-service's interfaces of oracle e-business suite, indeed I need an example or a document which can help me for using the HRMS APIs of oracle e-business suite via a dotNet plateform or SharePoint application.
    I have to work on a middelware allowing retreiving and persisting data from oracle e-business suite database using oracle HRMS APIs like hr_appraisals_api. So haw can i call these APIs from .NET application how can i use a .NET code to call these api's ?
    Can you help me please ? i'm waiting for your answers if possible and this is my e-mail address if necessary "[email protected]" .
    I would be so grateful if someone can help me. Thank you in advance.
    Cordially.

    HRMS PLSQL API can be called from Java and .Dot net support to execute Java API . This way it could be done.
    I have not idea how call PLSQL API from direct .Dot net code.
    Thanks

  • Calling java APIs from a function module

    Hi,
    Can someone tell me whether it is possible to call Java APIs from a function module in SAP system?
    Thanks in advance,
    Vineetha

    Hi,
    I guess you have changed the properties of screen only.
    I assume you have made a Ztransaction Code.
    When you define a transaction code, you need to specify a screen number for radio option program and screen and you need to specify a screen and not subscreen.( I think so!!)
    You changed only the code without changing the transaction code properties.
    Therefore, i think u r getting a dump.
    If you want to call your subscreen, call it in some screen and then call that screen using your transaction code properties.
    To include a subscreen screen in the subscreen area of the main screen and call its PBO flow logic, use the following statement in the PBO event of the main screen:
    PROCESS BEFORE OUTPUT.
      CALL SUBSCREEN <area> INCLUDING <prog> <dynp>.
    To call the PAI flow logic of the subscreen screen, use the following statement in the PAI flow logic of the main screen:
    PROCESS AFTER INPUT.
    CALL SUBSCREEN <area>.
    Refer:
    http://help.sap.com/saphelp_webas630/helpdata/en/9f/dbabfe35c111d1829f0000e829fbfe/content.htm
    Regards,
    Tanveer.
    Please mark helpful answers.
    Message was edited by: Tanveer Shaikh
    Message was edited by: Tanveer Shaikh

  • How to call SOAP API from JavaScript

    Hi,
    I'm trying to call the SOAP API to get statistics about emails. Are there any examples on how to call the API from JavaScript?
    Here is a link to my original question about using the REST API. REST API URL for email statistics
    Thanks,
    Tim

    Tim,
    In order to consume a SOAP API I recommend you use something other than JavaScript.
    Any platform can offer you a good SOAP client should be OK. (.Net, Java, php, Ruby, python).
    I didn't see anyone successfully used javascript and consume the Eloqua SOAP API.
    I know you can create a SOAP client in Java script but it will be too much work to handle the Eloqua response in some cases.
    Regards,
    Daniel

  • How to call OIM API from external app?

    Hi,
    I have an java application and I would like to call OIM API to accept a request. The application resides in separate server than OIM.
    My questions:
    *1.* What to do to call OIM API from external application (import any OIM jars etc.)?
    *2.* Which method to use, setRequestResponse , closeRequest or any other?
    I appreciate any help, thanks.
    Edited by: m.m. on Feb 2, 2010 5:33 AM

    Hello,
    If it is an external client, you need to provide the "login" and "password" details explicitly in the code (something like this), before getting any other Interface control to invoke the OIM APIs -
    public class OIMAPIClientTest {
    public static void main(String[] args) {
    try{
    System.out.println("Starting...");
    ConfigurationClient.ComplexSetting config = ConfigurationClient.getComplexSettingByPath("Discovery.CoreServer");
    Hashtable env = config.getAllSettings();
    tcUtilityFactory ioUtilityFactory = new tcUtilityFactory(env,"xelsysadm","abcd1234");
    System.out.println("Getting utility interfaces...");
    Regards,
    Amit
    Edited by: amitKumar on Feb 2, 2010 5:29 AM

  • Calling OIM API from a remote system

    Hi.
    I have OIM 9031 server installed on a computer HostA. And I have multiple copies of the 3rd party java program installed on HostB, HostC and so on.
    I need to be able to call some OIM API from that custom java program (for example, receive the list of active users from OIM server).
    According to OIM documentation, I can use Remote manager to manage users on non-network awared systems.
    But what if I use Remote manager for calling remote OIM API ? Is that possible?
    Or are there any easier ways to achieve my goal ?

    The installer in the AD sync connector is provided because in addition to having the OIM API client, there is a DLL that needs to be installed and registered to capture the plaintext password. It is not necessary to have an installer, but it might be be a convenience if you are deploying to many machines.
    Here is some code to get you started:
    import Thor.API.tcUtilityFactory;
    import com.thortech.xl.util.config.ConfigurationClient;
    import java.util.Hashtable;
    import org.apache.commons.logging.Log;
    import org.apache.commons.logging.LogFactory;
    public class TcUtilFactory {
    Log log = LogFactory.getLog("OIMCLIENT.UTILITY");
    private tcUtilityFactory factory = null;
    private Hashtable env = null;
    public TcUtilFactory() throws Exception {
    // you can also set these system properties on the command line
    System.setProperty("XL.HomeDir", "/opt/oimclient);
    System.setProperty("java.security.policy", "config/xl.policy");
    System.setProperty("log4j.configuration", "config/log.properties");
    System.setProperty("java.security.auth.login.config", "config/auth.conf");
    ConfigurationClient.ComplexSetting configClient = ConfigurationClient
    .getComplexSettingByPath("Discovery.CoreServer");
    env = configClient.getAllSettings();
    try {
    factory = new tcUtilityFactory(env, "xlsysadm", "xelsysadm");
    } catch (Exception e) {
    // handle exceptions thrown by tcUtilityFactory constructor
    From here you can write whatever methods you need going against tcUtilityFactory. Also note that you will need many of the jars from your lib directory as well as the properly configured xl.config and other files in the config directory that the design console client uses (I usually just copy them from that install). Last you will need to make sure you have the required jars specific to you app server (the ones you need to copy over during the design console install)

  • Getting error while calling AME api from the page

    Hi,
    I am calling ame api ame_api2.getallapprovers7 from our custom page.I have written following code-
    public void getapprovers(String transactionid)
    String OutError = "";
    ArrayList al = new ArrayList();
    OADBTransaction trans = getOADBTransaction();
    String insStmnt = "BEGIN " +
    "ame_api2.getAllApprovers7(applicationIdIn => :1,transactionTypeIn =>:2,transactionIdIn =>:3,"+
    "l_processYN =>:4,approversOut =>:5); " +
    "END;";
    OracleCallableStatement stmt = (OracleCallableStatement)trans.createCallableStatement(insStmnt, 1);
    try
    stmt.setString(1, "800");
    stmt.setString(2, "XXXXCWKAPP");
    stmt.setString(3, transactionid);
    stmt.registerOutParameter(4, OracleTypes.VARCHAR);
    stmt.registerOutParameter(5, OracleTypes.ARRAY,"XXXX_APPROVER_TABLE");
    stmt.execute();
    // OAExceptionUtils.checkErrors as per PLSQL API standards
    OAExceptionUtils.checkErrors(trans);
    ARRAY arrayError = stmt.getARRAY(5);
    Datum[] arr = arrayError.getOracleArray();
    for (int i = 0; i < arr.length; i++)
    oracle.sql.STRUCT os = (oracle.sql.STRUCT)arr;
    Object[] a = os.getAttributes();
    System.out.println("Column:" + a[0] + " Value:" + a[1]);
    //OutError = (String)a[1];
    //al.add(new OAException(OutError, OAException.ERROR));
    stmt.close();
    catch(SQLException sqle){
    try { stmt.close(); }
    catch (Exception e) {;}
    throw OAException.wrapperException(sqle);
    if (OutError != null)
    // OAException.raiseBundledOAException(al);
    4 and 5th parameters are out parameters and 5th parameter provides the approver records and it should have the same data type as ame_util.approversTable2. I have created this table type explicitly in oracle by the name XXXX_APPROVER_TABLE but i am getting the error while running the page "java.sql.SQLException: Fail to construct descriptor: Unable to resolve type: "APPS.ETHR_APPROVER_TABLE"". I requirement is to take the 5th parameter in ame_util.approversTable2 data type.
    Please help me urgently.
    Thanks
    Ashish

    Hi Kumar,
    The ETHR_APPROVER_TABLE is custom pl sql indexed table that I have created.following are the parameters of api-
    procedure getAllApprovers7(
    applicationIdIn in number,
    transactionTypeIn in varchar2,
    transactionIdIn in varchar2,
    approvalProcessCompleteYNOut out varchar2,
    approversOut out nocopy ame_util.approversTable2);
    i need a out variable of type ame_util.approversTable2 so get the values.
    I have changed the code and now getting the following error-
    java.sql.SQLException: ORA-03115: unsupported network datatype or representation
    I have only changed this statement.
    stmt.registerOutParameter(5,OracleTypes.PLSQL_INDEX_TABLE);//,"XXXX_APPROVAL_TBL");
    Edited by: user5756777 on Jul 13, 2009 4:17 AM

  • Calling Portal APIs from Apex

    I have posted this on the application express forum as well, not sure who will come up with the answer, so here is my question anyway.
    I am trying to call the portal.wwsec_api from within an apex application. The application is parsed using the portal schema so has all the correct grants by default.
    The code I am using is:
    declare
    l_person_rec wwsec_person%rowtype;
    begin
    l_person_rec := wwsec_api.person_info
    p_user_name => 'PORTAL'
    :P3_USER_INFO:=l_person_rec.user_name || l_person_rec.first_name;
    exception
    when others then
    :p3_user_info:=sqlerrm;
    end;
    This code (minus the item references) runs fine in sqlplus, but errors when I run it in apex. I have narrowed it down to the api that is erroring as I can access the table direct.
    Can anyone help with this?
    Thanks

    I have now solved this problem. If you want to access portal apis from apex you need to set a portal context like this:
    portal.wwctx_api_private.set_context( p_user_name => 'portal'
    , p_password => 'portal');
    This shouldn't impact security as the value of p_password does not have to be your schema password it can be set to anything.

  • Calling Windows API From Forms.

    For example, how can i call the MessageBoxA function from user32.dll whilst working in an Oracle Forms Application.
    Thank you.

    You shall have to use the WEBUTIL_C_API.Invoke_Int function for this purpose. Please see the following example that Locks the workstation.
    -- IMPORTANT
    -- Be sure to review the following My Oracle Support Note
    -- Doc ID: 285331.1 - "Exception When Calling PASCAL style Function Via WebUTIL_C_API"
    declare
      rc pls_integer;
         f_handle WEBUTIL_C_API.FUNCTIONHANDLE;
         args Webutil_c_api.parameterlist;
         winSysDir varchar2(255) := Client_Win_API_ENVIRONMENT.Get_Windows_Directory || '\system32\';
    --- IMPORTANT ---
    -- WEBUTIL_C_API CURRENTLY ONLY SUPPORTS CALLING C STYLE LIBRARIES, THEREFORE SOME WINDOWS LIBRARIES CANNOT BE CALLED.
    -- ADDITIONALLY, IT IS NOT RECOMMENDED THAT YOU ATTEMPT TO CALL FUNCTIONS WHICH REQUIRE ARGS.
    -- USE EXTREME CAUTION WHEN CALLING WINDOWS APIS.
    -- BE SURE TO THOROUGHLY TEST BEFORE MOVING TO PRODUCTION
    -- LOOK CLOSELY AT BOTH STABILITY AND MEMORY USAGE AS SOME CALLS
    -- MAY RESULT IN THE APPEARANCE OF A MEMORY LEAK.
    -- This call to USER32.DLL will reference the LOCKWORKSTATION function.
    -- If the current OS user does not have a password configured, the workstation may not lock.
    -- The Windows LockWorkStation function requires no args to be passed in.
    -- WebUtil expects something to be passed in. So an empty paramlist will be created.
    begin
    If webutil_clientinfo.get_operating_system LIKE 'Win%' Then          
         f_handle := WEBUTIL_C_API.register_function(winSysDir||'user32.dll','LockWorkStation');
         args := WEBUTIL_C_API.create_parameter_list;          
    If the function succeeds, the return value is nonzero. Because the function executes asynchronously,
    a nonzero return value indicates that the operation has been initiated. It does not indicate whether
    the workstation has been successfully locked.  If the function fails, the return value is zero.
        http://msdn.microsoft.com/en-us/library/aa376875(v=VS.85).aspx
         rc := WEBUTIL_C_API.Invoke_Int(winSysDir||'user32.dll','LockWorkStation',args);     
    End if;
      WEBUTIL_C_API.Destroy_Parameter_List(args);
      WEBUTIL_C_API.Deregister_Function(f_handle);               
      SYNCHRONIZE;
    end;

  • Calling Oracle API from controller

    Hi,
    I need to call a Public API from controller.
    API procedure is having 85 parameters,but only few are manadatory. can someone tell me whether i need to pass all the parameters with default values or null or is there anyway i can pass only required parameters.

    Hi,
    import oracle.jdbc.OracleCallableStatement;
    import oracle.jdbc.OracleTypes;
    You create a callable statement like,
    OracleCallableStatement callableStatement = null;
    String callStr = " BEGIN mypackage_pkg.add_ite, "+
    "(p_organization_id => :1, " +
    " p_batch_id => :2, " +
    " p_reason_code => :3, " +
    " x_msg_count => :4); "+
    " END; ";
    callableStatement = (OracleCallableStatement)getOADBTransaction().createCallableStatement(addWriteOffItem,1);
    //Set in and out variables like,
    callableStatement.setNUMBER(1, organizationId);
    callableStatement.setNUMBER(2, batchId);
    callableStatement.setString(3, reasonCode);
    callableStatement.registerOutParameter(4,OracleTypes.VARCHAR,255);
    //Then execute the stmt
    callableStatement.execute();
    resultMessage = (String)callableStatement.getString(4);
    The code should be inside the try catch block.
    Thanks,
    With regards,
    Kali.
    OSSI.

Maybe you are looking for

  • Proxy to SOAP scenario-With Attachment and Mapping

    I have a scenario to be developed, it is a Proxy to SOAP sceanrio. There are about 8 fields coming from Proxy. Can we create an attachment from these fields. Also we have to do a mapping of this attachment to a field in the target External Defination

  • Problem with iphone after update

    Hey guys, I am having a bit of bother with my iphone. Basically i was given an iphone 3g and I'm not really sure where it came from but it had a vodafone sim, I am on an orange contract so i took out the vodafone sim and put the orange one in and to

  • X1900 XT goes black during games

    My roommate started reporting this first, but now I'm getting it fairly often as well. After a little while playing any "difficult" 3D game (Halo, Quake, etc) the screen will turn black and not come back. I'm assuming it's heat related, but I have no

  • Message confirm in BSP like in Javascript

    Hi there, I would like to know if there is a confirm dialog box défined in BSP/ABAP like in javascript in order to confirm or not the action in a onInputProcessing? I tried to put a javacscript function with the confirm dialog box in a onclick but th

  • Browser - links that open in "new" window

    How does the Kin handle opening links that open in a new window? Does the original window get "closed" when a link opens in a new window? Or can you hit the back button to return to the previous window? Or can it somehow open multiple windows? Has an