Why fail to call third party funciton in DLL via JNI but workable in C++?

Hi,
I need someone help me here.
I like to call a function in third party A.dll which is from PowerBuilder App by Java.
So first I worte C++ code to call A.dll for the function to confirm: String feGetMM( String a);
I worte code like here in C++:
typedef char * (CALLBACK PROC_ADDR) ( const char);
const char* NAME = "feGetMM";
PROC_ADDR procAddr;
const char* passin = "123";
char * result;
HINSTANCE hinstLib = LoadLibrary( A.dll ); //load 3rd party library
if(hinstLib!=NULL) {
     //get the function address
     procAddr = (PROC_ADDR) GetProcAddress(hinstLib,NAME);
     if(procAddr!=NULL)
          result = (procAddr)( passin ); //call the function
I got right result.<<<<<<<<<<<<<Then second I worte the same as C++ in JNI code to generate B.dll
JNIEXPORT jint JNICALL Java_xxxxx_feGetMM
(JNIEnv *env, jclass cl, jstring jstr) {
typedef char* (CALLBACK PROC_ADDR) ( const char);
const char* NAME = "feGetMM";
PROC_ADDR procAddr;
const char* result;
HINSTANCE hinstLib = LoadLibrary( A.dll ); //load 3rd party library
if(hinstLib!=NULL) {
     //get the function address
     procAddr = (PROC_ADDR) GetProcAddress(hinstLib,NAME);
const char* cstr = env->GetStringUTFChars(jstr,NULL);
     if(procAddr!=NULL)
          result = (procAddr)(cstr); //call the function
fails return NULL<<<<<<<<*the B.dll builded successfully, but fail to call for result. The java main() call is fine. The "result" is always NULL.
I worte the same as C++ code in JNI but why it fails in JNI code call by Java?
I will appreciate your help if you could reply it quickly.
Thanks !

The crashdump fragment tells me that your program has jumped to location 0. That's usually an uninitialized pointer

Similar Messages

  • Call third party Executable file.

    How to call third party executable file from SAP as a modal.
    I have a drum filling system. I want to call executable file of drum system which take a weight from instrument and write a text file. After completion of this SAP will read that text file and write it to screen.

    the best way to do it is using RFC (remote function call)
    your drum tool should be compatible in order to do it
    if not you can still send a command to operating system in order to execute your tool but this is a second choice

  • How to call third party validation service from self service page

    Anyone can help me out on what needs to be done to call third party address validation service when button "Next" Personal Information page of Employee Self Service is clicked.
    1. Writing Custom XXXAddressUpdateCO by extending AddressUpdateCO. XXXAddressUpdateCO's processFormRequest will validate the address using the third part service. This third party address validation service is in the DB where Oracle Apps is there.
    To use this service from the controller, how can I set the new application module XXXAdressUpdateAMImpl where I will make call to this service and return the result yo Custom controller class.
    Any suggestions?

    If your page does not have LOVs, then you can extend and substitute the AM. Thereafter include the code to invoke the third party validation from the AM.
    Otherwise you may need to write the invoking code in the Controller itself.
    Hope you got some clues. Let me know if you need more information.
    Thanks
    Sumit

  • Printing from iPad - Why do I need third party app to print to a local network printer??

    Why do I need to pay for a third party app to print to ALL local network printer?? I understand that only some printers are compatable with iPads, but yet application like "iCanPrint" allow me to print just fine to a printer connected to my network. Why can't Apple include this as one of its features? Technology is apparently there?

    For that, and the many other apps to work, you need to be running a pc or Mac on the network.  The answer is drivers.  Every printer in the world needs a driver.  There simply is not enough space on a pad to load every possible printer driver that might be in play.  in the pc world, the operating system comes preloaded with hundreds of common drivers, and when you buy and install a new printer, you download the new drivers for that new printer.
    That all just will not work on a pad or phone.  So apple flipped the issue upside down, and said...'here is the printer driver we will make standard for its devices.  We call it AirPrint.  Include this in your printer'.    A lot of manufacturers have, and more printers are enabled each month.   
    So your choice is pretty basic.  You can buy an AirPrint enabled printer and print directly to it, or buy a non AirPrint printer, or use the one you have, and rely on your pc to act as the translation device to manage the print job.

  • How to Call third party Jar into Application

    Hi Can any Expert help ?
    I want to put third party Jar into my application but i have some problem occur.
    1. how to call jar with parameter in application ?
    2. when i exit the third party jar task, it will exit my main task too. How to set my main tast exit stats standalone ?
    3. I have over 10 jar files in one application, how can i set a classpath for client to call JNLP, instread of load all jar to client before run.
    Thanks.
    Sanki Poon ([email protected])

    1) Sounds like you are trying to launch the third party from it's application main instead of using it as an API How does your code interact with it or is that not important?. You don't call a jar, you load a class. You could use a exec http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Runtime.html to run the java launcher and pass it all it's command line stuff(But this may not be possible security wise via WebStart).
    2) if it is launched in the same JVM and it calls a System.exit there is nothing you can do about your app closing too. It would need to be in another instance of the JVM
    3) Under the resources tag you can have as many jar tags as needed.
        <resources>
            <j2se version="1.5.0" java-vm-args="-esa -Xnoclassgc"/>
            <jar href="/jsf-wita/apps/MathMLWebEditor.jar"/>
        </resources>

  • Calling third party application that needs the HttpServletRequest parameter

    Hi,
    I am doing the customizations to the Webcenter portal(since the issue is specific to ADF, I am posting the thread in this group) wherein I need to invoke a Java API provided by third party. That Java API expects the HttpServletRequest parameter.
    To obtain the HttpServletRequest , I used the below code: -
    FacesContext context = FacesContext.getCurrentInstance();
    HttpServletRequest request =
    +(HttpServletRequest)context.getExternalContext().getRequest();+
    Besides, I need to set some parameters to the request, as the API needs those parameters to connect to the 3rd party application. Hence I have set the attributes as below: -
    request.setAttribute("HttpProxyHost", "https://thirdparty.com");
    request.setAttribute("HttpProxyPort", "2021");
    request.setAttribute("HttpProxyUser", "abcd");
    request.setAttribute("HttpProxyPass", "efgh");
    The call to the API works fine when tested standalone. But after deploying this to the application, I see the following issue.
    The ADF application interacts with other 3rd party applications too. Once the above code is executed, the application is trying to connect to the above host(https://thirdparty.com) only for the subsequent requests from any user of that application, even if the actual call is meant to connect to different hosts.
    Can I create a custom servlet class to invoke the Java API? If so, how can I call that servlet API from my ADF managed bean?
    Even if I create a custom servlet, the parameters that I set like HttpProxyHost will persist, right?
    Please provide any suggestions
    Thanks,

    Hi,
    1) what is the problem you think makes this specific to ADF?
    2) Have you tried : http://docs.oracle.com/javase/tutorial/networking/urls/connecting.html
    Your requirement of changing a request that is in process sounds weird to be honest
    Frank

  • Calling third party java page from self sevice page

    Hi,
    Is it possible to call a third party java (html+java) form page (residing in separate web service server) which would take input from standard Oracle apps (OCO) self service OAF page?
    The third party page would validate the fields sent by OAF page and then will provide the results which should be copied back into standard oracle OCO page (self service OAF page)
    From How to open HTML page from OAF it looks like this is possible.
    Can you please confirm ?
    Regards,
    Aneesh

    Technically it will depend more on the third party system involved in the discussion and the way it is integrated. But in the simplest terms, url parameters will always work.
    --Shiv                                                                                                                                                                                                                                                                                                                                                                               

  • Calling third party java page from Oracle form

    Hi,
    Is it possible to call a third party java (html+java) form page (residing in separate web service server) which would take input from standard Oracle form (OCO) page?
    The third party page would validate the fields sent by form page and then will provide the results which should be copied back into standard oracle OCO form page.
    Regards,
    Aneesh

    Don't know if you can do this from Forms PL/SQL, but you should be able to write a stored procedure in the database that does it for you. The stored procedure could use the database package UTL_HTTP to make the HTTP request and receive the response.
    Your custom stored procedure can be called from Forms PL/SQL. If you are caling to a tru web service, you can also look at the UTL_DBWS package which is a bit more high level for calling a web service, than the raw UTL_HTTP package.

  • How to call third party software from Ecc6 using ABAP

    Hi all,
    I need to execute a third party software using abap coding .
    The software converts doc to pdf, the input from ecc6 would be the file path.
    I need to do this using ABAP.
    thanks
    ziv.

    Hi Ziv
    You can use METHOD cl_gui_frontend_services=>execute
      EXPORTING
        application            = <<<.exe file>>>
        operation              = 'OPEN'
    to run .exe files
    Best Regards
    Yossi

  • How to integrate third party API and DLL

    Dear sir/Madam
    How can i integrate the third party high level API and DLL into my DLL, project keeping in view that all their functions and their definitions kept hidden. i have tried it but when importing the functions in the DLL and export the high level functions, compiler demands their declarations and prototypes.
    Is their a way to hide all these high level functions and still utilize them.
    thanks, regards
    Zafar

    Hi Matrix39,
    The compiler will still need the proper prototypes for the functions called in the third party DLL to compile your DLL whether you are using explicit or implicit linking to call the functions.  Declaring these prototypes in your DLL does not mean they will be exported by your DLL.  The functions exported by your DLL can be configured by navigating to Build»Target Settings in CVI.  From here you can configure what functions your DLL exports by clicking the Change... button in the Export section.  There are several options for specifying the functions including using header files and manual export declarations.  See the CVI Help for more information.
    Justin D
    Applications Engineer
    National Instruments
    http://www.ni.com/support/

  • Allow desktop interaction within Azure Cloud Service with third-party desktop app (automated via code)

    Hello,
    I am developing a wrapper service as Worker Role which will take request from Service Bus and automate a third-party desktop app to produce an output file and then upload result back to our web server.  The automation is accomplished with the app's
    built-in .Net remoting based API.  This all works on my local development machine.  I am using code as below to start the desktop app.  In Azure:
    If I am not logged on to RDP and run the app as SYSTEM (or whatever the default WorkerRole account is), it waits forever for the MainWindowHandle.
    if I start the app manually in the RDP and try to get a reference to the running process (again as SYSTEM), I get Access Denied from WaitForInputIdle.
    if I start the app from code as the RDP user (ProcessStartInfo assign user/pass), I get InvalidOperationException - the app might not have a graphical interface from the WaitForInputIdle.
    Could anyone suggest the proper strategy for starting processes in a Worker Role that must create a window?
    For reference, I only care about the window to the extent that I need to make sure it's there.  All other interaction with the process is via the .Net Remoting API.
    private void GetOrStartThirdPartApp()
    _process = Process.GetProcessesByName("ThirdPartApp").FirstOrDefault();
    if (_process == null)
    _process = new Process();
    _process.StartInfo.Arguments = string.Format(@"-I ""{0}""", config.GetSetting("RolePath"));
    _process.StartInfo.WorkingDirectory = config.GetSetting("WorkingFolder");
    _process.StartInfo.FileName = config.GetSetting("ExecutablePath");
    _process.StartInfo.LoadUserProfile = true;
    _process.StartInfo.UseShellExecute = false;
    if (config.GetSettingAsBoolean("StartThirdPartAppWithRunAs", false))
    _process.StartInfo.UserName = "user";
    var password = new SecureString();
    foreach (var c in "thepassword".ToCharArray())
    password.AppendChar(c);
    _process.StartInfo.Password = password;
    _process.Start();
    while (_process.MainWindowHandle == IntPtr.Zero) Thread.Sleep(50);
    _process.WaitForInputIdle();
    _process.Exited += _process_Exited;

    I'd keep the app with the UI and the queue reader in the same process and account - not a worker role.  On start up you launch the desktop application and the queue reader in the same account, one after another.
    From what I've experienced, two users don't have the same
    Window Stations, so you can't pass a window handle in a different logged-in account across that boundary.  Read the Window Station documentation - you may find something that helps.
    You could use other techniques like sockets to communicate cross-process and cross-window station, too.
    Darin R.

  • How to use third party library (like .dll and .lib files) in flascc?

    I have a number of .dll and .lib files of the  third party library, which are generated from C++ code.
    I read about flascc on other web site says:
    "If you want to use third party library in your Flascc project,you must have either the source code or the linkable file which is compiled of the third party library   "
    Dose the linkable file mean .dll file or .lib file?
    AND
    How can I use the fuctions in them in my flascc project.?

    Native code is not interchangeable between platform.
    It means that you can't use library that wasn't build specifically for flascc.
    And when they say linkable files they mean libraries compiled for flascc, not any libraries.
    So if your libs are for windows, no luck, you have to recompile everything

  • Failed when migrating third-party database, need your help

    hi,
    I use the quick migration function of SQL Developer,
    the step 4 could not passed, in this step 8 items checked, and the second(locate source plugin) item failed.
    I want find the detail reason, but I have no idea with the item.
    So If anyone know about this item(locate source plugin), help me.
    Thank you very much.
    wait on line.

    See the homepage for Setting up the Environment (Getting Started) and other relative stuff.
    Have fun,
    K.

  • Plug in calling third party functions like MS Office programs or other .exes

    This is a question I wrongly asked in the scripting section of the forum.
    I am a 100% beginner making sure that what I want to do is possible.
    From a plug-in what is the best way to communicate/signal/start or to tell another program (would be great if it was Ms Access) that an event has happened.
    Or some yes/no questions
    If I can call a function from C++ generally, then I can call that function from within my plugin?
    or
    Can I call a MS Access function from a plug-in?
    Can I call a self made .exe function from a plug-in?
    Can I start some other self made .exe maybe from a plugin?
    Thanks in advance again.

    Hello,
    As the plug-in is written in C++ you can use all C++ operations. So it's possible to call another functions and of course also to run an application.
    Regards,
    Joe

  • Why there is a third party software to remove duplicated music and your help center have the ctrl and selick one at time

    need to remove duplicate music in itune

    For what it is worth, I am a fan of NuGen, I have both SEQ 1 and 2 and two stereo enhancing tools (stereoizer and stereoplacer I think they're called). Since I have the SEQ 1 it replaces all Channel EQ's. And the stereotools sound great and very lush, in stead of the more usual cheezy combfilterthingies that pass for stereo enhancing tools.
    And I actually like the interfaces. Simple, but stylish, functional and ergonomic (in this case meaning you can see all parameters in a quick glance, no guessing at settings).

Maybe you are looking for

  • t:jscookmenu is not working in Jboss portlet.

    hi.. i am facing a problem in <t:jscookmenu>, that is , i am using the JBoss portlet 2.4 and my aim is to provide a top menu in the default index page.i tried with <t:jscookmenu> , but it is throwing error(scroll down for error code), but <t:outputte

  • Multiple RFC calls in one LUW

    Hi Guys, Is it possible to do multiple RFC(receiver) calls in a single LUW(Logical Unit ofWork) in PI 7.0?? If yes, can any1 pls tell me from which SP level has this been enabled??Also what settings do i need to do to create the scenario?? Thanks Var

  • Single excise registraction to two excise registration with same company code

    Dear all, Our customer is using single excise registraction now with three plants and one company code and doing STO between the plants with shipping (641/101). We have implemented SAP with the above scenario. (SAP ECC 6.4 implementation with TAXINN

  • How to configure to run SNP that creates only PReq and Stock Transfer only?

    Hi all, I am very new to SCM. Please help me on the scenario like this: -There are 3 Distribution Centers (DC): 2400, 2500, 3800 and a Vendor: 1003. -Each DC can take products from otherDC. But only DC 2400 can directly send purchase requisition to V

  • UNIX: problem running an DEV & QA environment using form/report servlets

    UNIX: problem running an DEV & QA environment using form/report servlets I am trying to setup on one server an DEV and QA environment using the Forms Servlet, Forms Listener Servlet and Report Servlet. I think I have the Forms Servlet and Forms Liste