X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f From: "Rod Pemberton" Newsgroups: comp.os.msdos.djgpp Subject: Re: Drag and Drop to Command Line Date: Tue, 15 Jul 2008 04:25:44 -0400 Organization: Aioe.org NNTP Server Lines: 44 Message-ID: References: NNTP-Posting-Host: mQokHQeKeRC37oD/Mq9UYg.user.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Complaints-To: abuse AT aioe DOT org X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1914 X-Newsreader: Microsoft Outlook Express 6.00.2800.1914 X-Priority: 3 X-MSMail-Priority: Normal To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com "Rob Gaddi" wrote in message news:I6-dnUDsEJnAOebVnZ2dnUVZ_rPinZ2d AT lmi DOT net... > I've written a very short assembler in C for a proprietary microengine > that I'm working on. Like any sensible assembler, it wants to take in > the input filename on the command line, and if no further command line > options are given, make some assumptions based on the input filename as > to what the output filename should be. I drive it from the command > prompt and all is well. I pass it long filenames, it works with long > filenames, and creates outputs with long filenames. Fine, perfect, all > well and good. > > But when I try to drag and drop from Explorer (under XP) onto the .EXE > of the interpreter, for some reason it gets passed the short file name > instead, and I get the appropriately mangled output file names. > Ideally, this wouldn't happen; Although I like Sandmann's solution (Hey, how've you been?), the DJGPP solution would be to call the DOS LFN API (see RBIL, Int 0x21, AX=71xxh). I recently had the opposite problem. I needed SFN's for PKZIP (PKZIPFIX, actually) on XP. My app. (for DJGPP v2.03) calls Int 0x21, AX=71A0h to determine if LFN's are available, then calls Int 0x21, AX=7160h to convert the LFN to SFN. You should be able to call 7160 to convert an SFN to LFN too. 7160 returns the full path (cl=0), short filename (cl=1), or long filename (cl=2). My app. worked on XP SP1 and SP2. I'm not sure about the original version or the new SP3. I previously posted my version of the call to 71A0. My version of 7160 (unposted) does things similarly. http://groups.google.com/group/comp.os.msdos.djgpp/msg/612bfd16d8331af0 Unfortunately, that version doesn't show the #includes, etc. However, I also posted a version for OpenWatcom (w/DJGPP code) to openwatcom.users.c_cpp which is more complete: http://groups.google.com/group/openwatcom.users.c_cpp/msg/a021f62b0571635e > Windows seems happy to pass plenty of > other programs long names from a drag and drop. But it thinks that mine > wants a short name instead. Sorry, I don't use XP regularly, so I don't know what the problem is. Rod Pemberton