Announcement

Collapse
No announcement yet.

Programming question: using dll files ?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Programming question: using dll files ?

    Hello,

    I have a simple (?) programming question. I downloaded a windows .dll file from Sourceforge, and would like to use this in my C++ programs.

    How do I know what is in the dll-file (classdefinitions, functions, ...) ? And how do I "include" the code ?
    (most likely using Visual Studio 6.0)

    Thanks !


    Jörg

    PS: This is not a school assignment
    pixar
    Dream as if you'll live forever. Live as if you'll die tomorrow. (James Dean)

  • #2
    Happy hour anyone!
    According to the latest official figures, 43% of all statistics are totally worthless...

    Comment


    • #3
      Happy hour ?
      I don't get it...

      Do you mean that you don't believe it is not a school assignment ? (how can I prove it)

      I can't seem to find this information in my Windows C++ reference, and it would seem usefull for my application. I got a lot of good informatio from this forums, so I thought I'd give it a go here...

      Jörg
      pixar
      Dream as if you'll live forever. Live as if you'll die tomorrow. (James Dean)

      Comment


      • #4
        How could you know if it's useful if you don't know the contents?
        To make up for asking the obvious question:
        I've done this in Basic, Java, and PowerBuilder. but not in C++.
        So when our C++ guy gets back from lunch, I'll get you a code snippet if no one has replied yet.
        Chuck
        Chuck
        秋音的爸爸

        Comment


        • #5
          Jorg you include the code by using a libray (*.lib) and normally a documentation explains the API calls that are used in a DLL.

          I hope this explains it a little because your question isn't crystalclear for me as a C++ programmer .
          Main: Dual Xeon LV2.4Ghz@3.1Ghz | 3X21" | NVidia 6800 | 2Gb DDR | SCSI
          Second: Dual PIII 1GHz | 21" Monitor | G200MMS + Quadro 2 Pro | 512MB ECC SDRAM | SCSI
          Third: Apple G4 450Mhz | 21" Monitor | Radeon 8500 | 1,5Gb SDRAM | SCSI

          Comment


          • #6
            Originally posted by Guru
            Happy hour anyone!
            LOL!
            If there's artificial intelligence, there's bound to be some artificial stupidity.

            Jeremy Clarkson "806 brake horsepower..and that on that limp wrist faerie liquid the Americans call petrol, if you run it on the more explosive jungle juice we have in Europe you'd be getting 850 brake horsepower..."

            Comment


            • #7
              VJ ... you don't include the code in a dll file, that implies your including source code. You invoke the compiled code in a dll file through dynamic linkage (thus the name dll) to its embodied routines. You can use a linker or viewer to detail the entry points in the dll.
              <TABLE BGCOLOR=Red><TR><TD><Font-weight="+1"><font COLOR=Black>The world just changed, Sep. 11, 2001</font></Font-weight></TR></TD></TABLE>

              Comment


              • #8
                Yeah, what Xortam said.

                The problem, of course, is that someone SHOULD have included some nice documentation to tell you what the entry points are, the syntax and arguments, etc. etc.

                - Gurm
                The Internet - where men are men, women are men, and teenage girls are FBI agents!

                I'm the least you could do
                If only life were as easy as you
                I'm the least you could do, oh yeah
                If only life were as easy as you
                I would still get screwed

                Comment


                • #9
                  See if this helps.


                  You may still need a utility that can extract the func and class names.
                  Chuck
                  Chuck
                  秋音的爸爸

                  Comment


                  • #10
                    From our C++ guy:

                    chuck
                    Chuck
                    秋音的爸爸

                    Comment


                    • #11
                      if you your using visual c++, and the dll contains a type libaray.
                      you can just import the dll into your development enviroment, and the required header and type libraries will be geneterated.
                      The classes will show up in you classview window.

                      some dll's can't be used that way and must be imported using something like this:

                      #import "the.dll" no_namespace

                      But if its your standard type of dll you will have to use a tool to create a library file for you.

                      Or make your own header files (using correct calling conventions and function decoration)
                      and then set your def files and play around with your linker...yuck

                      what is the dll?, what is it for?

                      Comment


                      • #12
                        Keifront:
                        There is no .lib file, only 2 dll's (glib.dll and gts-0.5.0.dll)

                        Xortam:
                        I thought "include" was not the right word to use, but English not being my native language...

                        about the .dll :
                        I downloaded it from http://gts.sourceforge.net (GNU Triangulated Surface Library). There are source-files for unix/linux that contain classes, functions and samples for triangulating geometric data (see the sample-section).
                        In the list of downloads, there also is a windows-binary download. This zipfile however only contains the 2 mentioned dll files, without any documentation. I suspect they also contain the class definition, etc. but I am not sure of this. I might find out if I get the dll to work, currently I have to work through intermediate files (importing/exporting data).
                        I am working on a program that needs such triangulated data (along with own developped methods) for a research paper. The program is only needed to test the developped techniques, so performance and convenience are not primary goals.

                        cjolley:
                        I believe I have .dll browsing utility lying around somewhere.

                        Thanks for the information so far !
                        I will try it as soon as I have a chance.

                        Jörg
                        pixar
                        Dream as if you'll live forever. Live as if you'll die tomorrow. (James Dean)

                        Comment


                        • #13
                          VJ ... if you've coded in C you know that the word "include" is significant as its the keyword associated with the preprocessor control line to incorporate source code from an external file into the code invoking the "#include" statement.

                          AFA function documentation, the site you referenced has links to the documentation on the left hand side. The GTS Reference link gets you to the GTS Library Reference Manual which documents the various data structures and function declarations. You'll notice that the library isn't coded in C++ but rather C. The site states:
                          The code is written entirely in C with an object-oriented approach based mostly on the design of GTK+.
                          <TABLE BGCOLOR=Red><TR><TD><Font-weight="+1"><font COLOR=Black>The world just changed, Sep. 11, 2001</font></Font-weight></TR></TD></TABLE>

                          Comment


                          • #14
                            its a gnu thingy, which is usualy compiled useing gcc, probably in a cygwin kind of environment..

                            It can probabably been compiled using vcc, but you will have make your own library files..
                            The header files can be found on the site, just download a sample app(source) using it eg GTSView and get them from there..you may have to modify them a bit.

                            if you are keen you prbably download the source for GTK and recompile it using Visual C, then you won't have to worry about make your libaraies etc...sounds like a fair bit of work.

                            I would think the site itself may provide some links to the required info, or check some gnu newsgroups

                            Comment


                            • #15
                              xortam:
                              Ok, yes, the "include" was a bad use of words (hence the quotes in my original post)... As I stated before, English is not my native language and I wasn't sure which word I had to use...
                              I never said the dll was in C++, I just wanted to use it in a C++ program.


                              Marshammowman:
                              its a gnu thingy, which is usualy compiled useing gcc, probably in a cygwin kind of environment..

                              It can probabably been compiled using vcc, but you will have make your own library files..
                              The header files can be found on the site, just download a sample app(source) using it eg GTSView and get them from there..you may have to modify them a bit.
                              I have the cygwin environment installed... But now that you mention it : it is indeed very likely the dll is only usable in this environment. The other dll (glib) also doesn't have a windowport (other than the cygwin). So the dll's (as such) probablely cannot be used in Visual C++.

                              if you are keen you prbably download the source for GTK and recompile it using Visual C, then you won't have to worry about make your libaraies etc...sounds like a fair bit of work.
                              Well, the thought has crossed my mind some time ago... I then tried to compile the entire GTS in cygwin, but was lacking the glib.dll (it wasn't available for download back then). I had forgotten about this, but seeing your post made me realise the glib.dll is very likely to be for cygwin.
                              Perhaps I'll try to compile the whole lot again in the cygwin-environment.

                              But for the moment, I think I'll stick with my current approach (program under linux that outputs to a file, my own program that uses such files as input...) if I want a piece of software in a relatively short notice...(software is supposed to backup my paper for a conference , and the deadline is coming shortly)

                              Thanks guys !


                              Jörg
                              pixar
                              Dream as if you'll live forever. Live as if you'll die tomorrow. (James Dean)

                              Comment

                              Working...
                              X