Click here to Skip to main content
15,922,015 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Winsock problem Pin
masnu7-Jul-10 4:56
masnu7-Jul-10 4:56 
GeneralRe: Winsock problem Pin
Moak7-Jul-10 5:05
Moak7-Jul-10 5:05 
AnswerRe: Winsock problem Pin
Parthiban6-Jul-10 18:16
Parthiban6-Jul-10 18:16 
GeneralRe: Winsock problem Pin
masnu7-Jul-10 3:30
masnu7-Jul-10 3:30 
GeneralRe: Winsock problem Pin
Emilio Garavaglia7-Jul-10 4:10
Emilio Garavaglia7-Jul-10 4:10 
GeneralRe: Winsock problem Pin
masnu7-Jul-10 4:24
masnu7-Jul-10 4:24 
GeneralRe: Winsock problem Pin
Iain Clarke, Warrior Programmer7-Jul-10 5:33
Iain Clarke, Warrior Programmer7-Jul-10 5:33 
AnswerRe: Winsock problem solved Pin
masnu7-Jul-10 8:20
masnu7-Jul-10 8:20 
GeneralRe: Winsock problem solved Pin
Moak7-Jul-10 8:22
Moak7-Jul-10 8:22 
GeneralRe: Winsock problem solved Pin
masnu7-Jul-10 8:25
masnu7-Jul-10 8:25 
GeneralRe: Winsock problem solved Pin
jeron17-Jul-10 10:18
jeron17-Jul-10 10:18 
GeneralRe: Winsock problem solved Pin
masnu7-Jul-10 10:22
masnu7-Jul-10 10:22 
GeneralRe: Winsock problem solved Pin
jeron17-Jul-10 10:41
jeron17-Jul-10 10:41 
GeneralRe: Winsock problem solved Pin
masnu7-Jul-10 10:46
masnu7-Jul-10 10:46 
GeneralRe: Winsock problem solved Pin
Moak7-Jul-10 11:15
Moak7-Jul-10 11:15 
GeneralRe: Winsock problem solved Pin
Moak7-Jul-10 11:56
Moak7-Jul-10 11:56 
GeneralRe: Winsock problem solved Pin
masnu8-Jul-10 2:59
masnu8-Jul-10 2:59 
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?

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.