|
|
this works but it somehow blocks the backspace key... do you know how to resolve this?
krby_xtrm
a journey of a thousand miles is started by taking the first step.
|
|
|
|
|
In Continuation With Giorgi (Very Nice answer)..
kerby_arion wrote:
do you know how to resolve this?
Modify Giorgi function this way:-
const short g_arrAllowed[]={1,2,3,4,5,6,7,8,9,0,'a','b','c','d','e','A','B','C','D','E',VK_BACK,VK_DELETE};
void CMyEdit::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags)
{
for(int i=0;i<sizeof(arrAllowed)/sizeof(short);i++)
{
if(nChar==arrAllowed[i])
{
CEdit::OnChar(nChar, nRepCnt, nFlags);
return;
}
}
}
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
ThatsAlok wrote:
In Continuation With Giorgi (Very Nice answer)..
thanks Alok
"Success is the ability to go from one failure to another with no loss of enthusiasm." - W.Churchill
|
|
|
|
|
i've tried this one it worked:
void CMyEdit::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags)<br />
{ <br />
if(nChar=='A'||nChar=='B'||nChar=='C'<br />
||nChar=='D'||isdigit(c)||nChar==VK_BACK)<br />
{ <br />
CEdit::OnChar(nChar, nRepCnt, nFlags); }}
krby_xtrm
A_journey_of_a_thousand_miles_is_started_by_Taking_the_first_step.
|
|
|
|
|
how to set a max char length of combo box or and edit control?
say it would only accepts 10 characters.
a journey of a thousand miles is started by taking the first step.
|
|
|
|
|
u can set these when u declare variables for them thru the class wizard
"Do first things first, and second things not at all."
— Peter Drucker.
|
|
|
|
|
yeah i did that already i typed in "8" but still the control allows more than eight characters...
a journey of a thousand miles is started by taking the first step.
|
|
|
|
|
my bad, my compiler didn't recompile... it works now... ty
a journey of a thousand miles is started by taking the first step.
|
|
|
|
|
see the property dialog within the resource editor...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
CComboBox *c = (CComboBox*) GetDlgItem(IDC_YOUR_COMBOBOX);<br />
c->LimitText(10);
-krby_xtrm-
a journey of a thousand miles is started by taking the first step.
|
|
|
|
|
CComboBox *c = (CComboBox*) GetDlgItem(IDC_YOUR_COMBOBOX);
c->LimitText(10); // or any value you want.
-krby_xtrm-
a journey of a thousand miles is started by taking the first step.
|
|
|
|
|
Hi
I am learning MFC exe application.
I have to convert ini files to xml files through my application. My sample ini file(ABCD.yak) is:
ABCD.yak
[Section1]
Key1=ABCD
Key2=20
Can anybody tell me how to convert it into an xml file using mfc.
Please tell me which functions should I make?
Thanx
|
|
|
|
|
|
I've used VC++7 to write a program that gets some iformation from another program, parse it, do calcualations, and output the result.
It's working well on WinXP and Win2K.
However, I need it to work on WinNT (my friend need it). When he tries to run the program, a message shows up "Initialization of the dynamic link library C:\WINNT40\system\OLEACC.DLL failed. The process is terminating abnormaly".
Has anybody gone through a similar situation, or knows anything about it? Do you think that I should change something in the program, or the problem is because of the dll only?
Thanks
|
|
|
|
|
// the parent class of CBtnEx is COleControl
CBtnEx::CtrlSetBitmap(.............)
{
SetWindowPos(NULL,0,0,20,20,SWP_NOZORDER ); // takes no effect.
}
CMyDialog()
{
m_btnEx.CtrlSetBitmap(.....);//
m_btnEx.SetWindowPos(NULL,0,0,20,20,SWP_NOZORDER ); // it works ,
// the only way is calling outside the class ?
// what should I do ?
}
suo
|
|
|
|
|
i want to Develop an application that contains a menu Info having following menu items
• Id
• Name
o First name
o Last name
• City
• Exit
please help me in this regard
thanks
|
|
|
|
|
try to use the CMenu class
&
update ur menu every thime the
user clicks on menu
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
|
I frequently receive a dialog box saying "this file has been modified out of the source editor , do you want to reload it?" , and after this, I find that the file is indeed changed and in turn some errors occured, how can this happen? what should I do to fix it ,
thanks a lot
|
|
|
|
|
U might have a Virus.
else try to change change the Source Folder of ur Project
Use Visual Source Safe for ur Main Project , and keeping
Backup is the best thing we can do.
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
|
even if the file is altered in your IDE, it will display such dialogs. [for example, if u change something in the dialog and try to complie it, though it doesn't throw any errors]. just click on "save all" before compiling. this will make sure what you see is what is there.
Every man should marry. After all, happiness is not the only thing in life.
--[v]--
|
|
|
|
|
I have a class written in WTL 7.0 but I want to use it in my MFC application.How can i do that. The class use WTL CString but I think it isn't recognized in MFC
I tried to add the class into my project but I got the following code when I conpiled:
fatal error C1010: unexpected end of file while looking for precompiled header directive
Can you help me?
Thanks a lot!
|
|
|
|
|
well,
I am not too sure about WTL->MFC, but you can fix the compilation error by putting
#include "stdafx.h"
at the top of the file or select "not using precompiled header" in projectsettings->C/C++
-prakash
|
|
|
|