dll ?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • pc_newbie

    dll ?

    Hi all, can i call a c dll in another c program like what vb does
    without knowing .h file? thanks

  • Irrwahn Grausewitz

    #2
    Re: dll ?

    pc_newbie <ay@computermai l.net> wrote:
    [color=blue]
    >Hi all, can i call a c dll in another c program like what vb does
    >without knowing .h file? thanks[/color]

    Sorry, this is off-topic in comp.lang.c because it cannot be done
    in a portable manner with standard C.

    Please read the welcome message
    Angelfire on Lycos, established in 1995, is one of the leading personal publishing communities on the Web. Angelfire makes it easy for members to create their own blogs, web sites, get a web address (domain) and start publishing online.


    and the faq-list for this ng


    before posting. Thank you very much.

    Regards

    Irrwahn
    --
    My other computer is a abacus.

    Comment

    • jacob navia

      #3
      Re: dll ?


      "pc_newbie" <ay@computermai l.net> wrote in message news:3f6c749c_1 @news.iprimus.c om.au...[color=blue]
      > Hi all, can i call a c dll in another c program like what vb does
      > without knowing .h file? thanks
      >[/color]
      Yes, you can.
      You can write your own header file just for the functions you are going to
      use. But you must know exactly what the prototypes of those functions are. If you
      got the documentation, you can eassily figure out the prototypes, even without
      a header file.


      Comment

      • jacob navia

        #4
        Re: dll ?

        [color=blue]
        >
        > Sorry, this is off-topic in comp.lang.c because it cannot be done
        > in a portable manner with standard C.[/color]

        Please do not confuse comp.std.c with comp.lang.c.

        The question is a legitimate question that many people have asked. And it concerns
        the C language since calling conventions from other languages are common since
        the very start of C.

        C uses binary interfaces with other languages since a long time, FORTRAN being the
        first one.

        Today is VB, what is conceptually the same. Fortran and VB are both foreign
        language systems.

        jacob


        Comment

        • Goran Larsson

          #5
          Re: dll ?

          In article <bkiju4$mrq$1@n ews-reader1.wanadoo .fr>,
          jacob navia <jacob.navia@ja cob.remcomp.fr> wrote:
          [color=blue][color=green]
          > > Sorry, this is off-topic in comp.lang.c because it cannot be done
          > > in a portable manner with standard C.[/color]
          >
          > Please do not confuse comp.std.c with comp.lang.c.[/color]

          You are confused.

          We write about the C standard document in comp.std.c.
          We write about the C standard language in comp.lang.c.
          We write about platform specific issues in some other newsgroup.
          [color=blue]
          > Today is VB, what is conceptually the same. Fortran and VB are both foreign
          > language systems.[/color]

          FORTRAN and VB are off topic here.

          --
          Göran Larsson http://www.mitt-eget.com/

          Comment

          • Martin Ambuhl

            #6
            Re: dll ?

            jacob navia wrote:
            [color=blue][color=green]
            >>Sorry, this is off-topic in comp.lang.c because it cannot be done
            >>in a portable manner with standard C.[/color]
            >
            >
            > Please do not confuse comp.std.c with comp.lang.c.[/color]

            Since the statement you responded to (without attribution) was exactly
            right in comp.lang.c and was, if not wrong, then completely strange for
            comp.std.c, it is clearly you who is confused.

            In comp.std.c, the topic is the standard, and so programming questions are
            off-topic, even if the tasks can be done in standard C.

            In comp.lang.c, the topic is programming in C, a language that is defined
            by the standard. That language does not specify anything about linkage to
            other languages. That is an *implementation * issue and is asked in an
            implementation-specific newsgroup. Next we know, you'll be posting things
            about non-types like 'qfloat' and garbage collection as part of the language.

            Perhaps you should just hang up your keyboard until you learn what the
            newsgroup is about, and that posting otherwise is rude. You might also
            learn not to "correct" people who are right with your completely offbase
            errors.
            [color=blue]
            >
            > The question is a legitimate question that many people have asked. And it concerns
            > the C language since calling conventions from other languages are common since
            > the very start of C.[/color]

            Big deal. In *every* case it is a process involving negotiations between
            some *implementation * of C, some *implementation * of that other language,
            and some *implementation * of a linker. The possible combinations are
            enough to make any answer given here not only off-topic (and it would be,
            no matter what you've been smoking to think otherwise), but *wrong*.




            --
            Martin Ambuhl

            Comment

            • pc_newbie

              #7
              Re: dll ?

              jacob navia wrote:[color=blue]
              > "pc_newbie" <ay@computermai l.net> wrote in message news:3f6c749c_1 @news.iprimus.c om.au...
              >[color=green]
              >>Hi all, can i call a c dll in another c program like what vb does
              >>without knowing .h file? thanks
              >>[/color]
              >
              > Yes, you can.
              > You can write your own header file just for the functions you are going to
              > use. But you must know exactly what the prototypes of those functions are. If you
              > got the documentation, you can eassily figure out the prototypes, even without
              > a header file.
              >
              >[/color]

              Hi all guys, thanks you very much!


              Comment

              • jacob navia

                #8
                Re: dll ?


                "Goran Larsson" <hoh@invalid.in valid> wrote in message news:HLJBEu.4sH @approve.se...[color=blue]
                > FORTRAN and VB are off topic here.[/color]

                Yes. But not the C interface to those systems. VB questions would be off topic,
                not C interfacing with those systems.
                [color=blue]
                >
                > --
                > Göran Larsson http://www.mitt-eget.com/[/color]


                Comment

                • Goran Larsson

                  #9
                  Re: dll ?

                  In article <bkjqqu$6g9$1@n ews-reader5.wanadoo .fr>,
                  jacob navia <jacob.navia@ja cob.remcomp.fr> wrote:
                  [color=blue]
                  > Yes. But not the C interface to those systems. VB questions would be off topic,
                  > not C interfacing with those systems.[/color]

                  Even that is off topic here. There is nothing in the C standard about
                  interfacing to FORTRAN or VB, it is all implementation specific.

                  --
                  Göran Larsson http://www.mitt-eget.com/

                  Comment

                  • Irrwahn Grausewitz

                    #10
                    Re: dll ?

                    "jacob navia" <jacob.navia@ja cob.remcomp.fr> wrote:[color=blue]
                    >
                    >"Goran Larsson" <hoh@invalid.in valid> wrote in message news:HLJBEu.4sH @approve.se...[color=green]
                    >> FORTRAN and VB are off topic here.[/color]
                    >
                    >Yes. But not the C interface to those systems. VB questions would be off topic,
                    >not C interfacing with those systems.[/color]

                    Ah, so? Please point out where in the C standard(s) the terms 'dll',
                    'VB' or 'interface' are mentioned; C&V please.

                    Irrwahn
                    --
                    My other computer is a abacus.

                    Comment

                    • jacob navia

                      #11
                      Re: dll ?


                      ----- Original Message -----
                      From: "Irrwahn Grausewitz" <irrwahn33REMOV ECAPS@freenet.d e>
                      Newsgroups: comp.lang.c
                      Sent: Sunday, September 21, 2003 12:22 PM
                      Subject: Re: dll ?

                      [color=blue]
                      > "jacob navia" <jacob.navia@ja cob.remcomp.fr> wrote:[color=green]
                      > >
                      > >"Goran Larsson" <hoh@invalid.in valid> wrote in message news:HLJBEu.4sH @approve.se...[color=darkred]
                      > >> FORTRAN and VB are off topic here.[/color]
                      > >
                      > >Yes. But not the C interface to those systems. VB questions would be off topic,
                      > >not C interfacing with those systems.[/color]
                      >
                      > Ah, so? Please point out where in the C standard(s) the terms 'dll',
                      > 'VB' or 'interface' are mentioned; C&V please.
                      >[/color]

                      The question of the OP is covered in 6.7.5.3: prototypes.

                      Prototypes are used to specify function interfaces, that can be very well written in
                      a foreign language.

                      The question concerned how to figure out the prototypes for functions written
                      in VB but this is equally useful for any foreign functions, in FORTRAN, VB,
                      Pascal or whatever.

                      The standard way of doing this is providing a C bindings header. I answered that
                      in the absence of this header, this can be done by using the documentation of
                      the package, and figuring out the C interface of the functions you want to use.

                      It is a widely used practice to give prototypes (header files) for functions written
                      in assembly language. All system header files like TCPIP headers, GUI headers,
                      etc, use this facility of the C language. There is nothing off topic here, and I would
                      contradict your assertion that "this can't be done in portable C". Of course it can
                      be done, and it is done massively in all operating systems I know of.

                      jacob


                      Comment

                      • Irrwahn Grausewitz

                        #12
                        Re: dll ?

                        "jacob navia" <jacob.navia@ja cob.remcomp.fr> wrote:[color=blue]
                        >
                        >From: "Irrwahn Grausewitz" <irrwahn33REMOV ECAPS@freenet.d e>
                        >Newsgroups: comp.lang.c
                        >Sent: Sunday, September 21, 2003 12:22 PM
                        >Subject: Re: dll ?
                        >[/color]
                        Why did you include the whole header?[color=blue]
                        >[color=green]
                        >> "jacob navia" <jacob.navia@ja cob.remcomp.fr> wrote:[color=darkred]
                        >> >
                        >> >"Goran Larsson" <hoh@invalid.in valid> wrote in message news:HLJBEu.4sH @approve.se...
                        >> >> FORTRAN and VB are off topic here.
                        >> >
                        >> >Yes. But not the C interface to those systems. VB questions would be off topic,
                        >> >not C interfacing with those systems.[/color]
                        >>
                        >> Ah, so? Please point out where in the C standard(s) the terms 'dll',
                        >> 'VB' or 'interface' are mentioned; C&V please.
                        >>[/color]
                        >
                        >The question of the OP is covered in 6.7.5.3: prototypes.
                        >
                        >Prototypes are used to specify function interfaces, that can be very well written in
                        >a foreign language.[/color]

                        Maybe. But foreign languages are OT in c.l.c.
                        [color=blue]
                        >
                        >The question concerned how to figure out the prototypes for functions written
                        >in VB but this is equally useful for any foreign functions, in FORTRAN, VB,
                        >Pascal or whatever.[/color]

                        And all of this is OT too. Write about FORTRAN in a FORTRAN ng, about
                        VB in VB ng, write about Pascal ina Pascal ng. That's what they are
                        made for.
                        [color=blue]
                        >
                        >The standard way of doing this is providing a C bindings header. I answered that
                        >in the absence of this header, this can be done by using the documentation of
                        >the package, and figuring out the C interface of the functions you want to use.
                        >[/color]

                        See above.
                        [color=blue]
                        >It is a widely used practice to give prototypes (header files) for functions written
                        >in assembly language. All system header files like TCPIP headers, GUI headers,
                        >etc, use this facility of the C language. There is nothing off topic here, and I would
                        >contradict your assertion that "this can't be done in portable C". Of course it can
                        >be done, and it is done massively in all operating systems I know of.
                        >[/color]
                        System header files are, will be and have ever been non-standard and
                        therefore OT in c.l.c, just like TCP/IP, GUIs, GC, etc.

                        If you reread you will notice that my assertion was: "it cannot be done
                        in a portable manner with standard C", and it still holds. Please stop
                        polluting c.l.c with OT OS/implementation-specific trash, you are
                        wasting my limited bandwidth.

                        Thank you.

                        Irrwahn
                        --
                        My other computer is a abacus.

                        Comment

                        • Mark McIntyre

                          #13
                          Re: dll ?

                          On Sun, 21 Sep 2003 00:21:54 +0200, in comp.lang.c , "jacob navia"
                          <jacob.navia@ja cob.remcomp.fr> wrote:
                          [color=blue]
                          >[color=green]
                          >>
                          >> Sorry, this is off-topic in comp.lang.c because it cannot be done
                          >> in a portable manner with standard C.[/color]
                          >
                          >Please do not confuse comp.std.c with comp.lang.c.[/color]

                          You're confused yourself. C.S.C is for discussion about the standard
                          itself, ie the document. C.L.C is for discussion of how to use the
                          language defined in the Standard.
                          [color=blue]
                          >The question is a legitimate question that many people have asked.[/color]

                          Its a legitimate question. but offtopic here.
                          [color=blue]
                          >And it concerns the C language since calling conventions from other languages are common since
                          >the very start of C.[/color]

                          And since the very start of Standardised C, they've been outside the
                          Standard.

                          --
                          Mark McIntyre
                          CLC FAQ <http://www.eskimo.com/~scs/C-faq/top.html>
                          CLC readme: <http://www.angelfire.c om/ms3/bchambless0/welcome_to_clc. html>

                          Comment

                          • Joona I Palaste

                            #14
                            Re: dll ?

                            pc_newbie <ay@computermai l.net> scribbled the following:[color=blue]
                            > Hi all, can i call a c dll in another c program like what vb does
                            > without knowing .h file? thanks[/color]

                            You will have to know and provide the function prototypes yourself.

                            --
                            /-- Joona Palaste (palaste@cc.hel sinki.fi) ---------------------------\
                            | Kingpriest of "The Flying Lemon Tree" G++ FR FW+ M- #108 D+ ADA N+++|
                            | http://www.helsinki.fi/~palaste W++ B OP+ |
                            \----------------------------------------- Finland rules! ------------/
                            "Stronger, no. More seductive, cunning, crunchier the Dark Side is."
                            - Mika P. Nieminen

                            Comment

                            • pc_newbie

                              #15
                              Re: dll ?

                              pc_newbie wrote:
                              [color=blue]
                              > Hi all, can i call a c dll in another c program like what vb does
                              > without knowing .h file? thanks
                              >[/color]
                              i am asking a question in c, but want to know if c could do the way like
                              what what what.... i am not asking other programming lang. here. sorry
                              for confusing you.

                              Comment

                              Working...