|
what is the meaning of in MSVC++ framework??
can u give the example how to use it??
how can i call a function in a protected function
e.g
void MyPSMDlg::OnButtonEncode()
{
//i want to call my own function like ChangeToBinary(char letter)
}
HelpMe
|
|
|
|
|
beardy janggut wrote: MSVC++ framework
sorry, i don't get you
beardy janggut wrote: how can i call a function in a protected function
like any other function...
visibility declarators are only for the compiler, to know if the caller is allowed to call it or not.
|
|
|
|
|
beardy janggut wrote: how can i call a function in a protected function
You can't. Unlike Pascal, functions are not allowed within other functions.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
CEdit* pEdit=(CEdit*)GetDlgItem(IDC_EDIT1);<br />
<br />
CString strTeks;<br />
<pre>pEdit->GetWindowText(strTeks);</pre><br />
strTeks=strTeks+"//M//u//l//a";
how can i change the text in edit box to binary bit and print it in file with extension .txt..can anyone suggest something???
HelpMe
|
|
|
|
|
beardy janggut wrote: how can i change the text in edit box to binary bit
What do you mean exactly by that ? You want to see the hexadecimal values of each of your character or what ? Could you be more explicit ?
|
|
|
|
|
i want to see the binary values 1 equal to 00000001 and etc
HelpMe
|
|
|
|
|
Hi,
A string is composed by characters and each of them has a corresponding ASCII number. You need to cast each char into integer (and therefore ASCII code) then turn the integer into string with base = 2. For that purpose use itoa function. Finally, append each converted chars to a destintaion string.
--
======
Arman
|
|
|
|
|
thanks i solved the problem
HelpMe
|
|
|
|
|
Oh!!, but Did I get you right?
0x0400:
"But your mind is very complex, very tricky. It makes simple things complicated. -- that's its work. And for centuries it has been trained for only one thing: to make things so complicated that your life becomes impossible."- Osho
<marquee scrollamount="1" scrolldelay="1" direction="up" height="10" step="1">--[V]--
|
|
|
|
|
<br />
CString cs="4";<br />
int intVal=atoi(cs.GetBuffer());<br />
char *txtBin= new char(cs.GetLength());<br />
printf("\nBinary%s\n",itoa(intVal,txtBin,2));<br />
0x0400:
"But your mind is very complex, very tricky. It makes simple things complicated. -- that's its work. And for centuries it has been trained for only one thing: to make things so complicated that your life becomes impossible."- Osho
<marquee scrollamount="1" scrolldelay="1" direction="up" height="10" step="1">--[V]--
|
|
|
|
|
then you can write like..
<br />
CFile cf;<br />
cf.Open("BinaryFile",CFile::write);<br />
cs.write(txtBin,strlen(txtBin));<br />
cs.Close();<br />
0x0400:
"But your mind is very complex, very tricky. It makes simple things complicated. -- that's its work. And for centuries it has been trained for only one thing: to make things so complicated that your life becomes impossible."- Osho
<marquee scrollamount="1" scrolldelay="1" direction="up" height="10" step="1">--[V]--
|
|
|
|
|
AHH!! this absolutely solved my problem..then i want to ask u
what is the meaning of private, public and protected in MSVC++ framework??
can u give the example how to use it??
how can i call a function in a protected function
e.g
void MyPSMDlg::OnButtonEncode()
{
//i want to call my own function like ChangeToBinary(char letter)
}
HelpMe
|
|
|
|
|
These are access specifiers, Without knowing these, you cannot move into MFC, I suggest you study c++ (O-O) concepts well.
beardy janggut wrote: how can i call a function in a protected function
e.g
void MyPSMDlg::OnButtonEncode()
{
//i want to call my own function like ChangeToBinary(char letter)
}
In the MyPsMdlg.h file, declare the "converToBinary()" funtion. and define it like
MyPsMdlg::convertToBinary()<br />
{<br />
}<br />
Then you can access it in side your
<br />
void MyPSMDlg::OnButtonEncode()<br />
{<br />
this->convertToBinary();<br />
}<br />
.But if have more functions likes these, you might consider creating a separate class and putting these functions inside, then get your MyPsMdlg class inherited from it.
0x0400:
"But your mind is very complex, very tricky. It makes simple things complicated. -- that's its work. And for centuries it has been trained for only one thing: to make things so complicated that your life becomes impossible."- Osho
<marquee scrollamount="1" scrolldelay="1" direction="up" height="10" step="1">--[V]--
|
|
|
|
|
learn object programming concepts
|
|
|
|
|
beardy janggut wrote: what is the meaning of private, public and protected...
See here. Google for other examples.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
VuNic wrote: int intVal=atoi(cs.GetBuffer());
Calling GetBuffer() is not necessary here.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
oh, just checked you reply. thanks for the information.
0x0400:
"But your mind is very complex, very tricky. It makes simple things complicated. -- that's its work. And for centuries it has been trained for only one thing: to make things so complicated that your life becomes impossible."- Osho
<marquee scrollamount="1" scrolldelay="1" direction="up" height="10" step="1">--[V]--
|
|
|
|
|
Hi!
Im trying to use GetDlgItem(btnCtr)->EnableWindow(false), its not working.
It seems to throw an exception.
Anyone knows how to disable the dynamically created cbutton?
|
|
|
|
|
lorey wrote: Im trying to use GetDlgItem(btnCtr)->EnableWindow(false), its not working.
What is btnCtr ? Is it the button's ID ?
lorey wrote: It seems to throw an exception.
It will if the specified Dialog item is not found, since GetDlgItem(...) returns NULL for such cases and you are calling EnableWindow for such a NULL pointer!
Nibu thomas
Software Developer
|
|
|
|
|
It shoudl work. The problem is not with EnableWindow but probably that GetDlgItem(btnCtr) doesn't find the specific window and thus returns NULL.
To be sure, just try that:
CWnd* pWindow = GetDlgItem(btnCtr);
And check the value of pWindow with your debugger.
|
|
|
|
|
Like a Resource ID duplication of the Number.
Regards,
FarPointer
|
|
|
|
|
try
m_Button3.EnableWindow(0);
|
|
|
|
|
WhiteSky wrote: m_Button3.EnableWindow(0);
This requires to make a Control-variable (of the type of the DialogItem), but yes, this is the way to go.
"We trained hard, but it seemed that every time we were beginning to form up into teams we would be reorganised. I was to learn later in life that we tend to meet any new situation by reorganising: and a wonderful method it can be for creating the illusion of progress, while producing confusion, inefficiency and demoralisation."
-- Caius Petronius, Roman Consul, 66 A.D.
-- modified at 2:51 Friday 31st March, 2006
|
|
|
|
|
Hi All,
Iam working with a ListControl whose parent is a dialog.want to place a tree control on a particular cell on the listcontrol,which on doubleclicking should open up(ie: the width & height of this tree control exceeds the dialog boundary).
Like in ComboBox control, where the list visible, goes beyond the dialog boundary.
Tried somethings like
treeControl.SetOwner(GetDesktopWindow();
treeControl.ModifyStyle(WS_CHILD,WS_OVERLAPPED);
Everything works fine apart from 1 problem.I can see the newly created window(the treecontrol) on my taskbar.
wHAT should I do to avoid that...
Regards,
P
|
|
|
|
|
Pazzuzu wrote: treeControl.ModifyStyle(WS_CHILD,WS_OVERLAPPED);
I guess this line is causing the trouble. Why are you removing WS_CHILD style. And why WS_OVERLAPPED ?
Nibu thomas
Software Developer
|
|
|
|