Click here to Skip to main content
15,890,825 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: text file as custom resource Pin
S Douglas2-Jan-07 19:53
professionalS Douglas2-Jan-07 19:53 
AnswerRe: text file as custom resource Pin
Cristian Amarie3-Jan-07 10:40
Cristian Amarie3-Jan-07 10:40 
QuestionGetSystemTime Pin
abhiramsss2-Jan-07 12:10
abhiramsss2-Jan-07 12:10 
AnswerRe: GetSystemTime Pin
Michael Dunn2-Jan-07 14:55
sitebuilderMichael Dunn2-Jan-07 14:55 
AnswerRe: GetSystemTime Pin
kasturi_haribabu2-Jan-07 19:46
kasturi_haribabu2-Jan-07 19:46 
Questionhow to copy or duplicate the content of a view or a control? Pin
Arris742-Jan-07 11:44
Arris742-Jan-07 11:44 
AnswerRe: how to copy or duplicate the content of a view or a control? Pin
John R. Shaw2-Jan-07 12:17
John R. Shaw2-Jan-07 12:17 
Questionstrstr error Pin
dellthinker2-Jan-07 11:39
dellthinker2-Jan-07 11:39 
Hi all. I've found out how to keep a function from repeating the same string over and over. But i have another challenge. I was wondering if i could pick out certain chars etc. So i decided to play with strstr. But i have 2 errors. Here a sample code of the time function im using.

<br />
#include <time.h><br />
#include <windows.h><br />
#include <fstream><br />
using namespace std;<br />
<br />
int main (){<br />
	char olddate[9] = {0}, oldtime[9] = {0};<br />
	while(1){<br />
		Sleep(300);<br />
		char date [9];<br />
		char time [9];<br />
		_strdate(date);<br />
		_strtime(time);<br />
		bool fNewDate = strcmp(date, olddate) != 0;<br />
		bool fNewTime = strcmp(time, oldtime) != 0;<br />
		if(fNewDate || fNewTime){<br />
			ofstream file1;<br />
			file1.open("time.txt",ios::app);<br />
			if(strstr(fNewDate,"1/13/07"){<br />
				file1 << "[Date]: " << date << endl;<br />
				strcpy(olddate, date);<br />
			}<br />
			if(strstr(fNewTime,"5:30"){<br />
				file1 << "[Time]: " << time << endl;<br />
				strcpy(oldtime, time);<br />
			}<br />
			file1.close();<br />
		}<br />
	}<br />
	return 0;<br />
}<br />


The idea is to match a string like "1/13/07" with another string from the time function and save to the file. But instead i get 2 errors.

<br />
error C2664: 'strstr' : cannot convert parameter 1 from 'bool' to 'const char *'<br />
        Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast<br />


Any suggestions?
AnswerRe: strstr error Pin
John R. Shaw2-Jan-07 11:52
John R. Shaw2-Jan-07 11:52 
AnswerRe: strstr error Pin
Hamid_RT2-Jan-07 17:11
Hamid_RT2-Jan-07 17:11 
Question32 x 32 Icons in ListView in Report mode Pin
Waleed Eissa2-Jan-07 11:25
Waleed Eissa2-Jan-07 11:25 
AnswerRe: 32 x 32 Icons in ListView in Report mode Pin
Michael Dunn2-Jan-07 14:58
sitebuilderMichael Dunn2-Jan-07 14:58 
QuestionSet second display as attached in win32 Pin
Oskars2-Jan-07 11:05
Oskars2-Jan-07 11:05 
AnswerRe: Set second display as attached in win32 Pin
Jun Du2-Jan-07 11:33
Jun Du2-Jan-07 11:33 
Question__non_rtti_object Pin
mostafa_pasha2-Jan-07 10:46
mostafa_pasha2-Jan-07 10:46 
QuestionIP TO COUNTRY Pin
Daniel Kanev2-Jan-07 8:32
Daniel Kanev2-Jan-07 8:32 
AnswerRe: IP TO COUNTRY Pin
Graham Bradshaw2-Jan-07 8:58
Graham Bradshaw2-Jan-07 8:58 
AnswerRe: IP TO COUNTRY Pin
ThatsAlok2-Jan-07 18:42
ThatsAlok2-Jan-07 18:42 
QuestionHow to -- get a pointer to INetConnectionCommonUi in netcon.h Pin
werpa2-Jan-07 6:14
werpa2-Jan-07 6:14 
Questionwhat is the meaning of this expression int *(*table())[30]; Pin
Ayman Mashal2-Jan-07 4:31
Ayman Mashal2-Jan-07 4:31 
AnswerRe: what is the meaning of this expression int *(*table())[30]; Pin
David Crow2-Jan-07 8:16
David Crow2-Jan-07 8:16 
AnswerRe: what is the meaning of this expression int *(*table())[30]; Pin
werpa2-Jan-07 8:50
werpa2-Jan-07 8:50 
GeneralRe: what is the meaning of this expression int *(*table())[30]; Pin
John R. Shaw2-Jan-07 10:26
John R. Shaw2-Jan-07 10:26 
AnswerRe: what is the meaning of this expression int *(*table())[30]; Pin
Michael Dunn2-Jan-07 15:04
sitebuilderMichael Dunn2-Jan-07 15:04 
GeneralRe: what is the meaning of this expression int *(*table())[30]; Pin
Mark Salsbery2-Jan-07 15:17
Mark Salsbery2-Jan-07 15:17 

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.