Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
S

Sousch

@Sousch
About
Posts
2
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Best way to duplicate a file?
    S Sousch

    The error consists on an error box saying that it didn't find a file without a name (not exactly in those words because my OS is in spanish language, but that's basically what it says). I've also tried the CopyFile option without success. I have to include "Windows.h" with the headers, include Kernel32.lib in my project settings, and then i would have to put something like this: CopyFile('default.wav',PChar(strFile),TRUE); (am i right?) but it gives "error C2015: too many characters in constant" and error "C2065: 'PChar' : undeclared identifier" Well, i think it it is a little bit too late for me:zzz:. Tomorrow I will keep trying to find a solution.:)

    C / C++ / MFC help question

  • Best way to duplicate a file?
    S Sousch

    Hello, I'm having a problem when I try to save a file in a different directory (let's say that I simply want to duplicate the file). I have a "default.wav" in my directory and I use a dialog to save it (duplicate it) in another directory with a different name. This is my code: ============ CString strFile; (...) strFile = dlg.GetPathName(); (...) CFile file_orig,file_dest; char *pBuffer; (...) <- part that creates "default.wav" in the same directory file_orig.Open("default.wav", CFile::modeRead); int length = file_orig.GetLength(); // <<<<< here is the problem !! pBuffer = (char*)malloc(length); file_orig.Read(pBuffer, length); file_orig.Close(); file_dest.Open( strFile, CFile::modeCreate|CFile:: modeReadWrite); file_dest.Write(pBuffer, file_orig.GetLength()); file_dest.Close(); free(pBuffer); ============== Any solution that works can be valid (without including aditional libraries if possible). I just want to keep it as simple as possible. Thanks in advance! :)

    C / C++ / MFC help question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups