Hi,
Just a follow up. I noticed that if i pass a value
by reference in the time(), the number of seconds gets
correctly saved in it.
Cheers,
Stan
--- stan lee <[EMAIL PROTECTED]> wrote:
> Hi,
>
> Is the time function still incomplete? The value I
> always get is zero even though the system time in my
> device is set correctly.
>
> Here is my simple program that converts the value
> returned by time to widechar and prints it in a
> messagebox:
>
> #include <windows.h>
> #include <sstream>
>
> int WinMain(HINSTANCE hInstance, HINSTANCE
> hPrevInstance, LPWSTR lpCmdLine, int nCmdShow)
> {
>
> std::stringstream ss;
> std::string str;
> ss << time(NULL);
> ss >> str;
>
> char* myStr=new char[100];
> strcpy(myStr,str.c_str());
> int length = strlen(myStr)+1;
> WCHAR* myWide = new WCHAR[length];
>
>
MultiByteToWideChar(CP_ACP,0,myStr,-1,myWide,length);
>
> MessageBoxW(0, myWide, L"H3LLO!", 0);
> delete myWide;
> delete myStr;
> return 0;
> }
>
> Cheers,
> Stan
>
>
>
>
____________________________________________________________________________________
> Park yourself in front of a world of choices in
> alternative vehicles. Visit the Yahoo! Auto Green
> Center.
> http://autos.yahoo.com/green_center/
>
>
-------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2
> express and take
> control of your XML. No limits. Just data. Click to
> get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> Cegcc-devel mailing list
> [email protected]
>
https://lists.sourceforge.net/lists/listinfo/cegcc-devel
>
____________________________________________________________________________________
Take the Internet to Go: Yahoo!Go puts the Internet in your pocket: mail, news,
photos & more.
http://mobile.yahoo.com/go?refer=1GNXIC
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Cegcc-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/cegcc-devel