www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/02/25/06:45:22

From: Pete Nelson <dieter AT minn DOT net>
Newsgroups: comp.os.msdos.djgpp
Subject: Long filenames - where are they stored?
Date: Tue, 24 Feb 1998 22:51:27 -0600
Organization: MinnNet Communications, Inc.
Lines: 38
Message-ID: <34F3A34F.59C9F116@minn.net>
NNTP-Posting-Host: dialup-tc2-6.minn.net
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

I'm having a world of trouble.

Basically, I'm trying to build a program that takes a DOS filename, and
spits out a URL.
The trouble is that I want this to be able to support 'drag-n-drop'.
Unfortunatly, Windows hands the ol' 8.3 DOS filename to the program -
and that's not what I want.

Here's what I have now:

//  to_url.cpp

#include <stdlib.h>
#include <iostream.h>
#include <stdio.h>
#include <string.h>

int main(int argc, char *argv[]) {
  char String[512];
  char *cptr;
  if(argc>0) {
     strcpy(String, argv[1]);
   cptr=String;
   while(*cptr!='\0') {
     if(*cptr==':') *cptr='|';
     if(*cptr=='\\') *cptr='/';
     *cptr++;
     }
   *cptr='\0';
   cout << "file:///" << String;
   }
 return(0);
}


 Works well from the command line.  Now how do I redirect it to grab the
32bit filename on a 'drag-n-drop'?

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019