dll ?

P

pc_newbie

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

Joona I Palaste

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

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

--
/-- Joona Palaste ([email protected]) ---------------------------\
| 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
 
I

Irrwahn Grausewitz

J

jacob navia

pc_newbie said:
Hi all, can i call a c dll in another c program like what vb does
without knowing .h file? thanks
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.
 
J

jacob navia

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

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
 
G

Goran Larsson

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

Please do not confuse comp.std.c with comp.lang.c.[/QUOTE]

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.
Today is VB, what is conceptually the same. Fortran and VB are both foreign
language systems.

FORTRAN and VB are off topic here.
 
M

Martin Ambuhl

jacob said:
Please do not confuse comp.std.c with comp.lang.c.

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.
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.

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*.
 
P

pc_newbie

jacob said:
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.

Hi all guys, thanks you very much!
 
J

jacob navia

Goran Larsson said:
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.
 
G

Goran Larsson

jacob navia said:
Yes. But not the C interface to those systems. VB questions would be off topic,
not C interfacing with those systems.

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

Irrwahn Grausewitz

jacob navia said:
Yes. But not the C interface to those systems. VB questions would be off topic,
not C interfacing with those systems.

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

Irrwahn
 
J

jacob navia

----- Original Message -----
From: "Irrwahn Grausewitz" <[email protected]>
Newsgroups: comp.lang.c
Sent: Sunday, September 21, 2003 12:22 PM
Subject: Re: dll ?

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

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
 
I

Irrwahn Grausewitz

jacob navia said:
From: "Irrwahn Grausewitz" <[email protected]>
Newsgroups: comp.lang.c
Sent: Sunday, September 21, 2003 12:22 PM
Subject: Re: dll ?
Why did you include the whole header?
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.

Maybe. But foreign languages are OT in c.l.c.
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.

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.
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.

See above.
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.
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
 
M

Mark McIntyre

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

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.
The question is a legitimate question that many people have asked.

Its a legitimate question. but offtopic here.
And it concerns the C language since calling conventions from other languages are common since
the very start of C.

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

pc_newbie

pc_newbie said:
Hi all, can i call a c dll in another c program like what vb does
without knowing .h file? thanks
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.
 
I

Irrwahn Grausewitz

pc_newbie said:
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.

You asked a question that is related to C, but is not addressed by the
standardized C language, that's why there are places different from
c.l.c where you probably get better answers.
sorry
for confusing you.

No problem.

Irrwahn
 
L

LibraryUser

pc_newbie said:
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.

We are not confused. However, as others have explained, such
things not described in the standard, or implementable using only
things within the standard, are off-topic here.

For a language with built-in abilities to communicate with other
languages, etc., see Ada.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
474,079
Messages
2,570,575
Members
47,207
Latest member
HelenaCani

Latest Threads

Top