|
Then I suggest you download[^] a copy
Waldermort
|
|
|
|
|
emilio_grv wrote: By reading all the 10000 pages...
No, just the ones up to the function that you are interested in. All the pages after that do not need to be read, unless you just wanted to.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi, here is another option
BOOL IsDirectory(TCHAR *szPath)
{
BOOL bRet = FALSE;
DWORD dwResult = GetFileAttributes(szPath);
if(dwResult != 0xffffffff && (dwResult & FILE_ATTRIBUTE_DIRECTORY))
{
bRet = TRUE;
}
return bRet;
}
Best Wishes,
-Randor (David Delaune)
|
|
|
|
|
DWORD dwFileAttrib = 0;
dwFileAttrib = GetFileAttributes(pathof Directory);
if(dwFileAttrib == -1 || (dwFileAttrib & FILE_ATTRIBUTE_DIRECTORY) == 0)
{
AfxMessageBox("Directory path not exist");
}
kamalesh
|
|
|
|
|
Karismatic wrote: I have to validate the path of a directory...
What does "validate" mean? Are you wanting to check if it has invalid characters, or whether it exists?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi All,
I have an application in which i need to know when the user has plugged in or plugged out the ethernet cable to the system.
I have the adapter information within my application.
I tried using the device change notification with Registering the notification giving the guid for lan class. But this helps only when i either enable or disable the land adapter from my device manager.
Please help or provide pointers to some link.
Thanks in advance.
Sunil
|
|
|
|
|
Does this help any? What about the ISensNetwork interface?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi all,
The Id IID_IConverterSession appears as unresolved external symbol how did that happen? Plus can anyone help me get my code right i am a super beginner at this.
Many thanks,
Jj
HRESULT hResult;
WORD wKey = 0;
LARGE_INTEGER liZero = { 0 };
LPSTREAM pTNEFStream = NULL;
LPITNEF pTNEFObj = NULL;
CLSID clsid;
LPMSGSESS pMsgSession = NULL;
IMalloc *m_pMalloc;
IStorage *pStorage = NULL;
MAPIINIT_0 MInit;
MInit.ulVersion = MAPI_INIT_VERSION;
MInit.ulFlags = 0;
hResult = MAPIInitialize(NULL);
if (hResult !=S_OK){
throw(HResultException("MapiInit ResolveMsg",0));
}
IMessage* imessage;
HRESULT hr = S_OK;
hResult = ::OpenIMsgOnIStg(pMsgSession,MAPIAllocateBuffer,MAPIAllocateMore,MAPIFreeBuffer,m_pMalloc,0,
pStorage,0, 0, 0, &imessage);
if (hResult !=S_OK){
throw(HResultException("OpenIMsgOnIStg ResolveMsg",0));
}
IConverterSession* pConverterSession;
hResult = CoCreateInstance(clsid, NULL, CLSCTX_INPROC_SERVER, IID_IConverterSession, (void **) &pConverterSession);
if (hResult !=S_OK){
throw(HResultException("Cancel ResolveMsg",0));
}
pConverterSession->SetEncoding(IET_QP);
pConverterSession->SetSaveFormat(SAVE_RFC822);
hResult = pConverterSession->MAPIToMIMEStm(LPMESSAGE(msgName.c_str()), LPSTREAM(imessage), CCSF_SMTP);
if (hResult !=S_OK){
throw(HResultException("MAPIToMIMEStm ResolveMsg",0));
}
}
::MAPIUninitialize();
|
|
|
|
|
Maybe you need to import a lib file.
|
|
|
|
|
monsieur_jj wrote: i am a super beginner at this.
So why in the world would you be starting off with a COM project? If you don't yet have the basics mastered, why make matters worse with COM, and MAPI atop that?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
how to change bitmap in on toolbar button??
There Is Nothing Right & Wrong
|
|
|
|
|
|
Hi
In my VC++ Socket programme I can connect to another system and transfer the data between them, the system are connected through LAN.
I want to know how can communicate with another system through Internet by socket programme(with out LAN ,through Internet).
(Like Server running in anywhere and client was Running anywhere they are connect through internet by Socket programme)
Regards
shakumar
shakumar
|
|
|
|
|
It should work exactly the same - your connect() call can specify 'www.codeproject.com' just as easily as it can specify '192.168.0.5' - if this does not seem to work, perhaps a small code sample showing how you try to connect to the remote server would help us see where the problem lies?
|
|
|
|
|
You shouldn't be facing any problem to connect to the Internet Server. But to Retrive or to send the Data on the Internet server you need to follow the Http protocol. that mean you first need to send the Http Header. That depends on the metod you are using. There are two Methods in Http, Http POST and Http GET.
Try to find out the header for that and Send it Before you send the data.
The Sample Header is as Follow. Try it if it works
"POST / HTTP/1.0\n
Accept: image/gif, image/x-xbitmap, */*\n
Accept-Language: en-us\n
Accept-Encoding: gzip, deflate\n
User-Agent: Mozilla/4.0\n
Host: WWW.CODEPROJECT.COM\n
Content-Type: application/x-www-form-urlencoded"
|
|
|
|
|
This time is measured in the number of seconds elapsed since 00:00:00 January 1, 1970, Universal Coordinated Time.
TimeGenerated = 1183355639
So how do I get it to the correct time??
Many thanks
Regards,
The only programmers that are better that C programmers are those who code in 1's and 0's
Programm3r
My Blog: ^_^
|
|
|
|
|
I'm guessing you have it as a time_t? Use localtime() to convert to a tm struct which has members for hour seconds etc
|
|
|
|
|
Hi,
I'm making use of the following:
typedef struct _EVENTLOGRECORD {
...
DWORD TimeGenerated;
...
}
Thus the following won't work
TimeGenerated = pevlr->TimeGenerated;
newtime = localtime( TimeGenerated );
How can I convert it?
Many thanks in advance
Regards,
The only programmers that are better that C programmers are those who code in 1's and 0's
Programm3r
My Blog: ^_^
|
|
|
|
|
|
what are the functions you are using to retrieve this number?
|
|
|
|
|
chandu004 wrote: what are the functions you are using to retrieve this number?
ReadEventLog() and then I'm making use of the struct EVENTLOGRECORD *pevlr; (pevlr->TimeGenerated;)
Regards,
The only programmers that are better that C programmers are those who code in 1's and 0's
Programm3r
My Blog: ^_^
|
|
|
|
|
In VC++ I use:
void CMyDoc::FormatTime ()
{ CTime time = CTime::GetCurrentTime();
CString szStartTime = time.Format ( "%A, %d.%B.%Y, %H:%M:%S" );
//Do whatever you want
return;
}
On the other hand... you can always make the conversion by yourself.
60 * 60 * 24 * 365 = 31536000 // Seconds in a year
60 * 60 * 24 = 86400 // Seconds in a day
3600 // Seconds in an hour
...............
TimeGenerated = 1183355639
int years = TimeGenerated / 31536000;
int rest1 = TimeGenerated % 31536000;
int day = rest1 / 86400;
int rest2 = rest1 % 86400;
and so on...
To get month, day of the week and other things you can work in a similar way.
I hope it helps
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
|
|
|
|
|
.h file........................
#if !defined(AFX_STREAM_H__76EBFBD3_73B0_11D7_9C8F_0050BA3C5F89__INCLUDED_)
#define AFX_STREAM_H__76EBFBD3_73B0_11D7_9C8F_0050BA3C5F89__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
class CStream:public CObject
{
public:
CStream();
CStream(CString &strName,CString &strAge,CString &strDep,CString &strNo);
virtual ~CStream();
CString m_strName;
CString m_strAge;
CString m_strDep;
CString m_strNo;
};
class CStreams:public CList<cstream*,cstream*>
{
public:
CStream * Find(CString& sIDStream);
CStreams();
virtual ~CStreams();
void AddStream(CString& sName, CString& sAge,CString &sDep,CString &sNo);
};
#endif // !defined(AFX_STREAM_H__76EBFBD3_73B0_11D7_9C8F_0050BA3C5F89__INCLUDED_)
THIS R THE ERRORS I GOT PLEASE HELP ME
i have given the implementation in .cpp file also...........
this r the errors.............
Compiling...
CStream.cpp
e:\getstart\cllectdlg\cstream.h(27) : error C2504: 'CList' : base class undefined
e:\getstart\cllectdlg\cstream.h(27) : error C2143: syntax error : missing ',' before '<'
e:\getstart\cllectdlg\cstream.h(27) : error C2059: syntax error : '<'
E:\GetStart\Cllectdlg\CStream.cpp(61) : error C2065: 'AddTail' : undeclared identifier
Error executing cl.exe.
Cllectdlg.exe - 4 error(s), 0 warning(s)
|
|
|
|
|
Did you include the header file of CList ?
|
|
|
|