* RE: CFORTRAN for cygwin/egcs?
@ 1999-03-16 3:02 Billinghurst, David (RTD)
[not found] ` < A9E96A79C068D211A6A90000C07BDF0D1DE699@CRTSMAIL >
1999-03-31 19:45 ` CFORTRAN for cygwin/egcs? Billinghurst, David (RTD)
0 siblings, 2 replies; 4+ messages in thread
From: Billinghurst, David (RTD) @ 1999-03-16 3:02 UTC (permalink / raw)
To: cygwin; +Cc: Richard Stanton
Yes please. I'd love an example of a DLL callable from Excel
> -----Original Message-----
> From: Mumit Khan [SMTP:khan@xraylith.wisc.EDU]
> Sent: Tuesday 16 March 1999 19:47
> To: Richard Stanton
> Cc: cygwin@sourceware.cygnus.com
> Subject: Re: CFORTRAN for cygwin/egcs?
>
> "Richard Stanton" <stanton@haas.berkeley.edu> writes:
> > It IS trivial to use, I've found, as long as you use version 3.5 rather
> than
> > 2.8. The latter seems to be more easily found. As you say,
> > using -Df2cFortran, and linking with -lg2c, gets the sample program to
> > compile without warnings.
>
> Thank you. That's very useful information, especially since it goes into
> the mailing list archive.
>
> BTW, can I use your Excel DLL as an example (with proper attribution of
> course)? I'd like to create some examples in C, C++ and F77 to create
> DLLs for VB/Excel etc like I've done for Java etc.
>
> Regards,
> Mumit
>
>
> --
> Want to unsubscribe from this list?
> Send a message to cygwin-unsubscribe@sourceware.cygnus.com
--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com
^ permalink raw reply [flat|nested] 4+ messages in thread
[parent not found: < A9E96A79C068D211A6A90000C07BDF0D1DE699@CRTSMAIL >]
* Excel-callable DLL [RE: CFORTRAN for cygwin/egcs?]
[not found] ` < A9E96A79C068D211A6A90000C07BDF0D1DE699@CRTSMAIL >
@ 1999-03-17 9:06 ` Mumit Khan
1999-03-31 19:45 ` Mumit Khan
0 siblings, 1 reply; 4+ messages in thread
From: Mumit Khan @ 1999-03-17 9:06 UTC (permalink / raw)
To: Billinghurst, David (RTD); +Cc: cygwin
On Tue, 16 Mar 1999, Billinghurst, David (RTD) wrote:
> Yes please. I'd love an example of a DLL callable from Excel
I won't get a chance to make an example for a while, but here's the
essential info:
1. You need to tell the compiler that the functions need to use the
stdcall calling convention and not the default cdecl. There are two
ways to do it:
a. You can attach an __attribute__((stdcall)) (or WINAPI or STDCALL
which are macros that expand to the attribute) to each exported
function. This is not possible in g77, so you need to use b.
b. Compile all the to-be-turned-into-DLL files with -mrtd, which tells
the compiler to use stdcall calling convention for all the functions.
In most cases, (b) is the simpler option since you don't need to modify
the source code at all.
2. if you're using Cygwin GCC (no -mno-cygwin), then you need to do supply
"special" entry point so that Cygwin DLL is initialized correctly when
it's loaded by Excel etc. Also, you need to make sure cygwin1.dll is in
your path when Excel loads your DLL.
$ dllwrap --entry __cygwin_noncygwin_dll_entry@12 [rest of the options]
I believe the examples in the dllhelpers package describe the rest.
BTW, this is exactly the same mechanism for creating a Java JNI using
Cygwin DLL. (1) is taken care of automatically since Java headers define
a macro that essentially makes the calling convention stdcall. See my
java-jni-examples package for more info.
Regards,
mumit
--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com
^ permalink raw reply [flat|nested] 4+ messages in thread
* Excel-callable DLL [RE: CFORTRAN for cygwin/egcs?]
1999-03-17 9:06 ` Excel-callable DLL [RE: CFORTRAN for cygwin/egcs?] Mumit Khan
@ 1999-03-31 19:45 ` Mumit Khan
0 siblings, 0 replies; 4+ messages in thread
From: Mumit Khan @ 1999-03-31 19:45 UTC (permalink / raw)
To: Billinghurst, David (RTD); +Cc: cygwin
On Tue, 16 Mar 1999, Billinghurst, David (RTD) wrote:
> Yes please. I'd love an example of a DLL callable from Excel
I won't get a chance to make an example for a while, but here's the
essential info:
1. You need to tell the compiler that the functions need to use the
stdcall calling convention and not the default cdecl. There are two
ways to do it:
a. You can attach an __attribute__((stdcall)) (or WINAPI or STDCALL
which are macros that expand to the attribute) to each exported
function. This is not possible in g77, so you need to use b.
b. Compile all the to-be-turned-into-DLL files with -mrtd, which tells
the compiler to use stdcall calling convention for all the functions.
In most cases, (b) is the simpler option since you don't need to modify
the source code at all.
2. if you're using Cygwin GCC (no -mno-cygwin), then you need to do supply
"special" entry point so that Cygwin DLL is initialized correctly when
it's loaded by Excel etc. Also, you need to make sure cygwin1.dll is in
your path when Excel loads your DLL.
$ dllwrap --entry __cygwin_noncygwin_dll_entry@12 [rest of the options]
I believe the examples in the dllhelpers package describe the rest.
BTW, this is exactly the same mechanism for creating a Java JNI using
Cygwin DLL. (1) is taken care of automatically since Java headers define
a macro that essentially makes the calling convention stdcall. See my
java-jni-examples package for more info.
Regards,
mumit
--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: CFORTRAN for cygwin/egcs?
1999-03-16 3:02 CFORTRAN for cygwin/egcs? Billinghurst, David (RTD)
[not found] ` < A9E96A79C068D211A6A90000C07BDF0D1DE699@CRTSMAIL >
@ 1999-03-31 19:45 ` Billinghurst, David (RTD)
1 sibling, 0 replies; 4+ messages in thread
From: Billinghurst, David (RTD) @ 1999-03-31 19:45 UTC (permalink / raw)
To: cygwin; +Cc: Richard Stanton
Yes please. I'd love an example of a DLL callable from Excel
> -----Original Message-----
> From: Mumit Khan [SMTP:khan@xraylith.wisc.EDU]
> Sent: Tuesday 16 March 1999 19:47
> To: Richard Stanton
> Cc: cygwin@sourceware.cygnus.com
> Subject: Re: CFORTRAN for cygwin/egcs?
>
> "Richard Stanton" <stanton@haas.berkeley.edu> writes:
> > It IS trivial to use, I've found, as long as you use version 3.5 rather
> than
> > 2.8. The latter seems to be more easily found. As you say,
> > using -Df2cFortran, and linking with -lg2c, gets the sample program to
> > compile without warnings.
>
> Thank you. That's very useful information, especially since it goes into
> the mailing list archive.
>
> BTW, can I use your Excel DLL as an example (with proper attribution of
> course)? I'd like to create some examples in C, C++ and F77 to create
> DLLs for VB/Excel etc like I've done for Java etc.
>
> Regards,
> Mumit
>
>
> --
> Want to unsubscribe from this list?
> Send a message to cygwin-unsubscribe@sourceware.cygnus.com
--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~1999-03-31 19:45 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-03-16 3:02 CFORTRAN for cygwin/egcs? Billinghurst, David (RTD)
[not found] ` < A9E96A79C068D211A6A90000C07BDF0D1DE699@CRTSMAIL >
1999-03-17 9:06 ` Excel-callable DLL [RE: CFORTRAN for cygwin/egcs?] Mumit Khan
1999-03-31 19:45 ` Mumit Khan
1999-03-31 19:45 ` CFORTRAN for cygwin/egcs? Billinghurst, David (RTD)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).