Click here to Skip to main content
16,016,022 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralPassing a BSTR parameter into a COM method. Pin
abhinarulkar3-Mar-03 23:22
abhinarulkar3-Mar-03 23:22 
GeneralRe: Passing a BSTR parameter into a COM method. Pin
Stefan Spenz3-Mar-03 23:36
Stefan Spenz3-Mar-03 23:36 
GeneralProblem in Dialog controls(MFC) Pin
summo3-Mar-03 23:22
summo3-Mar-03 23:22 
GeneralRe: Problem in Dialog controls(MFC) Pin
Stefan Spenz3-Mar-03 23:41
Stefan Spenz3-Mar-03 23:41 
GeneralViewing .NET Build Log During Compile Pin
[DAve]3-Mar-03 23:06
[DAve]3-Mar-03 23:06 
Generalstrange behaviour of my app Pin
r i s h a b h s3-Mar-03 23:01
r i s h a b h s3-Mar-03 23:01 
GeneralRe: strange behaviour of my app Pin
vikramlinux3-Mar-03 23:09
vikramlinux3-Mar-03 23:09 
GeneralRe: strange behaviour of my app Pin
r i s h a b h s4-Mar-03 0:34
r i s h a b h s4-Mar-03 0:34 
following is the piece of code
(i check File Modification Time Of a File With Another Time which comes from an INI File and return TRUE / FALSE accordingly)

BOOL CreateTasks()
{
BOOL bret;
DWORD dwError;
CErrorLog oErr;
CConfig oConf;
CString sTCDate(oConf.GetTaskCreationStamp());
int len = sTCDate.GetLength();
if ( len = 12 )
{
SYSTEMTIME stTCStamp;
FILETIME ftTCStamp;
try
{
stTCStamp.wYear = (WORD)atol (sTCDate.Mid (0,4) );
stTCStamp.wMonth = (WORD)atol( sTCDate.Mid (4,2) );
stTCStamp.wDay = (WORD)atol(sTCDate.Mid (6,2) );
stTCStamp.wHour = (WORD)atol(sTCDate.Mid (8,2) );
stTCStamp.wMinute = (WORD)atol( sTCDate.Mid (10,2) );
stTCStamp.wSecond =0;
stTCStamp.wMilliseconds =0;
//stTCStamp.wDayOfWeek = 2;
//bret = SystemTimeToTzSpecificLocalTime(NULL, &stTCStamp, &stTCStamp);
bret = SystemTimeToFileTime(&stTCStamp , &ftTCStamp);
dwError = GetLastError();

FILETIME ftModTime;
CString filename = oConf.InputFilePath();
filename.ReleaseBuffer();
HANDLE hFile = CreateFile(filename,GENERIC_READ,FILE_SHARE_READ | FILE_SHARE_WRITE,0,OPEN_EXISTING,0,0);
bret = GetFileTime(hFile,NULL,NULL, &ftModTime);
bret = FileTimeToSystemTime(&ftModTime , &stTCStamp);
bret = SystemTimeToTzSpecificLocalTime(NULL, &stTCStamp, &stTCStamp);
bret = CompareFileTime(&ftTCStamp, &ftModTime);
dwError = GetLastError();
CloseHandle(hFile);
}
catch(...)
{
oErr.LogErrors(-1, "Exception Occurred While Comparing Modification Time For Input File With Value In Config File. Deleting And Re-Creating Tasks.");
return false;
}
}
else
{
oErr.LogErrors(-1, "Invalid Value Specified For TimeStamp In Config File. Deleting And Re-Creating Tasks."); return FALSE;
}
if (bret < 0)
{
oErr.LogErrors(-1, "Input File Modified. Re-Creating Tasks.");
return FALSE;
}
else
{
oErr.LogErrors(-1, "\n\r\nInput File UnModified. Tasks Not Re-Created.\n\r\n*********************************************************\n\r\n");
return TRUE;
}
}


sorry for the indentation
but i get error where function returns TRUE (last 3rd line of the code)

i hope now u can help me out

regards
GeneralOpen directory dialog with MFC Pin
Bounlith3-Mar-03 21:26
Bounlith3-Mar-03 21:26 
GeneralRe: Open directory dialog with MFC Pin
Kannan Kalyanaraman3-Mar-03 21:41
Kannan Kalyanaraman3-Mar-03 21:41 
GeneralRe: Open directory dialog with MFC Pin
Rage3-Mar-03 21:44
professionalRage3-Mar-03 21:44 
GeneralRe: Open directory dialog with MFC Pin
Bounlith3-Mar-03 22:12
Bounlith3-Mar-03 22:12 
GeneralCreation of User DSN Pin
RaajaOfSelf3-Mar-03 20:53
RaajaOfSelf3-Mar-03 20:53 
GeneralRe: Creation of User DSN Pin
HJo3-Mar-03 21:53
HJo3-Mar-03 21:53 
GeneralRe: Creation of User DSN Pin
RaajaOfSelf3-Mar-03 22:47
RaajaOfSelf3-Mar-03 22:47 
GeneralRe: Creation of User DSN Pin
Bartosz Bien4-Mar-03 12:21
Bartosz Bien4-Mar-03 12:21 
Generaludp packet Pin
summo3-Mar-03 20:12
summo3-Mar-03 20:12 
GeneralRe: udp packet Pin
Mike Nordell4-Mar-03 0:26
Mike Nordell4-Mar-03 0:26 
Generalcombo box item selection Pin
Arungs3-Mar-03 19:30
Arungs3-Mar-03 19:30 
GeneralProblems with a check box Pin
MaTrIX2k23-Mar-03 19:08
MaTrIX2k23-Mar-03 19:08 
GeneralRe: Problems with a check box Pin
Alvaro Mendez4-Mar-03 11:14
Alvaro Mendez4-Mar-03 11:14 
GeneralRe: Problems with a check box Pin
MaTrIX2k24-Mar-03 14:41
MaTrIX2k24-Mar-03 14:41 
Generalhandel and window Pin
aguest3-Mar-03 12:29
aguest3-Mar-03 12:29 
GeneralRe: handel and window Pin
Dave Bryant3-Mar-03 12:39
Dave Bryant3-Mar-03 12:39 
GeneralHELP! Parent-Child Thread Data Problem Pin
Ecom Wang3-Mar-03 12:25
sussEcom Wang3-Mar-03 12:25 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.