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
Cegcc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cegcc-devel

Reply via email to