Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , 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" X-Sender: uf657 AT vtn1 To: Colin Peters cc: GNU-win32 , Khan Mumit Subject: RE: mingw32 DLL getting main args? In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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