delorie.com/archives/browse.cgi | search |
Mailing-List: | contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm |
List-Unsubscribe: | <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT sourceware DOT cygnus DOT com> |
List-Subscribe: | <mailto:cygwin-subscribe AT sourceware DOT cygnus DOT com> |
List-Archive: | <http://sourceware.cygnus.com/ml/cygwin/> |
List-Post: | <mailto:cygwin AT sourceware DOT cygnus DOT com> |
List-Help: | <mailto:cygwin-help AT sourceware DOT cygnus DOT com>, <http://sourceware.cygnus.com/ml/#faqs> |
Sender: | cygwin-owner AT sourceware DOT cygnus DOT com |
Delivered-To: | mailing list cygwin AT sourceware DOT cygnus DOT com |
Date: | Mon, 1 Nov 1999 04:16:38 -0800 (PST) |
From: | "Daniel C. Sinclair" <uf657 AT victoria DOT tc DOT ca> |
X-Sender: | uf657 AT vtn1 |
To: | Colin Peters <colinp AT ma DOT kcom DOT ne DOT jp> |
cc: | GNU-win32 <cygwin AT sourceware DOT cygnus DOT com>, |
Khan Mumit <khan AT xraylith DOT wisc DOT edu> | |
Subject: | RE: mingw32 DLL getting main args? |
In-Reply-To: | <LOBBLDDPANDBNCLMBAGPKEDICCAA.colinp@ma.kcom.ne.jp> |
Message-ID: | <Pine.GSO.3.95.iB1.0.991101040605.20874A-100000@vtn1> |
MIME-Version: | 1.0 |
On Sun, 31 Oct 1999, Colin Peters wrote: > The reason DLLs call getmainargs to parse the command line list > is so that they can provide the MS-like _argc and _argv variables for > access by functions within the DLL. Check init.c, which is #included > (yuck) in dllcrt1.c. If you like you can remove the declarations from > stdlib.h and work up a DLL version of init.c to remove the dependency > of your DLL on the C run-time library. (I suspect this hasn't changed > in Mumit's version, I must admit I only checked my source.) Why support something that is non-standard? This is supposed to be a minimalist Win32 compiler. Just because VC++ has _argc and _argv doesn't mean everyone else has to. There are other ways to get the command line too. The most standard being just saving argc/argv in global variables yourself. There is also GetCommandLine(), CommandLineToArgv(), etc... > I suppose the other reason I didn't worry much about this was that I > wasn't expecting people to write much DLL code without calling any > C library functions. Many Win32 functions do the same thing as the C runtime functions. I'm using some of those. I have heard that a program and DLL should not use a different C runtime DLL - bad things can happen. My DLL will be used by many people with different compilers, even different languages. So I don't want my DLL importing anything from a C runtime DLL. Daniel -- Want to unsubscribe from this list? Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |