|
If I want to get the actual time(as in what is is now) then I should divide by what number???
|
|
|
|
|
here is a link to msdn that has same source
MSDN[^]
they use _time64 instead of time, but it pretty much the same thing. I'm not sure what format you want your time in, so i don't know what mean by divide by what number.
eg : ctime( &clock)
will return a string of the the date/time in the variable clock
struct tm *today;
localtime( &clock );
today is a structure that will hold the date/time as numbers.
eg today->tm_hour
today->tm_min
today->tm_sec
|
|
|
|
|
I have a weak understand of this. I don't quite grasp where I use today. Or how I actually get the local time and turn it into numbers. The way we just did it(before this part) gave me just like you said the number of seconds passed since Jan 1 1970.
With this particular way the time is made into a char. I tried just making it an int. The complier gave me an error and wouldn't let me do it.
|
|
|
|
|
Be aware that time() and time_t will fail in 2038. To avoid getting accustomed to these functions, either use _time64() and __time64_t or GetSystemTime() and then convert it to a 64 bit value using SystemTimeToFileTime() .
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
Thank you for your input I did read that. But for this project I don't really need to worry about that. Does anyone know of a parse that I could do or something similar so I can convert time characters to numbers.
|
|
|
|
|
I am taking std::map which maps CString to CList.
Can somebody help me how to iterate through .
I did a similar example using CMap that maps CString to CString.
Pls guide.
|
|
|
|
|
this is just an example
typedef map <cstring *,clist="" *=""> StrToListMap;
StrToListMap _stlMap;
StrToListMap ::iterator mapIterator;
mapIterator = stlMap.begin();
while(mapIterator != stlMap.end())
{
CString *pString = ((*mapIterator).first);
CList *pList = ((*mapIterator).second);
mapIterator++;
}
hope that helps
|
|
|
|
|
I'm trying to make a program that gets told what size the dialog box needs to be, and the position on screen.
but i found that it is hard coded in .rc files. which isn't good at all for me.
i need to create a dialog box on the fly, have it a certain size, and have buttons that i create.
it all seems to have to be hard coded in and can't be done the way i want. any way around this?
|
|
|
|
|
Xp3ll3d wrote:
have it a certain size
When you want to show your dialog, just before calling DoModal, call MoveWindow (this will move the window but the x and y coordinates are relative to the parent window, so you will probably need to convert it).
Xp3ll3d wrote:
have buttons that i create
In your OnInitDialog function (from your dialog box), you can create dynamically your buttons if you want.
Hope this helps
|
|
|
|
|
it does, thanks alot!!
now i'll go have a look around for those methods
|
|
|
|
|
I am looking for a class(es) that implement a TV guide style infterface. Not quite like a grid, since all the cells in verious lines start and end on arbitrary boundaries. Anybody seen anything like that?
|
|
|
|
|
Is there such a message I can handle?
I have a derived CEdit class and I need to know when a user has set the text programatically...I have tried WM_SETWINDOWTEXT and I get an compile error: undeclared identifier
I have tried capturing WM_SETTEXT also and it doesn't work...
Anyone have ideas...?
How do I print my voice mail?
|
|
|
|
|
I just handled WM_SETTEXT inside WndProc instead of PreTranslateMessage
Everything works fine now
Cheers
How do I print my voice mail?
|
|
|
|
|
Hi people,
Probably an easy question but its really frustating me.
Im trying to add an active X control to a VC project but it just wont let me.
In fact it wont let me add any type of control to a dialog. (Including standard ones)
I try and add an evemt handler and it gives me
Line 327
Char 4
Error Can't move focus to to the control because it is invisible, not enabled or of a type that does not accept the focus.
The annoying things is it works in all other projects . Its just that where I want it to work it wont, but I can't see the difference between the current project and the other projects.
I would really appreciate any help.
(This is in VS.NET)
Thanks.
|
|
|
|
|
This does not sound like a C++ error message.
I had this message text once only when I was using
Visual Basic?
Are you sure you are using VC++?
Or maybe this message comes from the ActiveX itself?
Jens
|
|
|
|
|
Hi
When i read the returned data from the server in data chunks of 2048 size it is appending the server URL with each chunk read.I have the code like:
m_strResponseData.Empty();
do
{
memset(szBuf,0x00,sizeof(szBuf));
nBytesRead = pHttpFile->Read((void*) szBuf, CHUNK_SIZE);
m_strResponseData += szBuf;
if(nBytesRead < CHUNK_SIZE)
break;
}while(nBytesRead == CHUNK_SIZE);
But when i run this program in debug mode it is not appending any URL in the data returned but in release mode it is appending the server URL in each chunk read. I don't want server URL with every chunk size read.
Can any body tell me how is it appending the server URL with the data I read from the server.
Thanks
Shailesh
|
|
|
|
|
aman2006 wrote:
m_strResponseData += szBuf;
That's the problem. szBuf is usually not going to be zero-terminated, but you're treating it like it is. You're seeing the server URL in there because that just happens to be in memory right after the buffer. Change it to:
m_strResponseData += CString ( (LPCSTR) szBuf, nBytesRead );
--Mike--
Personal stuff:: Ericahist | Homepage
Shareware stuff:: 1ClickPicGrabber | RightClick-Encrypt
CP stuff:: CP SearchBar v2.0.2 | C++ Forum FAQ
----
#include "witty-quote.h"
|
|
|
|
|
Thanks Mike u r rock, but i want to ask u why it is giving the right data without http in debug mode.
thanks
shailesh
|
|
|
|
|
|
I have found the IsValidURL inside MSDN, but I havne't found anything for email validation. Does anyone know of code kicking around anywhere that will validate emails?
I can't depend on regex or anything...
Thanks
How do I print my voice mail?
|
|
|
|
|
I am a beginer in Visual C++ and I want to build my own class Fruits .Anybody can help me with free code
|
|
|
|
|
class CFruits {
};
Could you be more specific?
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Pure elegance! 5!
Glano perictu com sahni delorin!
|
|
|
|
|
How can I build the graph of function a*x*x+b*x+c=0
|
|
|
|
|
I thought this was a repost. Try putting the actual question in the header. What if every post here had 'how can I' in the header ?
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|