|
open the file using CFile
then call "GetLength"
it will give u size in bytes divide it by (1024*1024) ( im not sure this calculation is correct)
SaRath.
"Don't Do Different things... Do Things Differently..."
|
|
|
|
|
SaRath C wrote: open the file using CFile
Not a good idea as Open() is an expensive call, not to mention that it could easily fail if another process has the file open.
"The largest fire starts but with the smallest spark." - David Crow
|
|
|
|
|
|
my code:
BEGIN_EVENTSINK_MAP(CBrowserPage, CDialog)
//{{AFX_EVENTSINK_MAP(CBrowserPage)
ON_EVENT(CBrowserPage, IDC_EXPLORER1, 271 , NavigateError, VTS_DISPATCH VTS_PVARIANT VTS_PVARIANT VTS_PVARIANT VTS_PVARIANT VTS_PVARIANT VTS_PBOOL)
ON_EVENT(CBrowserPage, IDC_EXPLORER1, 252 /* NavigateComplete2 */, OnNavigateComplete2Explorer1, VTS_DISPATCH VTS_PVARIANT)
//}}AFX_EVENTSINK_MAP
END_EVENTSINK_MAP()
OnNavigateComplete2Explorer1 can work,
NavigateError can't work,why?
my ie is 6.0
thanks!
|
|
|
|
|
had got it ,
ON_EVENT(CBrowserPage, IDC_EXPLORER1, 271 , NavigateErrorExplorer1,VTS_DISPATCH VTS_PVARIANT VTS_PVARIANT VTS_PVARIANT VTS_PBOOL)
can work
thanks
|
|
|
|
|
Hi again buddies
Can anyone help me with a couple of questions on CString
i'm trying to use it for the first time
CString str("Ma%"); //CString' : undeclared identifier(i include string)
also how can i convert a string to CString and vice versa
Thanks a lot
|
|
|
|
|
CString is a MFC (or ATL) class. if you don't have a MFC project, you won't see it.
did you create a console project ?
TOXCCT >>> GEII power
[VisualCalc 3.0 updated ][Flags Beginner's Guide new! ]
|
|
|
|
|
U need MFC support for the application.
CString is defined at "Afx.h"
if add support to for MFC, u can simply use the basic mfc classes.
These are the main include files.
#include <afxwin.h> // MFC core and standard components
#include <afxext.h> // MFC extensions
in a normal MFC application, this will be included at "StdAfx.h"
SaRath
"D on't blindly follow rules you read somewhere without verifying that it makes sense for your situation!"
|
|
|
|
|
Converting string to CString
<br />
string stdStr = "Test";<br />
CString strText = stdStr.c_str();<br />
SaRath
"D on't blindly follow rules you read somewhere without verifying that it makes sense for your situation!"
|
|
|
|
|
Thanks for the reply
Yes i'm doing a console application
SARATH can u pls write again the include files that i need to use
the code was cut off
Thanks again
|
|
|
|
|
go to your project settings, add MFC support in it.
then, in your files, #include (before all other includes) the file "stdafx.h" which should have been created in your project.
TOXCCT >>> GEII power
[VisualCalc 3.0 updated ][Flags Beginner's Guide new! ]
|
|
|
|
|
there is a simple method I can suggest.
Create a new console.
at the Application settings, "Support MFC"
copy the code or add teh file u have implemented to this newly created workspace. it will work fine.
that is the better way
the include files are AfxWin.h and afxext.h
SaRath
"D on't blindly follow rules you read somewhere without verifying that it makes sense for your situation!"
|
|
|
|
|
Thanks alot i appreciate all the help
|
|
|
|
|
antonaras wrote: SARATH can u pls write again the include files that i need to use
the code was cut off
They're there:
#include <afxwin.h>
#include <afxext.h>
"The largest fire starts but with the smallest spark." - David Crow
|
|
|
|
|
hi all,
i want to change the open dialog box that is create by MFC,
how can i make the changes to the open dialog box that users ONLY can view the folders and files from the server, so that user just can open the files from that server.
have a nice day
|
|
|
|
|
Sorry I didnt get anything from this question
andy179394 wrote: open dialog box
what is Open dialog box
actually what is the duty of that dialog?
which control u r using to show the files and folder list?
SaRath
"D on't blindly follow rules you read somewhere without verifying that it makes sense for your situation!"
|
|
|
|
|
|
|
andy179394 wrote: how can i make the changes to the open dialog box that users ONLY can view the folders and files from the server...
As opposed to what?
"The largest fire starts but with the smallest spark." - David Crow
|
|
|
|
|
thanks for reply, what i want is when you press the open button from file menu, it will prompt a open dialog box, right. Basically that box can open the files from c or d drives, but now i want that open dialog box display the ftp server files, not the files from the drives.
hope you can get my mean. thx.;)
have a nice day
|
|
|
|
|
You can still use CFileDialog or GetOpenFileName() . It will just require a starting folder. Check out the OPENFILENAME.lpstrInitialDir member variable.
"The largest fire starts but with the smallest spark." - David Crow
|
|
|
|
|
Any expert can help me! how to use c++ to get all the filename from ftp server and use the list box to show all the filename.tytyty
|
|
|
|
|
Using MFC?
"The largest fire starts but with the smallest spark." - David Crow
|
|
|
|
|
ya, get the filename from ftp and put it on list box.tyty
|
|
|
|
|
So why not use MFC's FTP-related classes?
"The largest fire starts but with the smallest spark." - David Crow
|
|
|
|