|
The OninitDialog() function should return FALSE, if a control in it want to have focus during startup.
|
|
|
|
|
"_$h@nky_" wrote: No sir its not working, I m also use SetFocus() but it is also not working.
Actually, it does work. But it ain't visible. Try the following code and press up or down key. You'll realize that the focus is on the control.
m_listctrl.SetSelectionMark(0);
m_listctrl.SetFocus();
But, this just works perfect (the selection is visible too):
m_listctrl.SetItemState(0, LVIS_SELECTED, LVIS_SELECTED);
m_listctrl.SetFocus();
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Sir i m already mention in my post it works but only with the help of Up and Down Arrow keys.
Otherwise it not visible.
m_listctrl.SetItemState(0, LVIS_SELECTED, LVIS_SELECTED);
m_listctrl.SetFocus();
After using this the problem is not solve,it is as it is.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
"_$h@nky_" wrote: m_listctrl.SetItemState(0, LVIS_SELECTED, LVIS_SELECTED);
m_listctrl.SetFocus();
After using this the problem is not solve,it is as it is.
Strange. Where have you put this code up?
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
OnInitDialog() function.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
So, you did not read this post[^]
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
yes read this post and return Flase,but it not working.
It only works with help of up and down arrow key.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
Can you post your entire InitDialog() code?
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
m_cListCtrl.SetItemState(nItemToFocus, LVIS_SELECTED, LVIS_SELECTED | LVIS_FOCUSED);
m_cListCtrl.SetFocus();
-@SuDhIrKuMaR@-
|
|
|
|
|
Does your list control need the LVS_SHOWSELALWAYS style?
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Can anybody help me in converting an ascii vaue to a binary or hexamdecimal value..
I am using the code below to read from some .dat file in VC++
CFile filename;
filename.open("file_path",CFile::moderead)
CString buffer[10];
for(i=0; i<filename.getlength();i++)>
{
fileName.Read(buffer,1);
//Additional code...
}
The buffer string which i have used to store the values read from the file is coming as ascii values.I want to convert it in to decimal or hecamdecimal values..
The .dat file which i am used as file is some thing like below having hexadecimal values..
AA AA 32 3D...
the asci value of 32 in this case is 2.
in buffer string it is stored as 2 (acsii value of 32).
So i want to get the corrospomding decimal vlaue of '2' in this case it is 50 or the hexadecimal value 32
please help me to solve this.
|
|
|
|
|
Does strtol(..) function helps?
Regards,
Sandip.
|
|
|
|
|
i have tried it..but it is not working..thanks for the reply..
|
|
|
|
|
can you paste your code and what exactly not working??
int i = strtol("32",NULL,16); gives me 50 thats what you want???
Regards,
Sandip.
|
|
|
|
|
|
Deepu Antony wrote: Can anybody help me in converting an ascii vaue to a binary or hexamdecimal value..
If you are wanting to convert from base-10 to base-2 or base-16, use strtol() .
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
dear all
i am sorry to ask such question again, i tried many time and still couldn't finish it. can anyone help me here? thanks a lot.
my problem is below: just example, my real data are so huge
0 0 0 0 0
0 6 6 6 6
0 0 6 0 0
0 6 6 6 6
how to calculate each column amount 6 and then save it into .txt file as a array. thanks a lot.
gentleguy
|
|
|
|
|
Repost, as you yourself said.
More than one person gave you good help yesterday. And you still don't give enough information in your question. You don't say where the data comes from. Your question implies it is in text format, but your answers yesterday imply it is an in-memory array of data.
You also don't say where your actual problem is. If (as it seemed) you don't understand a simple for loop in C, then writing to a text file is the least of your problems.
Asking an identical incomplete question will (at best) get identical incomplete answers.
Iain.
Plz sir... CPallini CPallini abuz drugz, plz plz help urgent.
|
|
|
|
|
i appologize to you for this case, my data is coming from the mostleft bottom corner, and then scan from this row one by one, after that go to lase-second row, also mostleft point.do you understand? sorry for that, friend.thanks a lot
gentleguy
|
|
|
|
|
gentleguy wrote: data is coming from
I'll ask for the last time, first by asking a different question.
me: Where does your car come from?
you: It comes from the front left tire, and goes all the way to the read bumper.
what you should have said: It comes from the car shop.
Now, where does your data come from. Are you reading it line by line from a text file? Are you typing it in manually? Is it in some binary format? Do martians who are visiting the planet zog implant it in your computer using psychic powers?
Now my psychic powers and interest are both fading,
Iain.
Plz sir... CPallini CPallini abuz drugz, plz plz help urgent.
|
|
|
|
|
Iain Clarke wrote: you: It comes from the front left tire, and goes all the way to the read bumper.
I love having a read bumper in my car. They are awesome.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
It's not a typo, I'm too perfect for that.
From the Iain dictionary:
Read bumper:
A rear bumper with interesting bumper stickers.
Unread bumper:
A rear bumper with boring bumper stickers.
Iain.
Plz sir... CPallini CPallini abuz drugz, plz plz help urgent.
|
|
|
|
|
i showed my data examlpe in first post of this time, i thought you have seen it already, so that is why i dun meationed any more, i am sorry for that and thanks for your reply.
gentleguy
|
|
|
|
|
Iain Clarke wrote: Now, where does your data come from. Are you reading it line by line from a text file? Are you typing it in manually? Is it in some binary format?
Does this help?
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
gentleguy wrote: how to calculate each column amount 6...
The answer you need is here. Simply change 255 to 6.
gentleguy wrote: ...and then save it into .txt file as a array. thanks
Work on the counting first before trying to tackle this.
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|