🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #7455

Passing a Variable to CopyFile

#7455
From: Pat
Date: Mon, 31 Jan 2005 16:04
29 lines
1966 bytes
Hello I am trying to write an App in which the user can pass a Variable from 
a DriveComboBox to copy a file from a specific location.  Getting the 
copyfile setup is easy enough but I can't seem to get the variable inserted. 
The destination will (usually) be the root so at this point I don't need to 
worry about assigning a folder etc.

The error message I get is  "Cannot convert 'AnsiString' to 'char *'" or 
something to that effect depending on whether I try AnsiSting drive or char 
drive.

Thanks for any help can send my way.


    }
     char drive;   //I've also tried AnsiString with errors
     drive = DriveCombo->Drive;

      char *From = "C:\\Backup\\Data\\*.zip\0";
      char *To = "E:\\\0";    // <-Need to be able to define the drive here
      SHFILEOPSTRUCT op;
      ZeroMemory(&op, sizeof(op));
      //op.hwnd  = Handle;
      op.wFunc = FO_COPY;
      op.pFrom = From;
      op.pTo   = To;
      op.fFlags = FOF_NOCONFIRMATION;
      SHFileOperation( &op);

} 
Technical Details
Message-ID: <41fe59c2$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!news2.euro.net!216.196.110.149.MISMATCH!border2.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,c07811462fe8d980,start
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Pat" <pclancy@sasktel.net>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Passing a Variable to CopyFile
Date: Mon, 31 Jan 2005 10:04:07 -0600
Lines: 31
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: 142.165.107.104
Message-ID: <41fe59c2$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1107188162 142.165.107.104 (31 Jan 2005 08:16:02 -0800)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!news2.euro.net!216.196.110.149.MISMATCH!border2.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail