|
str1 = str1.Left( str1.GetLength() - 1 ); is one possibility.
Don't try it, just do it!
|
|
|
|
|
Alexander M. wrote:
str1 = str1.Left( str1.GetLength() - 1 );
it didn't work, i also tried to put /2 on GetLength but to no effect. What is the character symbol of a string terminator?
|
|
|
|
|
benjnp wrote:
str1 = "Happy!";
str2 = " Birthday";
try this
CString str1,str2,str3;
str1 = "Happy!";
str2 = " Birthday";
str1.Delete(str1.GetLength()-1,1);
str3=str1+str2;
MessageBox(str3);
"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
|
|
|
|
|
Try this:
CString str1,str2,str3;
str1 = "Happy!";
str2 = " Birthday";
str3 = str1.Left(str1.GetLength() - 1) + str2;
The code above assumes that str1 has at least one character.
-- modified at 6:21 Monday 19th September, 2005
|
|
|
|
|
How will I be able to activate the shortcut keys on the menu of a dialog-based MFC project just like on SDI/MDI?
|
|
|
|
|
whats problem? Have you tried accelerators?
|
|
|
|
|
yup, i tried using accelarators and their not working at all
|
|
|
|
|
what problem it is giving, ideally, when you go to new accelerator , it give you option of selecting desired menu id,
And if you have written a menu handler function for that, then it will get called
|
|
|
|
|
Hi could you please remind me how I can get time in msec? time() returns time in sec but I need more precision.
Thanks
|
|
|
|
|
GetLocalTime [^] retrieves the local time.
Software Zen: delete this;
|
|
|
|
|
Absolute system time or a timer to calculate time differences?
Don't try it, just do it!
|
|
|
|
|
Hi
GetTickCount() retrieves the number of milliseconds the system has been running.
If you need MicroSecunds You can use
QueryPerformanceCounter() and QueryPerformanceFrequency()
Iman Ghasrfakhri
|
|
|
|
|
Thank you all for you answers!
|
|
|
|
|
I want to do performance test with Rational Robot.
My application under test uses CORBA for comunication between server and client.
I dont know if I should instal any DLL to be able to record CORBA calls.
Can you help me please?
|
|
|
|
|
I've got a problem. I'll get input to my program and I have to determine which type of data that is. Input will occur in a text file and will look similar to this:
<br />
Add: 41.4 51.8 48.4 22.1<br />
Delete: 84.1 57.4 15.1<br />
etc....<br />
The problem is I have to determine the type of the data that needs to be added to the tree.
The tree is a template class.
I want to know code that could do the same as the following is supposed to do:
<br />
typedef T;<br />
T = int of T = double;<br />
AbstractTree<T> *tree = new BTree<T>;<br />
I then want to use type T in the rest of my program. etc.
AbstractClass<t> *tree = new BTree<t>;
I need this for a project that needs to be in on Monday 20:00(GMT)
Your help will be greatly appreciated.
Thanks alot
|
|
|
|
|
Hi
Why at the end of the OnPaint() there is a comment saying:
// Do not call CView::OnPaint() for painting messages
?
what should i do for refreshing the window, i try to call the function Invalidate() but when I call it the screen blinks.
Please advice.
Regards
Assay.
|
|
|
|
|
In order to avoid blinkings try to invalidate only the area you are updating instead of the whole paint area.
Themis
|
|
|
|
|
|
It's easy if you know what you have updated in each call. Instead of calling Invalidate() call InvalidateRect(). It takes as argument the area that you want to invalidate. It will update only that area this way if only a small portion of your view has changed you won't redraw everything.
Themis
|
|
|
|
|
Many thanks !
Do you know about more methods for redrawing the window except for calling the Onpaint()?
|
|
|
|
|
My head hurts!!!
It is almost a week that I'm thinking how to traduce the following mechanism in C code.
This is pseudocode, the indexes at the right move like a circular buffer
N = 3;
Pass 1:
pFFT[2] * IR_FFT[0];
pFFT[1] * IR_FFT[2];
pFFT[0] * IR_FFT[1];
Pass 2:
pFFT[2] * IR_FFT[1];
pFFT[1] * IR_FFT[0];
pFFT[0] * IR_FFT[2];
Pass 3:
pFFT[2] * IR_FFT[2];
pFFT[1] * IR_FFT[1];
pFFT[0] * IR_FFT[0];
Pass 4:
pFFT[2] * IR_FFT[0];
pFFT[1] * IR_FFT[2];
pFFT[0] * IR_FFT[1];
Every N passes the Mult sequence is equal.
I'm not able to traduce the right indexes work!
Could you help me?
best regards
|
|
|
|
|
this was easy: but i doubt if this is best, I just did it on my writing pad. I am putting it here, Let me know if it works( you can mail me.)
Code in C++, and works for only three pass(your pass 1 and pass 4 are same)
for(int i=0;i<=3;i++)
{
for(int j=0;j<=2;j++)
{
int x=j-i;
if(x==-1)
x=2;
if(x==-2)
x=1;
a[j]= pFFT[j] * IR_FFT[x];
}
}
Ye Dil Mangge MORE!!
|
|
|
|
|
for(int pass = 0; pass < 4; pass++)
{
pFFT[2] * IR_FFT[(pass + 0) % 3];
pFFT[1] * IR_FFT[(pass + 2) % 3];
pFFT[0] * IR_FFT[(pass + 1) % 3];
}
http://www.catch22.net
|
|
|
|
|
Hi
I create a simple form and at the OnPaint() function I draw:
* Rectangle - using: Rectangle(...
* line that represent x,y axis - using LineTo(... and MoveTo(...
* and line that represent function (such as sin, cos etc.)
When I run the program everything is alright but when i resize the window and drag it fast over the screen the program collapse (like it ran out of memory or somthing).
what should i do or not do ?
Thanks in advance
Lior.
|
|
|
|
|
Anonymous wrote:
what should i do
Like always enclosing some relevant code snippet?
--
The Blog: Bits and Pieces
|
|
|
|