Using a DLL?

Hi, I am wanting to write a program that opens and edits a certain type of archive of files. These particular files are weird and complex. Someone has made a couple of DLL's that have functions in them that will open and read from/write to these files.
I was wondering if anyone could explain how I could implement these DLL's into a Java program. Also, the DLL's are poorly documented, so is there any way I can look in the DLL to see the syntax of the methods that I want to call?
Thanks.

etgohomeok wrote:
Hi, I am wanting to write a program that opens and edits a certain type of archive of files. These particular files are weird and complex. Someone has made a couple of DLL's that have functions in them that will open and read from/write to these files.
I was wondering if anyone could explain how I could implement these DLL's into a Java program. Also, the DLL's are poorly documented, so is there any way I can look in the DLL to see the syntax of the methods that I want to call?
Thanks.That depends on the type of .DLL. If it's a managed (.NET) dll, then you're not easily going to be able to plug into it from Java. If it's not a managed .DLL, then it'll be a little bit easier (but it's still non-trivial). You'll essentially have to write your OWN DLL using JNI that encapsulates and exposes the functionality that you want in your application via native method hooks.
You'll want to go through the JNI tutorial.
As for the documentation aspect, if it's a .NET Dll, its pretty easy to take a look and see how it works (download an express version of C# Visual Studio - free - and use the Object Explorer to look over the exposed methods). If it's not managed, then I don't know what to tell you.

Similar Messages

  • Get "Creation Script" of the existing table ( in SQL database) using C# and without using SMO dlls

    Hi All,
    I need to get the "Creation Script" of the existing table using c# and without using SMO dlls (is it possible? I don't know).
    I.e. In SQL Management Studio -> right click on any table -> Script table as -> Create To  - > open in the new query editor window. This will give you the schema of the table with the constraints of the table.
    For E.g. In Northwind database, for the table "Categories", I would like to get it as show below
    USE [Northwind]
    GO
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    CREATE TABLE [dbo].[Categories](
        [CategoryID] [int] IDENTITY(1,1) NOT NULL,
        [CategoryName] [nvarchar](15) NOT NULL,
        [Description] [ntext] NULL,
        [Picture] [image] NULL,
     CONSTRAINT [PK_Categories] PRIMARY KEY CLUSTERED
        [CategoryID] ASC
    )WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
    ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
    GO
    I would like to get the same schema using c#. Please help.
    Thanks & Regards,
    Kalai.

    SMO is the easiest way to get this. This is what Management Studio uses. If you can't use SMO, get a Profiler trace of the queries that SMO executes when generating the script and execute the same using ADO.NET.
    Regards,
    Farooq Mahmud
    Support Escalation Engineer 
    •  Microsoft Health Solutions Group

  • Ldapssl_client_init always returns -1 when using nsldapssl32v50.dll

    We have an iPlanet Directory Server v5.2 installed and SSL has been configured on it.
    When we call ldapssl_client_init(CERTDBPath, NULL) we always get a the return value as -1.
    We used nsldapssl32v30.dll and the corresponding lib and tried the same program and it worked perfectly fine.
    Now the question is why does this call fail when using the 5.0 version of the library.
    We have tried calls to ldapssl_client_init in the different ways like
    --> ldapssl_client_init("D:/Program Files/Sun/MPS/alias", NULL)
    with the cert7.db in this path. This failed
    --> ldapssl_client_init("D:/Program Files/Sun/MPS/alias/slapd-mydb-cert7.db", NULL)
    This also failed
    We need to use the v5 of the library bcoz the older versions are not compliant with LDAP v3 for referral support.
    Our current environment is Win2k Server SP4 and iPlanet Dir Server 5.2.
    Please help us sort out this issue.
    Thanks
    Raghu

    The function "ldapssl_client_init" returns -1, if I use LDAP SDK 6.0 binaries (source downloaded from http://wiki.mozilla.org/LDAP_C_SDK and compiled). It returns same error code i.e. -1, if we use precompiled binaries.
    But if I use the old LDAP 5.2 binaries, it works fine.
    Here is a sample code that I used to test ldapssl_client_init() on RHAS3.0:
    #include <ldap.h>
    #include <ldap_ssl.h>
    #include <stdio.h>
    /* Initialize client, using mozilla's certificate database */
    int main(void) {
    /* "/home/infwaer/test/" is the folder that contains cert7.db and key3.db*/
    if(ldapssl_client_init( "/home/infwaer/test/", NULL ) < 0) {
    printf( "Failed to initialize SSL client...\n" );
    return( 1 );
    else
    printf( "Initialized SSL client...\n" );
    I used the following command to compile it with 5.2 binaries, and was able to successfully call the function ldapssl_client_init:
    gcc ldapclient.c -I/home/infwaer/nsldap/5.2/RHAS3.0/include
    -L/home/infwaer/saurabh_review/lib -lldap50 -lnspr4 -lplds4 -lplc4 -lsoftokn3 -lnss3 -lssl3 -lprldap50 -lssldap50 -ldigestmd5 -lsasl
    But when I compiled it using 6.0 binaries using the same command:
    gcc ldapclient.c -I/home/infwaer/nsldap/6.0/RHAS3.0/include
    -L/home/infwaer/saurabh_review/lib -lldap60 -lnspr4 -lplds4 -lplc4 -lsoftokn3 -lnss3 -lssl3 -lprldap60 -lssldap60 -ldigestmd5 -lsasl
    It gave the error "failed to initialize" (as written in the code !)
    Please help me out; n let me know if it is a known issue with LDAP SDK 6.0. Or we need to do some special settings for version 6.0 to work properly.
    Thanks & Regards,
    Saurabh

  • Problem in using AcroPDF.dll in vb6 application

    I have an vb6 application and i want to display a PDF file in a form. I have used AcroPDF.dll and works fine on developmeny system.
    But when i install application on client's system i get error "Out of memory" when i try to open the form with PDF control.
    can anyone help me with this.
    Thanks

    Try asking this question in the Acrobat SDK forum.

  • How can I use a dll if I dont have a header file

    I'm not sure if I'm even trying the possible here as I have searched and not been able to find much at all.  However I figured it was worth asking here.
    I have access to several dll's used by a program, I need to open a file using the program (for some reason it is completely non responsive unless you open it "within" the program itself) and so decided to browse the .dll files included.  Ive found a few functions which may carry out the function I need.  Is there a way of figuring out the inputs/outputs if I don't have documentation or a header file?
    This is the next stage in a huge project I am working on at the moment and I've been banging my head against the wall all day trying to figure this out.
    Thanks in advance for any help
    Rik
    That glass?
    Thats glass is neither half full or half empty....
    Its twice the size it needs to be

    Yes, that makes sense. It also means that what you are trying to do is not likely to work. You have no way of knowing what the program does when opening the file, so guessing at using the DLLs is purely a shot in the dark without even knowing where the dark is. Even if you could find the function (assuming it's just one) that loads a file, how is the program supposed to use it now? That function has to be called from within the program. When you call it from LabVIEW you are not sitting inside the program's memory space, so it has no way of knowing about the file.
    I would suggest, instead, to see if the program accepts command-line parameters. For example, does it accept a name of a file to open as part of launching it from the command line? If not, then you may need to resort to trying to control it via automation. If it has no built-in automation then you need to resort to using the OS to make pretend you're clicking buttons and typing text. This has come up many times before, and there have been numerous posts on this, so please do a search on controlling an external program from LabVIEW within this forum. You can call the Windows API functions to move the mouse to a specific location and click the button as well as typing text, or you can use third-part automation tools. One that I have used successfully is AutoIt. The search I indicated will yield other suggestions. 

  • Using a .dll file in Diadem2012

    Dear folks,
    I've got a .dll which was created using the Diadem GPI toolkit 10.2 and Microsoft Visual Studio 8.0, I guess. I'm currently using this DLL under Diadem 9.0.
    Now I'd like to use this same DLL under Diadem 2012, but it won't work. When loading this DLL via the GPI-DLL loader, It only says .dll couln't be loaded, no further output, no more debug information...?
    What can I do to load this DLL into Diadem2012, or do I have to code the whole DLL new?!
    Thanks for your help in advance.
    Tim

    Hi Walter,
    thanks for your fast reply.
    I tried to recompile that file in Visual Studio 10, because I had an old project file coded in Visual Studio 8. Unfortunately, that did'nt work. The .dll could not be built. So I'd like to try to install the runtime library.
    I don't know under which visual studio version, the dll file was built, so what should I do? Install Visual Studio 8 and 6 and hope that the runtime library I need is installed then?
    Thanks for your help.
    Greets Tim

  • How to use the DLLs which created from c++ in Java?

    And How to use the DLLs which created from JNI in C++?

    Huh?
    Are you asking how to do JNI - you should read the tutorial.
    Are you asking how to load it - then use System.loadLibrary()
    Are you asking what to do with the output from javah - put it in a C file and write some code, compile it into a dll.

  • How to use the DLL in crystal report (Additional applications)

    Hi,
    i have created a win32 dll, and now i want to use that dll in my crystal report how can i do so?, what i tried is i went to to Addntional functions catagory in formula workshop, and there i can see some dlls listed, similary i put my dll in the same path like "C:\Program Files\Common Files\Crystal Decisions\1.0\Bin" and other folder too. but i am not able to see that dll in "Addtional functions". can you plesase tell how can i achive this.
    Regards,
    Prabhakar J.

    Please re-post if this is still an issue to the .NET Development - Crystal Reports Forum or purchase a case and have a dedicated support engineer work with you directly

  • How to use AcroPDF.dll even if addon is deactivated in InternetExplorer

    Hello,
    hopefully someone can help me with my problem:
    I need to instantiate AcroPDF.dll and have it deactivated at the same time in InternetExplorers Addon-settings.
    But when I deactive the addon in IE, CreateObject("AcroPDF.PDF.1") throws an error that the instance could not be created, but the dll is still registered.
    How does this deactivation work technically? Is there any way to use the dll in other applications regardless of the IE-settings?
    Best regards and thanks in advance,
      Thomas

    For programming issues you should use the forum for Acrobat SDK.

  • How to use CRAXDDRT.DLL in crystal report 2008?

    Hello All,
    We have purchased Crystal report 2008 Full software.
    We need to insert BLOB field into Crystal report 2008 at runtime using *CRAXDDRT.DLL*.
    How can I insert OLE object and bind it at Runtime using crystal report 2008?
    Is it possible to insert Ole Object runtime using crystal report 2008? If yes how and if not is there alternative to perform this job.
    Please let me know your feedback.
    Thanks

    CrxDDrt.dll is only provided in order for the Crystal Reports designer in the .NET IDE.
    1) You are not licensed to use this CraxDDrt.dll
    2) Even if you were, in previous versions of CR, there were licensing implications to using the craxDDrt.dll (read $$)
    3) Once your project would be done, using CR 2008, you would not be able to distribute the runtime as there is no CR MSM or MSI that contains the craxDDrt.dll and it's supporting runtime.
    In your original post you say:
    "I need to show Word and Pdf file in to Crystal report 2008 using CRAXDDRT.DLL";
    I do not understand why you'd need to do this using the craxddrt.dll? You should be able to insert a BLOB field using the RAS SDK for .NET and CR 2008. Now, one hting you will have to keep in mind. If you insert a multipage .doc or .pdf file into the report, you will only get the first page of that document. I suggest you try this in the CR designer first. Always remember that if you can not do a certain thing in the designer, you will not be able to do it at runtime either. Giving all the limitations above, if you are still interested in doing this using RAS, let me know and I'll set you up with some resources to get you going.
    Ludek

  • Build a DLL in LabVIEW & Use the DLL in LabVIEW

    I am trying to build a DLL for the simple vi with LabVIEW and want to use the DLL in LabVIEW. is it impossible?
    I wrote a vi and it have 2 terminals. one is the input for numeric dbl data type and one another is the output for numeric dbl 1D array data type.
    It was built with the Application builder for LabVIEW 8.0 and DLL was created successfully.
    I want to use this DLL in new vi with LabVIEW.
    Call library function used. I wrote a new vi to use that DLL.
    In config dialog I config each parameter for dll and connected terminals. but it doesn't work
    pleas refer to the attatched file and let me know what I missed.
    Attachments:
    Array1D.zip ‏60 KB

    At first I kept scratching my head wondering why someone would want to do this. Create a DLL in LabVIEW to call it from LabVIEW. Seems redundant. But, perhaps it's an exercise or perhaps it's for testing the DLL...
    In any event, calling the DLL worked for me in 8.2. How are you configuring your Call LIbrary Function node? I have it set up as follows:
    return type: void
    iteration: Numeric, Signed 32-bit Integer, pass by value
    array1D2: array type, Signed 32-bit Integer, 1 dimension, "Array Data Pointer" format
    len: Numeric, Signed 32-bit Integer, pass by value
    Then I called the DLL like this:
    Message Edited by smercurio_fc on 03-16-2007 12:57 PM
    Attachments:
    Example_BD.png ‏2 KB

  • How to use COM DLL in LabWindows

    Hello
    I have a COM .dll which looks like that when opened with dll export viewer:
    I would like to use the Get4AxisPos function in LabWindows.
    I understood that, as I only have the .dll, the only way of calling these functions are with the LoadLibrary() and GetProcAddress() functions.
    My problem is that the Get4AxisPos function is not of type Exported Function but COM Method so I don't know how to use it in my LabWindows project!
    My questions are: Is it possibleto use this dll in Labwindows? If yes how?
    Thanks
    Solved!
    Go to Solution.

    Hi ,
    I am new to C++ and COM  .
    i need to implement a client application in C(lab windows CVI) , server is a c++ COM object.
    steps followed by me
    ---> accessed the registered COM object with Labwindows CVI active x controller template,output was a c file which is implementation of the class names in COM (interfaces).
    I can use majority of the functions directly from the generated, but i need to implement some event functions like message box events and then use it.
    I have seen one method of accessing in C++ client sample ,
    which implements Queryinterface function...takes the IID_Unknown as input and returns interface pointer(inhereted static_castof the required class, uses static_cast for that) as output.
    when i try to follow up the same in c , i am lost  with the inheritance concept.
    In short i need to send IID Unknown to the Queryinterface function and should get the interface pointer of message box type or other class type ...
    Sorry for the long mail,Please guide me
    Thanks in advance ,
    Satish

  • Get the Picture object location path from crystal report using CRAXDRT.DLL

    Post Author: hpatel_it
    CA Forum: Crystal Reports
    Hi All,I am working on one project - Crystal report to SQL Report conversion and I am using CRAXDRT.DLL to open and read crystal report.I have done conversation of all controls but I am not able to get PICTURE object from Crystal report and also PICTURE object source path.I am using CRAXDRT.OLEOBJECT to get the path of the picture object.if someone have knowledge of CRAXDRT please help me.Regards,Harry

    You can get at specific objects using events,  but not a whole record.
    Can't think of any way of doign this at all...
    Ludek

  • Not able to GET_SCHEMA from MYSQL using mysql_ecma2.dll while creating MYSQL_ECMA

    i have made a MYSQL_ECMA.dll (using sql_ecma.dll) but when i create that ECMA it is unable to create get_schemafrom my sql
    Database=test
    table=HR
    public Schema GetSchema(KeyedCollection<string, ConfigParameter> configParameters)
    Microsoft.MetadirectoryServices.SchemaType personType = Microsoft.MetadirectoryServices.SchemaType.Create("Person", false);
    myServer = configParameters["Server"].Value;
    myDB = configParameters["Database"].Value;
    myTable = configParameters["Table"].Value;
    DataSet myData = this.MYSQLSchema(myServer, myDB, myTable);
    string[] MYSQLSchema =new string[myData.Tables["Columns"].Rows.Count];
    for (int i = 0; i <= myData.Tables["Columns"].Rows.Count - 1; i++)
    MYSQLSchema[i]=myData.Tables["Columns"].Rows[i].ItemArray.GetValue(0).ToString().Trim();
    string myattrib=MYSQLSchema[i];
    if (myattrib == "EmployeeID")
    personType.Attributes.Add(SchemaAttribute.CreateAnchorAttribute(myattrib, AttributeType.String));
    else
    personType.Attributes.Add(SchemaAttribute.CreateSingleValuedAttribute(myattrib, AttributeType.String));
    Schema schema = Schema.Create();
    schema.Types.Add(personType);
    return schema;
    public DataSet MYSQLSchema(string server,string database, string table)
    myconnectionc =("Server = '" + server + "';Initial Catalog='" + database + "';Integrated Security=True");
    conc =new MySqlConnection(myconnectionc);
    cmdc =new MySqlCommand();
    cmdc.CommandType=CommandType.Text;
    string cmdtextc="Select COLUMN_NAME from Information_Schema.Columns where TABLE_Name = '" + table + "'";
    cmdc.CommandText=cmdtextc;
    cmdc.Connection=conc;
    adapter =new MySqlDataAdapter(cmdc);
    dac =new DataSet();
    adapter.Fill(dac, "Columns");
    return dac;

    It must be problem with your query. You are converting date into DD/MM/YYYY format and passing it to the query. As per my knowledge, MySQL default date format is YYYY-MM-DD. YYYY-MM-DD is not equal to DD/MM/YYYY. Hence you would not get any result. I would suggest you to validate the query. yOu try executing query directly in mySQL
    select edate, particulars, chequeno, fromto, deposit, withdrawal, cleared,cdate, details from passbook WHERE edate BETWEEN 01/01/2007 and 31/12/2007 order by edate desc
    If you are able to execute above query in MySQL without fail, then it is something we may need to investigate further. Hope above query may not yields you any records. If so, that could be the problem. You may need to convert your date (SimpleDateFormat) in below format:
    YYYY-MM-DD.
    It should work. Let me know, still if you have any questions further.

  • Using axbridge.dll without going through the JRE installation process

    I've searched the web and this forum for this specific problem, and have found related items, but nothing that quite answers the question.
    I have an application that uses the JRE's axbridge.dll to access a DLL created from a Java bean. I used the packager to create a DLL named MyBean.dll.
    When I go through the full JRE install, everything works great. That is to say, when I execute Sun's JRE installation program and go through the normal install process, I can access the bean through MyBean.dll without any problems.
    I am accessing MyBean.dll from a Visual Basic 6.0 application. Converting to VB .Net is NOT an option at this time. The VB app uses MyBean.dll for a critical part of the application.
    It is my understanding that it is not strictly necessary to go through the full JRE installation process. Simply deploying the JRE by copying its directory (and all subdirectories) to your application's directory structure should be sufficient. This would be HIGHLY desirable for my application. In fact, if I can't do this, it may be a show-stopper.
    When I install my application in this way (i.e, by simply copying the JRE instead of "installing" it) it doesn't work at all. I immediately get an error saying that the executable "has encountered a problem and needs to close. We are sorry for the inconvenience" and a dialog is displayed offering to send the problem information to Microsoft.
    The details indicate clearly that the problem occurs in the axbridge.dll, version 1.4.2.60.
    1. Any ideas on how to get the axbridge.dll to work without going through the full JRE install?
    2. Are there any alternatives to using the axbridge.dll to get my VB app to be able to use the Java? Remember, it is VB that must call the Java, NOT the other way around.
    3. Is JNI an alternative? If so, can I use JNI to get VB to use Java, or do I have to write the DLL's in C++?
    Any help you can give would be VERY MUCH appreciated.

    I'm also on a JRE installation problem with the bridge.
    Here is a regmon extract on excel using a dll that uses a java-packaged dll from the bridge:
    5229 5.69504923 EXCEL.EXE:2364 QueryValue HKCR\CLSID\{9DD49FCD-BB61-414E-88C8-E6F5B35AEDCB}\InprocServer32\(Default) SUCCESS "C:\win32app\Specific\jre1.5.0_05\bin\axbridge.dll" << The axbridge dll in a specific location
    5271 5.70646800 EXCEL.EXE:2364 QueryValue HKLM\SOFTWARE\JavaSoft\Java Plug-in\1.5.0_05\JavaHome SUCCESS "C:\Program Files\Java\jre1.5.0_05" << an installed JRE 1.5.0
    This is confirmed with process explorer : excel is using "C:\Program Files\Java\jre1.5.0_05\lib\rt.jar" and not "C:\win32app\Specific\jre1.5.0_05\lib\rt.jar"
    In other word, the axbridge check for its installation location in the registry to know where to start.
    Even if all your components have been updated in the registry as suggested here : http://forum.java.sun.com/thread.jspa?forumID=40&threadID=559704
    JRE Bug or feature?
    Anyway the registry is evil.

  • Using VB DLLs with Java on Windows

    Hi! I have a dll in my windows which make a password encryption (ok, I know that Java can do it to, but my client wants to use THIS dlls...). I need to use a function from this dll, I need to give the dll a parameter and I expect a result from it, a String result.
    I have no idea of how to do it, hope you can help me...!
    Raul
    [email protected]

    actually, you have to go through the JNI nightmare before you can access libraries from the outside, and ActiveX dlls just won't work. I'm not 100% sure, but check in the Native Method section of this forum, and those guys there would know more about it.

Maybe you are looking for