www.digitalmars.com Home | Search | C & C++ | D | DMDScript | News Groups | index | prev | next
Archives

D Programming
D
D.gnu
digitalmars.D
digitalmars.D.bugs
digitalmars.D.dtl
digitalmars.D.dwt
digitalmars.D.announce
digitalmars.D.learn
digitalmars.D.debugger

C/C++ Programming
c++
c++.announce
c++.atl
c++.beta
c++.chat
c++.command-line
c++.dos
c++.dos.16-bits
c++.dos.32-bits
c++.idde
c++.mfc
c++.rtl
c++.stl
c++.stl.hp
c++.stl.port
c++.stl.sgi
c++.stlsoft
c++.windows
c++.windows.16-bits
c++.windows.32-bits
c++.wxwindows

digitalmars.empire
digitalmars.DMDScript

c++ - Args passing and returning scheme

↑ ↓ ← Jean-Pierre H. Dumas <dumas.jeanpierre free.fr> writes:
I read carefully (?) the docs and there is one
puzzling fact about the way DM returns results from
C function.
(I am still talking about C and Win32)

As it is said different from the way MS is doing it,
does this really mean that I can *safelly* run a program
compiled and linked with DM, dynamically bound
to a MS produced dll ?
In the doc it is said that it may not work.
But then user32.dll, gdi32.dll  et al. are
giving good results only because they are _pascal ???

If I understand right, with Watcom C, if I compile
using register passing conventions (5r) I can still
dynamically use MS style dll because they are
declared as _cdecl in the .h file. right ?

Not same with DM ?

Can you technically enlighten me ?

Jean-Pierre Dumas
Jan 27 2002
↑ ↓ → Jan Knepper <jan smartsoft.cc> writes:
"Jean-Pierre H. Dumas" wrote:

 I read carefully (?) the docs and there is one
 puzzling fact about the way DM returns results from
 C function.
 (I am still talking about C and Win32)

 As it is said different from the way MS is doing it,
 does this really mean that I can *safelly* run a program
 compiled and linked with DM, dynamically bound
 to a MS produced dll ?

Should be no problem as long as you use the proper prototype.
 In the doc it is said that it may not work.
 But then user32.dll, gdi32.dll  et al. are
 giving good results only because they are _pascal ???

Exactly. The prototype has to be correct.
 If I understand right, with Watcom C, if I compile
 using register passing conventions (5r) I can still
 dynamically use MS style dll because they are
 declared as _cdecl in the .h file. right ?

Yup!
 Not same with DM ?

Should be the same. There is no -r5 switch though.... Jan
Jan 27 2002