|
You need to know what the struct is in order to know what it does. the statfs struct must be defined somewhere else for this to do anything. Search MSDN, if it's not there, search your code.
Christian
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
Cats, and most other animals apart from mad cows can write fully functional vb code. - Simon Walton - 6-Aug-2002
|
|
|
|
|
Is the code from an Unix/Linux program? statfs() appears to be a Linux or BSD Unix syscall, on Linux the documentation says:
int statfs(const char *path, struct statfs *buf);
int fstatfs(int fd, struct statfs *buf);
DESCRIPTION
statfs returns information about a mounted file system. path is the
path name of any file within the mounted filesystem. buf is a pointer
to a statfs structure defined as follows:
struct statfs {
long f_type;
long f_bsize;
long f_blocks;
long f_bfree;
long f_bavail;
long f_files;
long f_ffree;
fsid_t f_fsid;
long f_namelen;
long f_spare[6];
};
|
|
|
|
|
Coremn wrote:
Sorry about this, does anyone know what the following code does
DWORD Thing::GetDiviceFreeSpace(LPCTSTR lpszPath)<br /> may very well get a devices free space.
statfs() sounds very much like "STATatus of FileSystem", so this would also fit in.
Third, a search in MSDN showed statfs() to be a "NFS Version 2 RPC Call", the description being 'Get file system attributes'.
Hope this helped
PS. I charge you 30 Dollar for information retrieval service.
|
|
|
|
|
Thanks dudes - it will help
The cheque is in the mail.
---
|
|
|
|
|
Hello all,
Is there anyway to access C++ Library by using Java (Pure Java)? If yes, please give me some instructions.
Thank you very much.
Long Truong
|
|
|
|
|
Aren't you a little bit offtopic here ?
Try this one.
God luck,
And I swallow a small raisin.
|
|
|
|
|
I know that CRichEditCtrl::SetSel(0,-1) will select all text in richedit control. But I don't understand about GetSel(). When I call CRichEditCtrl::GetSel(nStart, nEnd) to get selection range (after I called CRichEditCtrl::SetSel(0,-1)). Why the range is greater than text length.
Example:
- current text is "Hello". (text length = 5)
- then I call CRichEditCtrl::SetSel(0,-1).
- and then I call CRichEditCtrl::GetSel(nStart, nEnd).
- the result is nStart=0 and nEnd=7.
?? Why nEnd is not equal 5? What is the two addition?
|
|
|
|
|
maybe its a 'carriage return\linefeed' pair on the end.
|
|
|
|
|
I have the following encapsulation of a CriticalSection and Lock (out of my school textbook)
class Mutex
{
friend class Lock;
public:
Mutex () { InitializeCriticalSection (& _critSection); }
~Mutex () { DeleteCriticalSection (& _critSection); }
private:
void Acquire ()
{
EnterCriticalSection (& _critSection);
}
void Release ()
{
LeaveCriticalSection (& _critSection);
}
CRITICAL_SECTION _critSection;
};
class Lock
{
public:
// Acquire the state of the semaphore
Lock ( Mutex & mutex )
: _mutex(mutex)
{
_mutex.Acquire();
}
// Release the state of the semaphore
~Lock ()
{
_mutex.Release();
}
private:
Mutex & _mutex;
};
In the mutex class, why is the private member stored by reference? That is the line Mutex & _mutex;
I am asking, coz I used the classes for a school project and missed the &. My program crashed windows and it took me 6 hours to find the missing &! Why is it necessary to store it by reference?
Pankaj
Without struggle, there is no progress
|
|
|
|
|
when you pass an object by value, a copy of the object is created and passed to the function. this object will go out of scope and its destructor will be called, when the function exits.
when you pass by reference, the function uses the original object (via a pointer) and, so the object doesn't go out of scope when the function exits (and the destructor is not called).
a quick glance at your code...
the Mutex destructor deletes the critical section, possibly while some code is using it.
-c
Argue for your limitations, and sure enough, they're yours.
|
|
|
|
|
You should probably add a flag to your Mutex class indicating whether or not the cs has been acquired:
<br />
void Acquire ()<br />
{<br />
if (!bAcquired) <br />
EnterCriticalSection (& _critSection);<br />
else<br />
assert(!"Something is fishy!");<br />
bAcquired = true;<br />
}<br />
<br />
void Release ()<br />
{<br />
if (bAcquired)<br />
LeaveCriticalSection (& _critSection);<br />
else<br />
assert(!"Something is fishy!");<br />
bAcquired = false;<br />
}<br />
Todd Smith
|
|
|
|
|
Build output message "Build : warning : failed to (or don't know how to) build 'D:\SFS\Debug\NMSV3r1.pch'"
I already configure my project correctly, and rebuild all the project,
but still can't complile my project, why?
thanks.
|
|
|
|
|
your pch file should not be part of your project, there is no reason to tell the compiler to try to compile a precompiled header.
Christian
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
Cats, and most other animals apart from mad cows can write fully functional vb code. - Simon Walton - 6-Aug-2002
|
|
|
|
|
How do I access the web with a CButton?
Out
Nay20
|
|
|
|
|
Huh?
I think you need to be more clear with your question.
Do you want to just open a web page or what?
Jason Henderson start page articles "If you are going through hell, keep going." - Sir Winston Churchill
|
|
|
|
|
Does anyone know if there's an easy (or even possible way) to convert a CString object to a CTime object?
Any help would be much appreciated.
Monrobot13
|
|
|
|
|
Use COleDateTime::ParseDateTime() then construct a CTime using the hours, minutes, and seconds.
Jason Henderson start page articles "If you are going through hell, keep going." - Sir Winston Churchill
|
|
|
|
|
Hi monrobot13
In my project i am using like this,
if you find a better way than this inform to me.
-------------------------------------------------
CTime StrToDate(char * buffer)//char *buffer CString object
{
int dd,mm,yy,H,M,S;
dd=0;mm=0;yy=0;H=0;M=0;S=0;
CString stemp;
stemp.Format("%c%c",buffer[0],buffer[1]);//date
dd=atoi(stemp);
stemp.Format("%c%c",buffer[3],buffer[4]);//month
mm=atoi(stemp);
stemp.Format("%c%c",buffer[6],buffer[7]);//Year
yy=atoi(stemp);
yy=yy+2000;
stemp.Format("%c%c",buffer[9],buffer[10]);//Hour
H=atoi(stemp);
stemp.Format("%c%c",buffer[12],buffer[13]);//Minute
M=atoi(stemp);
stemp.Format("%c%c",buffer[15],buffer[16]);//Seconds
S=atoi(stemp);
CTime time(yy,mm,dd,H,M,S);
return time;
--------------------------------------------------
anju
|
|
|
|
|
I'm adding images (through an image list which gets the images from icons in my resources) into the columns of my report-style list control, but the images are never transparent, even though I'm using the screen color in my icons, and I specified ILC_MASK when I created my image list.
What am I doing wrong?
Thanks!
|
|
|
|
|
I want to monitor my computer's share directory in the LAN, when some files are deleted or renamed or modified by other computer. I can recored it.
but I don't know all this being done by which computer! How can i do it ?
Thanks a lot!
How can I know which remote computer access which file of my computer?
How can I finished it with MFC or VC?
|
|
|
|
|
Hi there,
Is there anyway to send mail without using Oulook ???
Could you show me example, please ?
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
http://www.codeproject.com/internet/cmapi.asp
Argue for your limitations, and sure enough, they're yours.
|
|
|
|
|
Thanks again !
Your helps are always useful for me
Regards
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
Hello Mr.Cheris,
I have problem in using CMapiMessage and CMapiSession classes ...
Please help me ...
It's an example of CMapi classes:
CMapiMessage message;
message.m_To.Add(_T("pjn@indigo.ie"));
message.m_CC.Add(_T("SMTP:pjn@indigo.ie"));
message.m_BCC.Add(_T("SMTP:pj.naughter@softech-telecom.com"));
message.m_sSubject = _T("Demo email using CMapiSession - Please ignore");
message.m_sBody = _T("This is the body of the message\r\nRegards,\r\nCMapiMessage");
message.m_Attachments.Add(_T("C:\\autoexec.bat"));
message.m_AttachmentTitles.Add(_T("my autoexec.bat"));
//Setup the mapi session
CMapiSession session;
BOOL bMapiInstalled = session.MapiInstalled();
//Logon to MAPI
BOOL bLoggedOn = session.Logon(_T("PJ Naughter")); //You will need to change this to use a MAPI profile
//setup on your computer. If you want CMapiSession to
//bring up a dialog to allow a MAPI profile to be
//interactively chosen, then you will need to create
//a Window in your app using the normal MFC mechanims
if (bLoggedOn)
{
//Send the message
BOOL bSent = session.Send(message);
}
First question: Where i should specify Mail Sender in CMapiMessage class ???
Second question: I can't understand what is CMapiSession::Logon function ?
What it do exactly ?
Please help me ...
Regards
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
try asking this on the article that you got the code from, maybe the author can help - i don't know anything about htis calss myself.
-c
Argue for your limitations, and sure enough, they're yours.
|
|
|
|