Thread: create C dll for other programming languages

  1. #1
    corn
    Guest

    create C dll for other programming languages

    Hi, dear all:

    I am a new member of this forum. Glad to have so many friends here.

    I want to wirte a DLL using C++. It should be able to be called by other programming languages, such as JAVA and VB.

    I have a question here. When I build the project with the type of "Dynamic Link Library", there are two files named *.lib and *.DLL generated in the Debug subdirectory. This *.lib is the import library (*.lib) which provides the reference of the functions in the DLL and other information. However, Java cannot link *.lib. How can I correclty link Java program with the DLL?

    Any of your help will be greatly appreciated.

  2. #2
    Registered User CompiledMonkey's Avatar
    Join Date
    Feb 2002
    Location
    Richmond, VA
    Posts
    438

    Re: create C dll for other programming languages

    Look into JNI for Java to use dlls.

  3. #3
    corn
    Guest

    Re: Re: create C dll for other programming languages

    Originally posted by CompiledMonkey
    Look into JNI for Java to use dlls.
    Yes, I have referred to the JNI. It just describes how to call a DLL from java program, but dosen't mention the lib file. It seems the lib file is not needed. But without the lib file, how does the caller get the reference of the functions?

  4. #4
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    The lib file is not needed in JNI, you must report the available methods yourself.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  5. #5
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    Thread moved to the Windows forum.
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

  6. #6
    Registered User
    Join Date
    May 2003
    Posts
    6
    The .dll file is the actual library that other applications/languages will use. Everything else in that directory is just a component of the project, and can be ignored by anything that wants to use the dll. It's the .dll file that you'll distribute when it's finished.

    N.

  7. #7
    corn
    Guest
    I have tested it and found only the dll file is needed. Thanks for your help.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 8
    Last Post: 12-01-2008, 10:09 AM
  2. Dll Injection Question
    By zenox in forum C Programming
    Replies: 13
    Last Post: 03-15-2008, 10:54 AM
  3. Replies: 1
    Last Post: 09-18-2005, 09:06 PM
  4. dll communicating between each other
    By cloudy in forum C++ Programming
    Replies: 5
    Last Post: 06-17-2005, 02:20 AM
  5. Exporting Object Hierarchies from a DLL
    By andy668 in forum C++ Programming
    Replies: 0
    Last Post: 10-20-2001, 01:26 PM