Click here to Skip to main content
15,895,256 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionDetect Windows Search feature Pin
Ivo Beltchev6-Jul-10 6:44
Ivo Beltchev6-Jul-10 6:44 
AnswerRe: Detect Windows Search feature Pin
«_Superman_»6-Jul-10 19:56
professional«_Superman_»6-Jul-10 19:56 
GeneralRe: Detect Windows Search feature Pin
Ivo Beltchev6-Jul-10 20:19
Ivo Beltchev6-Jul-10 20:19 
QuestionCListBox Pin
AbhiHcl6-Jul-10 3:04
AbhiHcl6-Jul-10 3:04 
AnswerRe: CListBox Pin
Niklas L6-Jul-10 3:21
Niklas L6-Jul-10 3:21 
GeneralRe: CListBox Pin
AbhiHcl6-Jul-10 19:50
AbhiHcl6-Jul-10 19:50 
AnswerRe: CListBox Pin
Niklas L6-Jul-10 21:52
Niklas L6-Jul-10 21:52 
QuestionPassing a String as function Argument Pin
T.RATHA KRISHNAN6-Jul-10 3:03
T.RATHA KRISHNAN6-Jul-10 3:03 
Hi!
I'm passing a string variable to a function. Only the first letter of the string value is assigned to the formal parameter. Here is my function:

void setTextToButtons(stringw country, int tabSelected); //proto type declaratio


irr::core::stringw country = irr::core::stringw(list->getItem(countryCode));
setTextToButtons(country, tabSelected);                        //calling the function



void CGameMenuPlayerProfileState::setTextToButtons(stringw country, int tabSelected)  //function definition
{
	stringw query;
	query = L"Select Name from ";
	if(tabSelected = 17) {query += L"Test";}
	else if(tabSelected == 18){query += L"ODI";}
	else if(tabSelected == 19){query += L"T20I";}
	else {query += L"Test";}
	query += L" WHERE Team = '";
	query += country;
	query += "' ORDER BY RANDOM() LIMIT 11";
	printf("%s\n",query.c_str());
		//"Select Name from T20I WHERE Team = country ORDER BY RANDOM() LIMIT 11"
  playerLst = SQLdb.Query(query);
  //printf("Player List Size:%d",playerLst.size());
  printf("Selected Country%s\n", country);
 for(int i = 0; i < 11; i++)
 {
  m_pPlayerBtn[i]->setText(irr::core::stringw(playerLst[i]).c_str());
  //printf("%s\n",irr::core::stringw(playerLst[i]).c_str());
  cout<<query.c_str()<<endl;
 }
}

How to pass the full string value in to the function?
AnswerRe: Passing a String as function Argument Pin
Niklas L6-Jul-10 3:31
Niklas L6-Jul-10 3:31 
GeneralRe: Passing a String as function Argument Pin
T.RATHA KRISHNAN6-Jul-10 3:39
T.RATHA KRISHNAN6-Jul-10 3:39 
GeneralRe: Passing a String as function Argument Pin
Cedric Moonen6-Jul-10 3:47
Cedric Moonen6-Jul-10 3:47 
GeneralRe: Passing a String as function Argument Pin
T.RATHA KRISHNAN6-Jul-10 3:54
T.RATHA KRISHNAN6-Jul-10 3:54 
GeneralRe: Passing a String as function Argument Pin
Cedric Moonen6-Jul-10 4:14
Cedric Moonen6-Jul-10 4:14 
GeneralRe: Passing a String as function Argument Pin
T.RATHA KRISHNAN6-Jul-10 4:35
T.RATHA KRISHNAN6-Jul-10 4:35 
GeneralRe: Passing a String as function Argument Pin
Cedric Moonen6-Jul-10 4:49
Cedric Moonen6-Jul-10 4:49 
QuestionRe: Passing a String as function Argument Pin
David Crow6-Jul-10 4:19
David Crow6-Jul-10 4:19 
AnswerRe: Passing a String as function Argument Pin
KarstenK6-Jul-10 4:23
mveKarstenK6-Jul-10 4:23 
AnswerRe: Passing a String as function Argument Pin
Aescleal6-Jul-10 4:40
Aescleal6-Jul-10 4:40 
GeneralRe: Passing a String as function Argument Pin
Niklas L6-Jul-10 21:38
Niklas L6-Jul-10 21:38 
GeneralRe: Passing a String as function Argument Pin
Aescleal6-Jul-10 21:54
Aescleal6-Jul-10 21:54 
GeneralRe: Passing a String as function Argument Pin
Niklas L6-Jul-10 22:00
Niklas L6-Jul-10 22:00 
GeneralRe: Passing a String as function Argument Pin
Aescleal7-Jul-10 5:49
Aescleal7-Jul-10 5:49 
QuestionMFC Smart Device Article Pin
D.Manivelan6-Jul-10 1:54
D.Manivelan6-Jul-10 1:54 
AnswerRe: MFC Smart Device Article Pin
Richard MacCutchan6-Jul-10 3:22
mveRichard MacCutchan6-Jul-10 3:22 
QuestionMask Pin
john56326-Jul-10 1:15
john56326-Jul-10 1:15 

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.