public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
[parent not found: <20020602050839.GA7608@redhat.com>]
* RE: new to-do item
@ 2001-07-17  6:02 Julian Hall
  0 siblings, 0 replies; 14+ messages in thread
From: Julian Hall @ 2001-07-17  6:02 UTC (permalink / raw)
  To: cygwin

Michael D. Crawford wrote:

> You will have to use com to use drag and drop or the clipboard

I'd just like to point out that this isn't entirely true.  In fact, drag
and drop of files (although not of any other type of object) can be
achieved using the DragAcceptFiles() API and the WM_DROPFILES messages.
Also, the clipboard can be accessed using EnumClipboardFormats() and
GetClipboardData().  You can't however do OLE without COM, but DDE is
certainly possible (DDE predates the introduction of COM along with OLE
in Windows 3.1).




--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 14+ messages in thread
* RE: new to-do item
@ 2001-07-16 21:56 Robert Collins
  0 siblings, 0 replies; 14+ messages in thread
From: Robert Collins @ 2001-07-16 21:56 UTC (permalink / raw)
  To: Fish, cygwin

> -----Original Message-----
> From: Fish [ mailto:fish@infidels.org ]
> Sent: Tuesday, July 17, 2001 2:49 PM
> To: cygwin@cygwin.com
> Subject: RE: new to-do item
> 
> > As I said, this is a missing header file or import library
> > issue.  The header files and libraries come with the
> > cygwin distribution but they are not related to the Cygwin
> > DLL.
> 
> I think I now see the source of my original confusion. Cygwin 
> DLL code must
> obviously make certain Win32 API calls (in order to emulate 
> the *ix environment)
> and purely as a side effect of that, it allows one to write 
> code that makes the
> same API calls.

Nope. Wrong again.

Some terms - 
the cygwin dll - a dll that exposes a subset of the common unix API
calls.
Cygwin-the-distribution - a compiler,linker,many utilities and the
cygwin dll
 
> But the ability to have one's code be able to make Win32 API 
> calls isn't
> supported per se. It's simply one of the side effects. Is 
> that correct?

Nope. They are orthogonal. You make win32 API calls by linking against a
win32 API exposing dll - say msvcrt.dll or kernel32.dll. That is how you
make those calls _WHETHER OR NOT_ you link against cygwin1.dll.
 
> Thus, as you have now sufficiently explained, my original 
> request to include the
> ability to make a given Win32 API call was inappropriate for 
> the Cygwin DLL TODO
> list. I understand that now.

It's inappropriate for the cygwin dll TODO because it's an orthogonal
issue. It's like reporting a bug with vim on the TODO.

It is _entirely_ appropriate to discuss the missing export for the
open-source w32api package :]
 
Rob

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 14+ messages in thread
* RE: new to-do item
@ 2001-07-16 21:39 Michael D. Crawford
  0 siblings, 0 replies; 14+ messages in thread
From: Michael D. Crawford @ 2001-07-16 21:39 UTC (permalink / raw)
  To: cygwin

You can do Win32 programming under CygWin.  I've been using CygWin to make
purely Win32 applications for a couple of weeks.  I don't see a problem with
mixing the Unix and Win32 apis, so long as you don't try to do one sort of thing
in two ways - for example, using CygWin stdio mixed with Win32
ReadFile/WriteFile would corrupt your I/O stream.

Here's the faq about it:

http://www.cygwin.com/faq/faq_4.html#SEC85

If you just want to use CygWin as a Win32 development system, you can even avoid
linking against CygWin.dll altogether.  Read the other FAQs in the neighborhood
of the above for info on how to do such things.

HOWEVER.

The Win32 header files that are provided in the /usr/include/w32api directory
are independently developed from the Visual C++ header files, as Microsoft's
license does not allow free redistribution of their proprietary header files.  I
guess the ones that are there were written from the published specification of
the Win32 api as well as observed behavior of existing c and c++ code meant to
work on Windows.

My experience though, is that the header files are not completely compatible
with Visual C++ or Metrowerks CodeWarrior for Windows header files.  To get your
code to compile, you will need to include a different set of headers to get some
code to compile.

It is helpful to write a header for your sourcebase that identifies both the
platform the code is being compiled for and the compiler in use, and set some
handy preprocessor symbol that lets you make conditional choices of the header
files if you're using GCC for Windows as opposed to Visual C++ for Windows, or
compiling for Win32 as opposed to POSIX.

I haven't experienced a problem yet, but the linking libraries used to make your
code work on Win32 may be incomplete or built wrong.  If that's the case, that's
a bug.  When your application is actually run, the DLL's that it will use will
be the ones supplied by Microsoft for your user's Windows installation.  It's
just that the library you link with was developed by the CygWin folks, again
like the headers to allow their redistribution.

(When you use a DLL on Windows, there are two libraries involved, one your
application links against that basically just declares a bunch of entry points,
and the one actually used at runtime that has the actual code in it).

A further unpleasant complication is that if you want to use COM, you have to
give the, I think it is, -fvtable-thunks option on the command line.  This is
unpleasant because it will require your application to be linked with a runtime
library that is also built this way because it changes the ABI of your code. 
You will have to use com to use drag and drop or the clipboard.  I ran into this
over the weekend and ended up downloading the GCC/CygWin source code so I could
make a runtime library to use when linking ZooLib applications, although I
haven't built it yet.

Regards,

Mike
-- 
Michael D. Crawford
GoingWare Inc. - Expert Software Development and Consulting
http://www.goingware.com
crawford@goingware.com

  Tilting at Windmills for a Better Tomorrow.

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 14+ messages in thread
* RE: new to-do item
@ 2001-07-16 21:15 Robert Collins
  0 siblings, 0 replies; 14+ messages in thread
From: Robert Collins @ 2001-07-16 21:15 UTC (permalink / raw)
  To: Fish, cygwin

> -----Original Message-----
> From: Fish [ mailto:fish@infidels.org ]
> Sent: Tuesday, July 17, 2001 2:03 PM
> To: cygwin@cygwin.com
> Subject: RE: new to-do item
> 
> 
> > >Is this not a cygwin dll issue?
> >
> > No.  The Cygwin DLL emulates *UNIX*, not Windows.
> 
> Hmmm... Yes, I suppose you're right in that regard.

I certainly hope Chris is right!
 
> > We don't add Windows system calls to the Cygwin DLL.
> 
> So what you're basically saying then is one can *only* use 
> Cygwin to develop
> UNIX programs that should also be able to run on Windows 
> platforms as well, BUT,
> even though these programs just so happen to be able to be 
> run under Windows,
> they are not allowed to make use of *any* Windows API calls 
> whatsoever anywhere
> in their code?? Is that correct?

No. It wasn't implied either. You can link to windows .dll's and use
windows API calls, but you need appropriate headers and import
libraries. Along with cygwin, but not part of cygwin (like vim comes
with cygwin but isn't part of it) you get a fairly complete set of
windows hears and import libraries.
 
> > >If it's not, then *WHO'S* issue is it??
> >
> > It's either a header file or import library issue.
> >
> > I've cc'ed this email to the cygwin mailing list.  Perhaps
> > someone will be willing to research what needs to be
> > done to add this missing function or macro.
> >
> > cgf
> 
> Thanks. The development team of which I'm a part of  (as is 
> Greg Smith too) has
> been for the most part successful so far in developing a 
> product that, with
> cygwin's help, runs as easily on Windows as it does on 
> Linux/Unix (*ix)
> platforms. Unfortunately, however, it doesn't perform as well 
> under Windows as
> it does under *ix. We attribute this poor performance for the 
> most part to the
> cygwin code.

Thanks :]. Seriously, cygwin *can* be optimised and made better. We are
all volunteers however, and time constraints affect us all. Also
profiling cygwin isn't easy, so it can be difficult to identify the
performance bottleneck causing issues.

However it's in *all* our interests to improve cygwin in preference to
multiple software writers creating similar work-arounds. So for instance
if you want to use critical sections in preference to win32 mutex's for
syncronisation, we can (and I have on my todo list to do) use critical
sections in prefernece to win32 mutexs for non-cross-process emulated
unix mutex's.

> We fully understand, of course, that emulating an *ix 
> environment on Windows is
> no easy task, and applaud the cygwin people for doing as good 
> a job as they have
> in accomplishing that end.
> 
> But in order to reach the desired performance level under 
> Windows (*without*
> having to rewrite it completely in native Win32 form), we 
> would like to
> introduce on an as-needed basis certain Win32-specific logic 
> in a few places.
> From what you're telling me, cygwin doesn't allow (support) that.

Again, Chris didn't imply that. He stated the cygwin dll doesn't do that
- not that the compiler and "cygwin-the-platform" doesn't. Cygwin _uses_
win32 code to do what it does however.
 
> If we are unable to do that (i.e. make native Win32 API calls 
> wherever we feel
> it's necessary) using the cygwin development environment, 
> then forgive me but
> I'm at a total loss as to how to accomplish our desired goal 
> (short of rewriting
> it completely in native Win32 using Microsnot's own tools; 
> i.e. developing a
> custom "Win32-ONLY" version).
> 
> Is there *any* way, using cygwin, to make calls to Win32 APIs?

Yes. Do what you did - that particular call isn't in the win32 import
library - so that particular package will need a patch generated to
include the approprirate definition. I suspect the missing call is a
windows 2000 only call - which certainly wouldn't be appropriate for a
product that you want usable anywhere Win32 is available.
 
> Thanks.
> 
> (If there's a more appropriate email list or news group for 
> such questions,
> please let me know. I know you're a busy man and I don't wish 
> to take up your
> time if you're not the right person to be talking to 
> regarding this issue.)
> 
> Sincerely,
> --
> "Fish" (David B. Trout)
>    fish@infidels.org
> 
> 
> --
> Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
> Bug reporting:         http://cygwin.com/bugs.html
> Documentation:         http://cygwin.com/docs.html
> FAQ:                   http://cygwin.com/faq/
> 
> 

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 14+ messages in thread
[parent not found: <5.0.2.1.0.20001224150748.027d5cf0@mail.mindspring.com>]

end of thread, other threads:[~2002-06-02 17:35 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20010716224931.A6039@redhat.com>
     [not found] ` <000301c10e6e$bb08ebc0$0200a8c0@proteva>
2001-07-16 20:24   ` new to-do item Christopher Faylor
2001-07-16 21:03     ` Fish
2001-07-16 21:17       ` Christopher Faylor
2001-07-16 21:42         ` Greg Smith
2001-07-16 21:51           ` Christopher Faylor
2001-07-16 21:49         ` Fish
     [not found] <20020602050839.GA7608@redhat.com>
     [not found] ` <LDECKPHLDGDPOJHDCDHPKEPECAAA.mgianzero@cox.net>
2002-06-02  9:30   ` Christopher Faylor
2002-06-02 10:35     ` Larry Hall (RFK Partners, Inc)
2001-07-17  6:02 Julian Hall
  -- strict thread matches above, loose matches on Subject: below --
2001-07-16 21:56 Robert Collins
2001-07-16 21:39 Michael D. Crawford
2001-07-16 21:15 Robert Collins
     [not found] <5.0.2.1.0.20001224150748.027d5cf0@mail.mindspring.com>
     [not found] ` <20001224195414.9955.qmail@sourceware.cygnus.com>
     [not found]   ` <200012242017.PAA08851@greed.delorie.com>
     [not found]     ` <5.0.2.1.0.20001224160230.027ca4f0@mail.mindspring.com>
2000-12-24 13:41       ` Chris Faylor
2000-12-24 13:58         ` Chuck Esterbrook

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