How to invoke a window using JNI?

Hello,
I need to invoke a C++ DLL from a Java Applet using JNI. The DLL should display an image in a separate window. Further I should be able to set the position of the DLL window, and should be able to minimize, maximize the DLL window from the Applet.
Well I am fairly new to C++. Any suggestions regarding how I should proceed?
GLim

Hi jschell,
Thanks for the reply.
But I am sorry that I am not sure whether I understood your point. What I understood is I make an exe that displays the image and run it from Java like SHELL function in VB. In that case can I specify a particular image to be loaded from the applet? The applet and exe needs to be constant touch as the location , size etc of the window displaying the image could be controlled by the applet.
I have created a DLL which displays the specified the image in a modeless dialog box. I have succeded in invoking the DLL from applet. But the dll window hangs as soon as it loads! I got a suggestion to implement the display of modeless dialog box inside thread. Now I am investigating how to implement thread :) Please send in your advice if you have any?
Also it could be real help if you could mentions common problems that might occur in such situations.
Thanks in advance
gLim

Similar Messages

  • How do I install windows using BootCamp without cd drive fot the new MBP?

    I need some softwares for my work (modelsim, altera, ltspices etc) but some of them only supports windows.
    New MBP doesnt seem to have a cd driver.
    How do I install windows using bootcamp without cd drivers?

    You can use a USB thumbdrive to do this, assuming you have access to a windows machine to format the usb stick.
    I installed Win7 on my MB Air (2011), which of course lacks a DVD drive altogether, using this technique.
    Basically, you download a tool called rEFIt to your macbook. ( http://sourceforge.net/projects/refit/files/rEFIt/0.14/rEFIt-0.14.dmg/download ) When this is installed, it gives you a boot selector menu when you boot the Macbook ('Do you want to boot to MacOS or to the USB drive?')
    Then you download and run an Apple tool called Boot Camp Assistant, which allows you to partition your HD for the two operating systems to share; it also pulls down all the windows drivers you need.
    Then prep the USB thumbdrive on a windows machine to be a Win7 installer disk. You'll want a drive in the 4gb+ range I think. You have to set up the thumbdrive to be bootable (lots of tools for that available), and then copy all the windows installation files over to it.
    Put the thumbdrive in the macbook and boot holding down the option key.
    Choose the rEFIt icon on boot, then choose to boot from the thumbdrive, then format your new windows partition to something Win7 can handle, and install windows.
    On my machine I followed a slightly more involved process and wiped out MacOS entirely. I would have kept it on a small partition if I'd had a bigger hard drive.
    If you need super detailed instructions, CNET has some here:
    http://howto.cnet.com/8301-11310_39-20020513-285/install-win-7-on-macbook-air-fr om-a-usb-drive/
    Tech-Recipes has some similar instructions here:
    http://www.tech-recipes.com/rx/9136/macbook-air-install-windows-7-with-boot-camp -without-an-external-dvd-drive/
    If you have any issues after trying this, ping me and I may have solved them when I went through the same process.

  • How to invoke the DisplayTemplate using URL

    Hi
    Here i am trying to invoke display template using url. But i am getting error .
    i am using the following URL
    http://hdchctdam34235/Lighthammer/ChartServlet?Width=640&Height=400&QueryTemplate=/Samples/Reports/SalesQuery.xml&DisplayTemplate=/venkat/sampleAppl/sample_report_example3.xml&Content-Type=image/gif&IllumLoginName=venkat&IllumLoginPassword=venkat
    please help on this

    Venkat,
    I agree with Rick on all three points...
    Hint:  Take a look at how dynamic page generator builds it's URL.
    Sam

  • How to implement button installer using JNI or any native code

    Hello All,
    I am trying to implement installer that install button on internet explorer using JNI or native code so i am new to this technology .please suggest some approach.
    Thanks All

    Why would you ever do that?
    There are a host of languages that will do that and many scripting. You can easily write Applets and services in Java that will work in IE, but to just add a button... just doesn't make sense.

  • How to invoke BPEL process using Oracle Business Event System (BES)?

    Hi,
    I want to invoke a BPEL process using Business Events and Subscriptions (Oracle BES/Workflow). If anyone knows how this can be done, please reply to this thread. You can also mail me at [email protected]
    Thanks,
    Gaurav.

    yeah you are 100% correct ..
    I have attached some stuff for CDH integration, where we used plsql to send out info on a created record to a queue.
    CREATE OR REPLACE
    TYPE XXBPEL_MESSAGE_TYPE AS OBJECT (
    MSG_ID VARCHAR2(128),
    INREPLYTO_MSG_ID VARCHAR2(128),
    FROM_PARTY VARCHAR2(512),
    TO_PARTY VARCHAR2(512),
    ACTION_NAME VARCHAR2(512),
    MSG_TYPE INT,
    PAYLOAD CLOB,
    ATTACHMENT BLOB
    EXECUTE DBMS_AQADM.create_queue_table (queue_table => 'XXBPEL_QTAB',queue_payload_type => 'XXBPEL_MESSAGE_TYPE',multiple_consumers => TRUE);
    EXECUTE DBMS_AQADM.create_queue (queue_name => 'XXBPEL_OUT_QUEUE',queue_table => 'XXBPEL_QTAB');
    EXECUTE DBMS_AQADM.start_queue(queue_name => 'XXBPEL_OUT_QUEUE',dequeue => TRUE,enqueue => TRUE);
    On BPEL side creata a process that listens to this queue (with and AQ partnerlink) as shown in $BPEL_HOME/integration\orabpel\samples\tutorials\124.AQAdapter\MulticonsumerInbound
    thx clemens

  • How to invoke the JwscTask using Ant Api

    Hi,
    I need to invoke the weblogic JwscTask <jwsc> from a java class using Ant API, one way to do this is to write a build.xml file with the specified ant task and use the appropriate Ant api, whereas my requirement is to directly create a Task object and run the task how should one go about doing the same as the JWSCTask API is not open.
    Thanks in advance
    Regards,
    Preethi

    Hi,
    I will agree with Martin on first you should take a step back and see the business drive for the use case but stil if you have to do it below is my thought to fire disable/enable task.
    1.Insteed of firing a particular enable/disable task its better to enable/disable the resource.
    2.To enable/disable the object instance you can use enableAppForUser()/disableAppForUser() method of tcUserOperationIntf which will in end will fire enable and disable task.
    To kick of update task I will suggest to update the form field usingsetProcessFormData() method if tcFormInstanceOperationsIntf which will in result will kick of the update task.
    Hope this will help.
    Regards
    Nitesh

  • How to stop popup window using phone layout for display - Responsive HTML5, RH11

    Hello,
    I'm using the new Responsive HTML5 output in RH11. For some of my hyperlinks, I want to use a pop-up to display the linked topic. In the output, the pop-ups work, but they are automatically displayed using the phone layout, with the associated navigation buttons at the bottom, the help title, and so on. I don't want this - I just want a plain popup window. So, I tried to add a Screen Profile, set to 400 x 500 pixels exactly (thinking that this is bigger than a phone, but smaller than a tablet). I also added a corresponding Screen Layout. In the popup properties, I set the popup size to be 400 x 500 pixels. I guess there is something else I need to do to get this to work... but I don't know what that is. (I tried creating a new Window on the Project Set-up tab, and I tried creating a different master page. These things didn't work.)
    Can anyone tell me if what I'm trying to do with these popups is just a bad idea and it won't work well with certain browsers?
    Thanks!
    Alexandra

    I am confused as the responsive layouts are one size fits all, that is the point of them. You have one layout that morphs according to window size.
    Screen Profiles are only used within Multiscreen HTML5 layouts where you can map screen profiles to different adaptive screen layouts, such as desktop, tablet and phone. That mapping does not apply to responsive layouts.
    See www.grainge.org for RoboHelp and Authoring tips
    @petergrainge

  • How to invoke a servlet using a tag?

    hi,
    I have written a programme where I need to invoke a servlet from a hyperlink rather than a submit button,which is usually used to invoke a servlet.I hope you can help me out.
    thanks in anticipation
    regards
    Deepa Datar

    Thanks.
    Earlier I didn't get it because I was using doPost() method instead of doget().
    Thanks once again.
    Deepa Datar

  • Can I invoke instance method using JNI pointer

    Hi,
    In my work, I need to pump data from dll to my java application.. for this I came to the following workaround.
    1. Created a static method with (printMe()) in my java class (GrabTest.java)
        public static int count = 5;
        public static int printMe(int a)
            System.out.println("result printMe : " + a);
            return count--;
        }2. Invoked this class object in dll side as follows
         jclass cls = env->FindClass("GrabTest");
         jmethodID mid = env->GetStaticMethodID(cls, "printMe", "(I)I");
         jint count = env->CallIntMethod(cls, mid, 10);
         cout<<"Count =" <<count<<endl;This works fine, i able to invoke the static method of GrabTest class from dll and I can pass an int value from there.
    I tried to call a not static method which in GrabTest.java, from dll as follows
            jmethodID mid2 = env->GetMethodID(cls, "printMe", "(I)I");
         jint counter = env->CallIntMethod(cls, mid2, 10);
         cout<<"Counter =" <<counter<<endl;when I try to invoke the instance method from dll, my application get crashes.
    So, I would like know,
    1. Is there any other way to pump data from dll side to the client application,
    2. If i go with the static method to pump the data from dll, weather the other values of class variables of my GrabTest will give problem?
    Looking for your guidance on this issue.
    Thanks in advance,
    Ramesh

    856989 wrote:
    I think i have clearly mentioned that "Tell me any way in doing this invocation in BCEL not in Reflection."
    Why i not want to use reflection because it have "invocation overhead"Wrong.
    If I dynamically load a class and reference it via a interface there is absolutely no difference in that and if I referenced the class statically and used it via an interface. The load and use process is exactly the same.
    And the first uses "reflection".
    If you use a proxy interface via something like java.lang.reflect.Method
    then of course there is some overhead because there is in fact more classes involved. Just as if you had any other layer in any other code.
    And even so unless you have actually profiled the application and found an actual bottleneck (and not just a measured impact) then even looking at it is a waste of time.
    If it was me I would be far more concerned that inserting byte codes was correct for all cases.

  • How to invoke interface execution using SDK?

    Is it possible to invoke interface execution directly using ODI SDK? I searched the internet only finding ways to invoke interface scenario.
    Is there any API that can directly execute a specific ODI interface?
    Thanks!

    Not sure but you should really be compiling your interface into a scenario or including it as part of a package for non-development execution purposes

  • How do i install windows using bootcamp???

    Have a apple mac pro , but also have lots of windows software including CS5. Wondered what software or installation i need to activate windows on or alongside my Mac
    Thank you.

    Have a look here http://support.apple.com/kb/HT1461

  • How to invoke the servlet

    how to invoke a servlet using jsp
    containing JSF components
    how can we do this using creator ?
    having sucessfully executed the examples
    still dont know how to do it
    and also jsp source is quite different than normal jsp
    it doesnt allow jsp tags such as
    <%= "asdf"%>any help is great to me
    thanks in advance !
    cheers,
    shekar

    and also jsp source is quite different than normal
    jsp
    it doesnt allow jsp tags such as
    <%= "asdf"%>
    This is jsp syntax -- JSC uses jsf...:-(
    Regards,
    - D.t.O

  • Running programs WINDOWS using java

    Hi ,
    I would appreciate if anyone could tell me how to run programs WINDOWS using JAVA language .Thank you.

    I am not quite sure what you mean by that, but if you want to execute a program use:
    Runtime.exec(String)

  • Resizing a window using the trackpad

    Please can anyone tell me how to resize a window using the magic trackpad???????

    In both 10.6 and Lion you can set the 3 finger drag function in System Preferences > trackpad.  Then you can drag the bottom right corner (or and edge in Lion) of the screen with 3 fingers.  Grabbing the top of the window with 3 fingers will move the window around.
    Regards,
    Captfred

  • How to use JNI?

    hi all,
    i know that pure java can't disable alt+tab,i must use JNI with C language. i have a pile of codes to disable the alt+tab in C but i do not know how to do it in JNI...can anyone help?thanks in advance...
    these are my codes in C:
    Private Declare Function SystemParametersInfo Lib "user32" _
    Alias "SystemParametersInfoA" (ByVal uAction As Long, _
    ByVal uParam As Long, lpvParam As Any, ByVal fuWinIni As Long) As Long
    Private Const SPI_SCREENSAVERRUNNING = 97
    Dim ret As Integer
    Dim pOld As Boolean
    Private Sub Form_Load()
    'The line below calls the function and passes
    'the constant and TRUE to fool Windows into thinking
    'the screensaver is running and FALSE to do the opposite...
    ret = SystemParametersInfo(SPI_SCREENSAVERRUNNING, True, pOld, 0)
    End Sub
    Private Sub Form_Unload(Cancel As Integer)
    'NOTE: THIS MUST BE SET TO FALSE WHEN
    'THE FORM OR APP CLOSES
    'If you do not set it to false, these keys will not work
    'with any app, or with anything in the Windows Environment...
    ret = SystemParametersInfo(SPI_SCREENSAVERRUNNING, False, pOld, 0)
    End Sub

    There really isn't a lot to using JNI.
    There are examples on Sun's website:
    http://developer.java.sun.com/developer/onlineTraining/Programming/JDCBook/jniexamp.html
    There is also a little more simple example at:
    http://www.inonit.com/cygwin/jni/helloWorld/java.html
    Basically, here are the steps:
    1) Create a simple java applet that will call your C/C++ code.
    For practise, I would just use the HelloWorld example from www.inonit.com:
    package example.jni;
    public class HelloWorld {
         private static native void writeHelloWorldToStdout();
         public static void main(String[] args) {
              writeHelloWorldToStdout();
    2) Name the file with the code above HelloWorld.java and compile it:
    javac HelloWorld.java
    3) Use javah to generate the C header file:
    javah example.jni.HelloWorld
    (You may need to cd to the parent directory of 'example', in this case)
    4) The above line should create a example_jni_HelloWorld.h header file.
    Use this header file in your C/C++ DLL. Make sure your C/C++ compile knows where to find jni.h. In my compiler, I added the following paths:
    C:\J2SDK1.4.1\INCLUDE\
    C:\J2SDK1.4.1\INCLUDE\WIN32
    5) The trickiest part about JNI is passing in and returning parameters.
    If you don't have to pass in or return any parameters, then you're almost done. Replace your C/C++ function protocol with the protocol in the header file you generated. Compile your DLL.
    6) Copy the DLL to a path that it will be found by your Java Applet. (If running on Windows, this would be your System32 or System directory.)
    7) I also had to edit my Path environment variable to include the Java Runtime bin directory. On my machine it was: C:\J2SDK1.4.1\jre\bin
    8) Try running your java applet:
    Java example.jni.HelloWorld
    Good Luck!

Maybe you are looking for