Click here to Skip to main content
15,914,163 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: i got a compiling error like: error C2485: '__restrict' : unrecognized extended attribute Pin
kcynic24-Jul-08 23:34
kcynic24-Jul-08 23:34 
GeneralRe: i got a compiling error like: error C2485: '__restrict' : unrecognized extended attribute Pin
Matthew Faithfull24-Jul-08 23:41
Matthew Faithfull24-Jul-08 23:41 
QuestionAvoid overloading Pin
CodingLover24-Jul-08 19:27
CodingLover24-Jul-08 19:27 
AnswerRe: Avoid overloading Pin
Saurabh.Garg24-Jul-08 19:41
Saurabh.Garg24-Jul-08 19:41 
QuestionRe: Avoid overloading Pin
CodingLover24-Jul-08 19:52
CodingLover24-Jul-08 19:52 
AnswerRe: Avoid overloading Pin
Saurabh.Garg24-Jul-08 19:54
Saurabh.Garg24-Jul-08 19:54 
NewsRe: Avoid overloading Pin
CodingLover24-Jul-08 19:55
CodingLover24-Jul-08 19:55 
AnswerRe: Avoid overloading [modified] Pin
killabyte24-Jul-08 22:46
killabyte24-Jul-08 22:46 
this isnt templating but another method
void MagicStringFunc(char* format,...)
{
	va_list args;
	va_start(args,format);

	string MyString;
	wstring MyWideStr;
        
        if(*format == '%')
	switch(*++format)
	{
		case 'w':
		case 'W':
			MyWideStr+= va_arg(args,wstring);
		break;
		case 's':
		case 'S':
			MyString+= va_arg(args,string);
		break;
	}			
	
	va_end(args);
}


you get the basic idea so you can send format strings like printf kinda IE "%s"for string or for widestring in this case "%w"

int main()
{
 MagicStringFunc("%s","TEST STRING");
 MagicStringFunc("%w",L"TEST WIDESTING");
}


it might be overkill for this situation but can be handy if you a dealing with different languages etc where you need to handle a few options with the same function.

it is also easier to build upon this function if you want to handle an unknown number of params and you can even mix the types up sweet as

modified on Friday, July 25, 2008 7:29 AM

QuestionHow can i disable pressing of special characters(@,#,$,%,^,&,*,~,!) on Editbox control? Pin
Le@rner24-Jul-08 19:24
Le@rner24-Jul-08 19:24 
AnswerRe: How can i disable pressing of special characters(@,#,$,%,^,&,*,~,!) on Editbox control? Pin
Yajnesh Narayan Behera24-Jul-08 19:52
Yajnesh Narayan Behera24-Jul-08 19:52 
AnswerRe: How can i disable pressing of special characters(@,#,$,%,^,&,*,~,!) on Editbox control? Pin
_AnsHUMAN_ 24-Jul-08 19:55
_AnsHUMAN_ 24-Jul-08 19:55 
GeneralRe: How can i disable pressing of special characters(@,#,$,%,^,&,*,~,!) on Editbox control? Pin
Le@rner24-Jul-08 20:38
Le@rner24-Jul-08 20:38 
GeneralRe: How can i disable pressing of special characters(@,#,$,%,^,&,*,~,!) on Editbox control? Pin
User 248443724-Jul-08 23:29
User 248443724-Jul-08 23:29 
QuestionBotton clicked on Pressing Tab Key. Pin
Le@rner24-Jul-08 19:11
Le@rner24-Jul-08 19:11 
AnswerRe: Botton clicked on Pressing Tab Key. [modified] Pin
Yajnesh Narayan Behera24-Jul-08 20:02
Yajnesh Narayan Behera24-Jul-08 20:02 
QuestionQuestion about classes Pin
monsieur_jj24-Jul-08 16:30
monsieur_jj24-Jul-08 16:30 
AnswerRe: Question about classes [modified] Pin
_AnsHUMAN_ 24-Jul-08 18:44
_AnsHUMAN_ 24-Jul-08 18:44 
QuestionModifying input stream of Video before playing it Pin
tibiz24-Jul-08 11:10
tibiz24-Jul-08 11:10 
AnswerRe: Modifying input stream of Video before playing it Pin
Mark Salsbery25-Jul-08 6:49
Mark Salsbery25-Jul-08 6:49 
GeneralRe: Modifying input stream of Video before playing it Pin
tibiz25-Jul-08 7:12
tibiz25-Jul-08 7:12 
QuestionSupplying new command line parameters to the executable already active Pin
Hari-Adarapu24-Jul-08 9:34
Hari-Adarapu24-Jul-08 9:34 
AnswerRe: Supplying new command line parameters to the executable already active Pin
CPallini24-Jul-08 9:49
mveCPallini24-Jul-08 9:49 
AnswerRe: Supplying new command line parameters to the executable already active Pin
David Crow24-Jul-08 10:54
David Crow24-Jul-08 10:54 
AnswerRe: Supplying new command line parameters to the executable already active Pin
led mike24-Jul-08 11:20
led mike24-Jul-08 11:20 
Answermaybe a solution Pin
tibiz24-Jul-08 11:24
tibiz24-Jul-08 11:24 

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.