How to access vc dll with java

I need to access vc dll with java. Now I only have *.h,*.lib, *.dll,no *.cpp,because the dll is from others. I cann't modify the *.cpp files for java. so what should I do .
Best wishes.

Create a JNI wrapper for rhe dll:
1)Create a java class that defines methods that correspond to the methds in the c++ dll
2)compile this, and compile it with the jni compiler to get the c++ header files.
3)Create a C++ file that implements the methods defined in the header file, calling the c++ code as necesssary and using the JNI helpess to translate parameters from java form to C++ from.
4)Perform any initialisation of th c++ dll by adding a DllMain() or equivalent under unix/linux
5)create a makefile to build a dll from the above, linking to your import (.lib) library
6)make sure both DLLs are with your java class files when you run the java app.

Similar Messages

  • How to use the Rc4DLL.dll with java (jre1.4 )

    I am not able to use Rc4DLL.dll with java, there are some characters (encrypted using Rc4DLL.dll) that java is not able to identify. So while decrypting in java using Rc4DLL I am not getting the desired output (as some character java tries to decrypt are not supported with java). Could some one give a solution of using Rc4DLL with java jre 1.4

    RC4 cipher is supported by 1.4.
    And surely you can turn a link to the 1.5.0 JCE Reference Guide into a link to the 1.4.2 Reference Guide? I did. Took me 5 seconds to check that. As opposed to wasting a day and a half in forums like you just did.

  • Possible to make a dll with java?

    I am completely new to Java. Is it possible to create a Windows style DLL with Java? I am working with one project written in VB.NET which needs to access functions in another project written in Java. Can anybody help me figure out how to do this?

    I'm not sure what you mean by what type of project. It contains numerous data analysis functions which I want to access from a VB.NET program. From what you've written, I must assume that Java cannot be used to create a DLL and my only option is to rewrite it in another language. Thank you for the info.

  • How to connect oracle database with JAVA

    how to connect oracle database with JAVA....
    using j2sdk and Jcreator . which connector to use .. what are the code for that ..

    PLEASE .... Ask in an Oracle Java forum.
    And read the documentaiton. There is a whole document devoted to doing that. http://download.oracle.com/docs/cd/B19306_01/java.102/b14355/toc.htm has examples.
    PLEASE ... do not ask product questions in a forum which clearly has a title saying it is devoted to assisting with download problems.

  • How can i create messenger with java tv API on STB

    deal all.
    how can i create messenger with java tv API on STB.
    how can Xlets communicate each other?
    how?
    i am interested in xlet communications with java tv.
    is it impossible or not?
    help all..

    You can create a messenger-style application using JavaTV fairly easily. JavaTV supports standard java.net, and so any IP-based connection is pretty easy to do. The hard part of the application will be text input, but people have been using cellphone keypads to send SMS messages for long enough that they're familiar with doing this. This doesn't work well for long messages, where you really need a decent keyboard, but for short SMS-type messages it's acceptable.
    The biggest problem that you need to work around is the return channel. Many receivers only have a dial-up connection, ties up the phone line and potentially costs people money if they don't get free local calls. Always-on return channels (e.g. ADSL or cable modem) are still pretty uncommon, so it's something that you nee to think about. Of course, if you do have an always-on connection then this problem just goes away.
    This is really one of those cases that's technically do-able, but the infrastructure may not be there to give users a good experience.
    Steve.

  • How to program a screensaver with java???

    Hi all,
    Can someone tell em how to program a screensaver with java, and how should i begin ? or maybe someone know any useful information source?
    thanks a lot.
    ck

    A quick google search gives me, among lots of other things:
    http://kevinkelley.mystarband.net/java/sava.html
    Good luck
    Lee

  • How to access calendar rules via java

    Hi to all,
    We have a process in which we need to set a Timer, but the date must be validated against Calendar Rules. We searched in forums, webs, documentation and we couldn't find a way to do this.
    I know it is possible to set an expiration date based on Business Calendar on a Human Task (deadline tab in Human task editor), but this is not what we need.
    We actually need a way to set a variable date in the process that can handle only business days. e.g.: 'now' + 2 business days.
    Right now we are setting the Timers with this expression from a Business Rule: Duration.from string("PT48H")
    Then I associate the business rule output with a Time type variable(deadlineTime) doing: 'now' + deadlineTime
    So right after that I can use the Time variable on a timer attached to the human tasks I need. * We need to use business rules because the customer may want to change the times accordingly to their needs through BPM Composer. *
    The problem is that this solution does not take into account Saturday and Sundays (holidays are a concern too).
    We need to set the expiration time to timers attached to human tasks, but the time should consider working days only. We consulted with experts from Oracle and told us that functionality is available in the PS 6 version. At the moment it is impossible to migrate to that version. I need to know how to access via Java APIs to the calendar rules for checking programmatically.
    JDeveloper version: 11.1.1.6
    Any suggestion?
    Thanks in advance
    Marcelo

    Hi Yarner,
    Once you have all your dll included in a jar and used the nativelib tag, you have to use, at the beginning of you application, the command System.loadLibrary to load all the dll you need. Including the ones called by the others you have direct access.
    The dll�s have to be explicitly loaded in the order they are called.
    For example: you use lib1.dll and lib2.dll. The lib1.dll needs lib0.dll.
    Even if you don't use lib0.dll directly, once its called by lib1.dll you have to put then in the order.
    System.loadLibrary("lib0.dll");
    System.loadLibrary("lib1.dll");
    System.loadLibrary("lib2.dll");
    I hope it may help you, good luck.
    Mario

  • Access to DLLs with JNI??

    Hi All,
    I�ve just created a DLL in VC++ version 6
    I�m using simulation packages to access functions within this DLL, this runs just fine.
    My question is: -
    How can I get my java application to access the DLL functions as well?
    If I use JNI my simulation models don�t recognise the functions anymore.
    Is there any other way of accessing my DLLs without using JNI?
    Any solution would be much appreciated.
    John.

    No luck this time either:
    Here is the code that I'm using
    (1)
    //hello.java
    class HelloWorld
    public native long displayHelloWorld();
    static
    System.loadLibrary("control_unit");
    public static void main(String[] args)
    long temp = 0;
    temp = new HelloWorld().displayHelloWorld();
    System.out.println("The returned value is "+temp);
    (2)
    // HelloWorldImp.c
    #include "stdafx.h"
    #include<stdlib.h>
    #include<stdio.h>
    #include<iostream.h>
    #include "jni.h"
    #include "HelloWorld.h"
    BOOL APIENTRY DllMain( HANDLE hModule,
    DWORD ul_reason_for_call,
    LPVOID lpReserved )
    return TRUE;
    DWORD WINAPI returnValue()
    return 8;
    JNIEXPORT jlong JNICALL
    Java_HelloWorld_returnValue(JNIEnv *env, jobject obj)
    return (jlong)returnValue();
    (3)
    //Generated File
    /* DO NOT EDIT THIS FILE - it is machine generated */
    #include "jni.h"
    /* Header for class HelloWorld */
    #ifndef IncludedHelloWorld
    #define IncludedHelloWorld
    #ifdef __cplusplus
    extern "C" {
    #endif
    * Class: HelloWorld
    * Method: displayHelloWorld
    * Signature: ()J
    JNIEXPORT jlong JNICALL Java_HelloWorld_displayHelloWorld
    (JNIEnv *, jobject);
    #ifdef __cplusplus
    #endif
    #endif
    (4)
    //Commands used
    javac hello.java
    javah HelloWorld
    cl -Ic:\jdk1.2.2\include -Ic:\jdk1.2.2\include\win32 -LD HelloWorldImp.c -Fecontrol_unit.dll
    However I usually build the dll in VC++ ver 6 as this allows my dlls to work with my sim models
    I only use the CL to get the JNI working
    And when I try to run the java application I get the following: -
    Exception in thread "main" java.lang.UnsatisfiedLinkError: displayHelloWorld
    at HelloWorld.main(hello.java:13)
    Which is "temp = new HelloWorld().displayHelloWorld();" in hello.java
    Any reason as to why it's not working?
    If you have any questions please let me know and I'll get back to you.
    Am I building the dll in the wrong manner?
    Thanks again,
    John.

  • How to create a dll with strong name

    Hi All,
    For some security purpose, I need to create a dll with strong name by packaging the bean. I am able to create a dll from the bean but how do I create a strong name(sign) dll? I tried using jarsigner utility to sign the jar and then convert it into dll using packager utility but still the resulting dll is not signed. Please anyone let me know how can generate a signed dll by packaging my bean. Any suggestion/help is most welcome. Thanks in advance.

    Good information on strong names:
    http://www.ondotnet.com/pub/a/dotnet/2003/04/28/strongnaming.html
    Step-by-step procedure:
    1. Download Signer from Codeplex. No installation is necessary.
    2. Backup your unsigned assemblies
    3. Open the Visual Studio Command prompt or otherwise make sure that your PATH includes the .NET SDK binaries, and change to the directory where your assemblies are located
    4. In a command window, execute:
    PATH_TO_SIGNER.EXE\signer -k FILENAME OF YOUR KEY -outdir TARGET DIR -a YOUR DLL
    5. The resulting assemblies should now have a valid strong name from your company key. You can check this with:
    sn -T YOUR DLL
    The public key token must match the token of your public key.
    BTW - this is totally unrelated to Java Programming.

  • How to access android resource in java native extension....??

    hi..
    i want access android resource..
    for example, res/menu/menu.xml, res/values/strings.xml ... etc...
    - R.java -
    /* AUTO-GENERATED FILE.  DO NOT MODIFY.
    * This class was automatically generated by the
    * aapt tool from the resource data it found.  It
    * should not be modified by hand.
    package com.flash.extension.nativelib;
    public final class R {
        public static final class attr {
        public static final class drawable {
            public static final int icon=0x7f020000;
            public static final int notification_icon=0x7f020001;
        public static final class layout {
            public static final int main=0x7f030000;
        public static final class string {
            public static final int extension_app_name=0x7f040001;    -> "hi extension"
            public static final int extension_hello=0x7f040000;
    so i used getResourceId("string.extension_app_name");
    but it's not work.. throw NotFoundException error..
    so i used context.getString(R.string.extension_app_name);
    it's work, but return incorrect value.. -> return value is "0.0.0".. it's versionName in actionScript Client Project..
    why can't access android resource in native extension?
    how to get android resource in java natvie extension..??
    Is there anyone who has a sample source??
    help.. me.. please..

    Hello,
    I am facing the same issue with the native extension i am using follwing code to get the resource id
             Intent inte = new Intent(context.getActivity().getApplicationContext(),SecondActivity.class);
              inte.putExtra("layout",context.getResourceId("layout.secondactivity"));
              context.getActivity().startActivity(inte);
    i am getting this exception "android.content.res.Resources$NotFoundException:layout.secondactivity"
    I have included activity in the native manifest file as well as flex's manifest file for android.
    please help me with this or an example will be great thanks.

  • How to retrive table names with Java?

    Hello!
    If I connect to my Oracle Database 10g Express Edition Instance with some Java code and I run the following code:
                   ResultSet resultSet = databaseMetaData.getTables(null, null, "%", types);
                   while( resultSet.next() )
                        String tableName = resultSet.getString(3);
                        System.out.println(tableName);
    I get loads of different names of tables beside those that belongs to my user like:
    DR$NUMBER_SEQUENCE
    DR$OBJECT_ATTRIBUTE
    DR$POLICY_TAB
    ARTICLES
    BIN$tQZXQ0iGufbgQAB/AQELFg==$0
    BIN$tQZXQ0iLufbgQAB/AQELFg==$0
    But when I log in to http://127.0.0.1:9090/apex I get a perfect list of the tables belonging to the user:
    ARTICLES
    CUSTOMERS
    DATATYPES
    ORDERROWS
    ORDERS
    REQUESTROWS
    REQUESTS
    SUPPLIERROWS
    SUPPLIERS
    Does any one understand how to access just these table names that is created with my user?
    Best regards
    Fredrik

    Hello Adrian!
    Yes you are right I now understand that this is the wrong forum.
    So I posted the "same question" at:
    How to retrive table names belonging only to a user?
    How ever I seems to have problem with the schema name parameter any way.
    Best regards
    Fredrik

  • How to connect via telnet with Java?

    I want to develop an application in a server with solaris 8. I want to access from this server to another server in a LAN via telnet and write down the information i am getting in a file. How i can do this in java? it's a good alternative? or i should try C++. Thanks in advance.!

    You can easily use java....just get a hold of the RFC for Telnet or if you look around, you can find code on the net already working.

  • How i get hardware info with Java Applet

    Hello Everybody.
    first I am sorry for my english. This my first topic. I am a php developer and learning Java. I am developing a Java Applet.
    Can i get client hardware info with Java Applet
    Ýf i can How i do get hardware info with Java Applet.
    I need sample code or documentation.
    Thanx.

    TrojanMyth wrote:
    Hello;
    Can i get hardware info with Java ?? Have not a know people ?Applets are restricted, unless, as already noted, they are signed and accepted by the user. See
    http://java.sun.com/docs/books/tutorial/deployment/applet/security.html
    http://java.sun.com/docs/books/tutorial/deployment/applet/properties.html
    In general, since Java is designed to run on multiple operating systems and machine architectures it does not provide much access to the underlying hardware. As mentioned, you can access the os via methods in the java.lang.ProcessBuilder and Runtime classes.

  • How to access variables declared in java class file from jsp

    i have a java package which reads values from property file. i have imported the package.classname in jsp file and also i have created an object for the class file like
    classname object=new classname();
    now iam able to access only the methods defined in the class but not the variables. i have defined connection properties in class file.
    in jsp i need to use
    statement=con.createstatement(); but it shows variable not declared.
    con is declared in java class file.
    how to access the variables?
    thanks

    here is the code
    * testbean.java
    * Created on October 31, 2006, 12:14 PM
    package property;
    import java.beans.*;
    import java.io.Serializable;
    public class testbean extends Object implements Serializable {
    public String sampleProperty="test2";
        public String getSampleProperty() {
            return sampleProperty;
    }jsp file
    <%@ page contentType="text/html;charset=windows-1252"%>
    <%@ page import="java.sql.*,java.util.*"%>
    <html>
    <head>
    <title>Schedule Details</title>
    </head>
    <jsp:useBean id="ConProp" class="property.testbean"/>
    <body>
    Messge is : <jsp:getProperty name="msg" property="sampleProperty"/>
    <%
      out.println(ConProp.sampleProperty);
    %>
    </body>
    </html>out.println(ConProp.sampleProperty) prints null value.
    is this the right procedure to access bean variables
    thanks

  • How to share a folder with java? in netbios in windows

    hi. I want to write a programa that user can select a directory than
    click the share button and the directory will be shared to other pcs.
    the other pcs can acces this directory like \\servername\shareddirectory
    the question is this. how can i share a director with java or JNI's?
    please help me.
    with my best regards....

    thanks about net share command.
    i know how to use Runtime.getRuntime.exec()
    but i cont find the syntax of net share command.
    can u give an example? i use net help share and i try different
    sytaxes but i cant find the correct one.
    please give an examle about net share command.
    thanks a lot.

Maybe you are looking for

  • Get selected row in a table control

    What is the best approach to get a selected row, all fields, in a table control?  I see this done in various transactions in MM but do not see how to do this in documentation. Thanks

  • How to scale down number of pages in ps files

    I am having ps files that are havings 4 to 8  pages per file. Each page may contain just 5-6 lines and therefore though the content in total is not too much but there is unnecessay paper wastage. Is it possible to make some changes in code inside ps

  • Smartview Error V11.1.2.1 Addin Class

    I have a user who has just installed Smartview V11.1.2.1 after de-installing v9.3, when they open Excel they get an Addin Class error message displayed. They have de-installed and re-installed three times with admin rights, and still the same error m

  • ETL from OWB to Analysis Services 2005

    Data is stored in Oracle 10gR2 and we wish to set up an automated process to transfer this data periodically to SQL Server 2005 database using Oracle Warehouse Builder 10.2. I am aware of 2 ways of enabling a process of transferring data to SQL Serve

  • Sizing guest anchor controller

    40 locations, around 20-30 APs per location, 1 gig back from each site to the main site, minimizing cost. Trying to size the guest anchor controller. Redundancy is not required. As I understand correctly 4402/4404/5508 controller supports up to aroun