Re: trouble converting CFileDialog to CFile to get size
From: Arnaud Debaene (adebaene_at_club-internet.fr)
Date: 10/20/04
- Next message: Kalevet: "Re: Reasons for an exception thrown at "new""
- Previous message: Pieter de Goeje: "RE: Dll's and global data sharing, Please give your views"
- In reply to: Wayne...: "trouble converting CFileDialog to CFile to get size"
- Next in thread: Wayne...: "Re: trouble converting CFileDialog to CFile to get size"
- Messages sorted by: [ date ] [ thread ]
Date: 20 Oct 2004 08:24:21 -0700
"Wayne..." <w.robson@oneteldsl.net> wrote in message news:<4173c494@212.67.96.135>...
> I am trying to get teh size of a file that will be opened using CFileDialog
> class, The trouble is it complains the moment I try the following
> m_FilePacked = GetFileSize(ldFile);
You don't give us enough information to be of any help :
- What is ldFile?
- In which context (function) are you writing this line of code?
GetFileSize takes an handle to a file handle (type HANDLE) opened
through CreateFile as it's first parameter. From your description, I
believe ldFile is either a CFileDialog or a CString (result from
CFileDialog::GetFileName). In both cases, it is totally unrelated to a
file handle.
Concerning your remark "To a learner it does seem somewhat strange
that GetFileSize() is not easily available from a CFileDialog". What
do you mean exactly? The aim of CFileDialog is to return the *name* of
a file (as a CString). This is totally unrelated to GetFileSize or to
the size of any file altogether.
Arnaud
MVP - VC
- Next message: Kalevet: "Re: Reasons for an exception thrown at "new""
- Previous message: Pieter de Goeje: "RE: Dll's and global data sharing, Please give your views"
- In reply to: Wayne...: "trouble converting CFileDialog to CFile to get size"
- Next in thread: Wayne...: "Re: trouble converting CFileDialog to CFile to get size"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|