|
Hi,
Thanks for your reply. I am able to display JPEG images.
|
|
|
|
|
If it was helpful you can give me 5 vote.
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
I cannot calculate the exact number of pages to be printed in advance, so I do not call SetMaxPage in OnBeginPrinting(). In this case only 1 page is printed.
I tried setting it to maximum(0xFFFF), but still it prints only 1 page. The data(sample) to be printed is clearly more than 5 pages.
How do I continue with this?
Is setting max page mandatory for printing more than 1 page?
Thanks in Advance..
|
|
|
|
|
The documentation says something about using the m_bContinuePrinting member if the max. page is not known.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
Thanks superman..
I always use documentation. but in this case I totally forgot it.
|
|
|
|
|
Hi all,
I have an edit box,i want to handle space key in this edit box in following manner.
i want space not allowed at strating point and ending point of editbox.
while if i press space in midle of edit box than its working.
i m try this.
but there is one problem when i press space key at end than the cursor moves to strat of edit box.
void Ctest::OnEnChangeEdit1()
{
CString str;
GetDlgItemText(IDC_EDIT1,str);
if(str.Mid(0,1)==' ')
{
SetDlgItemText(IDC_EDIT1,str.TrimLeft());
}
int length=str.GetLength();
length=length--;
if(str.Mid(length,1)==' ')
{
SetDlgItemText(IDC_EDIT1,str.TrimRight());
}
}
please tell me how can i do this.
thanks in advance.
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
modified on Thursday, February 19, 2009 4:20 AM
|
|
|
|
|
Handle the EN_UPDATE notification in the parent dialog box.
The notification is sent in the form of a WM_COMMAND message.
In this handler, the edit box text can be retrieved and manipulated.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
Another thing you can do is to let the user type the space key and then use Trim() function once you acquire the data from your edit box. I think you are more interested in getting the string without the spaces, than not to allow the user to enter spaces.
You need to google first, if you have "It's urgent please" mentioned in your question.
_AnShUmAn_
|
|
|
|
|
If you just want the string without spaces in the staring and ending, then you can use the CString::TrimLeft and CString::TrimRight.
But if you need to prevent it from entering itself, then you need to map the EN_CHANGE and watch the input and filter it. This might be simple.
See also this[^].
- ns ami -
|
|
|
|
|
ns ami wrote: See also this[^].
there is nothing like that is i want.
please tell me use of CString::TrimLeft and CString::TrimRight.
can u please explain me with any example.
thanks.
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
i m try this.
but there is one problem when i press space key at end than the cursor moves to strat of edit box.
<br />
void Ctest::OnEnChangeEdit1()<br />
{<br />
CString str;<br />
<br />
GetDlgItemText(IDC_EDIT1,str);<br />
<br />
if(str.Mid(0,1)==' ')<br />
{<br />
SetDlgItemText(IDC_EDIT1,str.TrimLeft()); <br />
}<br />
int length=str.GetLength();<br />
<br />
length=length--;<br />
<br />
if(str.Mid(length,1)==' ')<br />
{<br />
SetDlgItemText(IDC_EDIT1,str.TrimRight()); <br />
} <br />
}<br />
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
To move the cursor use
edit.SetSel( nPos, nPos )
- ns ami -
|
|
|
|
|
"_$h@nky_" wrote: please tell me use of CString::TrimLeft and CString::TrimRight.
can u please explain me with any example.
Well...
CString csStr = _T( " Some text with spaces... " );
csStr.TrimLeft();
csStr.TrimRight();
Have a look at MSDN also...
- ns ami -
|
|
|
|
|
ns ami wrote: CString csStr = _T( " Some text with spaces... " );csStr.TrimLeft(); // Result: "Some text with spaces... " csStr.TrimRight(); // Result: "Some text with spaces..."
I know this, i want to use it when i press any key on edit box.
i want to prevent press sapce key at strting and end.
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
The idea of using TrimLeft/Right is that you can then let the user enter spaces if she like. Later, when you get the text from the edit box for use, you can just throw the spaces away.
It's a choise. Trimming later will be less confusing for the user, and less work for you.
I know if I wanted to enter text in a box, and my keyboard suddenly looked like it stopped working, I would be concerned...
Iain.
Codeproject MVP for C++, I can't believe it's for my lounge posts...
|
|
|
|
|
m try this.
but there is one problem when i press space key at end than the cursor moves to strat of edit box.
void Ctest::OnEnChangeEdit1()
{
CString str;
GetDlgItemText(IDC_EDIT1,str);
if(str.Mid(0,1)==' ')
{
SetDlgItemText(IDC_EDIT1,str.TrimLeft());
}
int length=str.GetLength();
length=length--;
if(str.Mid(length,1)==' ')
{
SetDlgItemText(IDC_EDIT1,str.TrimRight());
}
}
please tell me now what can i do.
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
I saw that question. I replied telling you (politely) that you're being thick, and should do things in a different way, as you had already been shown.
Iain.
Codeproject MVP for C++, I can't believe it's for my lounge posts...
|
|
|
|
|
actully i m edit it after posting.
please help me for this.
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
"_$h@nky_" wrote: please help me for this.
He already gave you a solution here[^] but it seems that you even didn't take a look at it. What's wrong with his suggestion ?
|
|
|
|
|
Thanks for help.
its done now.
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
Thanks for that. I was trying to work out how to be helpful and polite...
Iain.
Codeproject MVP for C++, I can't believe it's for my lounge posts...
|
|
|
|
|
How to detect USB Drive & its letter by reading register key values in EVC++ 4.0? The location of register of local mount point is:
The HKEY_LOCAL_MACHINE\SYSTEM\MountedDevices
Thanks
priyank
|
|
|
|
|
See here.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
that function is not supported in EVC++.
|
|
|
|
|
Are these not the right ones?
CreateFile()
DeviceIoControl()
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|