|
Larry Mills Sr wrote: How do I strip those special chars from those databases before the User can "copy and Paste" from them?
Can you handle the WM_PASTE message?
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
As you can see by the code I presented, No. That code segment is where I read from the file what the User typed(or pasted in). It's here that I need to strip the Special chars, etc from the database.
A C++ programming language novice, but striving to learn
|
|
|
|
|
Larry Mills Sr wrote: It's here that I need to strip the Special chars, etc from the database.
And what are those special characters? What does the input look like? What should the output be?
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Hi All,
I have a doubt in costum tree control.I created a CDragDropTreeCtrl for drag and drop purpose.
The code is:
RECT rect = {25,29,190,250};
m_treeCtrl1.Create(WS_CHILD|WS_VISIBLE|WS_BORDER|TVS_TRACKSELECT|TVS_SHOWSELALWAYS ,
rect,this, 1001);
rect.left = rect.right + 25;
rect.right = rect.left + 170;
m_treeCtrl1.SetBkColor(RGB(192,192,192));
m_treeCtrl2.Create(WS_CHILD|WS_VISIBLE|WS_BORDER|TVS_HASLINES|TVS_LINESATROOT
|TVS_HASBUTTONS|TVS_TRACKSELECT|TVS_SHOWSELALWAYS ,
rect,this, 1002);
m_treeCtrl2.SetBkColor(RGB(192,192,192));
PopulateTree(m_treeCtrl1);
rect.left = rect.right + 25;
rect.right = rect.left + 170;
m_treeCtrl3.Create(WS_CHILD|WS_VISIBLE|WS_BORDER|TVS_HASLINES|TVS_LINESATROOT
|TVS_HASBUTTONS|TVS_TRACKSELECT|TVS_SHOWSELALWAYS ,
rect,this, 1003);
m_treeCtrl3.SetBkColor(RGB(192,192,192));
now i need the double click event for this tree control.I dont know how to write it.Bcoz it doesnt have the ID(because custom tree control).
Pls help me...............
Thanks & Regards,
Anitha
|
|
|
|
|
You can use the WM_NOTIFY with the NM_RCLICK message. Such as:
ON_NOTIFY(NM_CLICK, IDC_TREE1, OnClickTree1)
ON_NOTIFY(NM_RCLICK,IDC_TREE1, OnRightClickTree1)
Some documentation here:
How To Display a Context Menu for CTreeCtrl[^]
Best Wishes,
-David Delaune
|
|
|
|
|
u can use ID u provided in ur create method i.e the last argument;in ur
case u have given it as '1001','1002' and map ur events
|
|
|
|
|
Hai !!
How to change the caption of AfxMessageBox ()
i could give the message but the caption remains the name of the project !!
Can i change it ??
Thankyou !
|
|
|
|
|
AfxMessageBox[^] is simply a wrapper for the MessageBox Function[^]. I would suggest that you use that instead if you want to modify the caption.
Best Wishes,
-David Delaune
|
|
|
|
|
Add an entry with the ID AFX_IDS_APP_TITLE to your application's string table, and set the value to the title you want.
|
|
|
|
|
Hello,
My application is an mfc application which is connected to server throughtout.
Now if the internet connection failure is there then then i display a meesgebox that please check your internet connection.
And the applications keeps on requesting from the server.
How ever if the internet connection does not get better early the the appplicaton keep on requesting from thes server i.e. it gets busy in itself as the messagebox next gets fired after 213 calls.
How should i manage it so that it does get busy itself and the user does not have to forcefuuly end it.
Thanks In Advance.
Dhiraj
|
|
|
|
|
Hi, I am programming a simple matrix class with the following = and + operator definitions:
Matrix<T> Matrix<T>::operator=(Matrix<T> rhs)
{
if (v!=NULL)
delete [] (v);
iRows=rhs.iRows;
iCols=rhs.iCols;
v=new T[iRows*iCols];
for (int i=0;i<(iRows*iCols);i++)
*(v+i)=*(rhs.v+i);
return *this;
}
template <class T>
Matrix<T> Matrix<T>::operator+(Matrix<T> rhs)
{
Matrix<T> sum(iRows,iCols);
if (iRows!=rhs.iRows || iCols!=rhs.iCols)
throw Exception("Matrices dimensions do not match", __FILE__, __LINE__);
else
for (int i=0;i<(iRows*iCols);i++)
*(sum.v+i)=*(v+i)+*(rhs.v+i);
return sum;
}
where
private:
int iRows;
int iCols;
T* v;
Now, I try the code: C=A+B,
The point is that before the return sum assings the sum value , the matrix variate sum is destroyed by the Matrix class destructor as it is a local scope variate, and I get a debug assertion error. On the other hand, if I comment the destructor code block, there code works fine.
Thanks in advance.
modified on Sunday, November 23, 2008 5:00 AM
|
|
|
|
|
Why the assignment operator doesn't return a reference, as it should do?
Why didn't you implement also the copy constructor?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
You are right. I changed my code so many times, that didn't notice about the assignment operator did not return a reference. Anyway, that is not the problem, I still get my sum variate destroyed before returning anything. what does the copy constructor have to do with the + operator?
|
|
|
|
|
Hi All,
Im having the .bmp file in tree control.If i will click that file, it will open in paint using MFC(I dont want in VC++).
Pls help me...........
Thanks & Regards,
Anitha
|
|
|
|
|
Hello Anitha,
You can use the ShellExecute Function[^] to launch the either the default BMP extension handler or "%windir%\system32\mspaint.exe" with lpParameters set to the file path for only MSPAINT.
Best Wishes,
-David Delaune
|
|
|
|
|
Hello!
I'm not sure i understood correctly what you are trying to achieve there, but if you have the path to the BMP file you want to open when it is clicked you could try using ShellExecute, for example something like ShellExecute(NULL, "edit", <path_to_your_BMP>, NULL, NULL, SW_SHOW) or maybe ShellExecute(NULL, "open", <path_to_paint>, <path_to_BMP>, NULL, SW_SHOW).
|
|
|
|
|
Do you want to load and show bmp file yourself?
|
|
|
|
|
yes.I need to load the .bmp file in tree control.If i click that file it will show in pain.
|
|
|
|
|
AnithaSubramani wrote: I need to load the .bmp file in tree control.
See here.
AnithaSubramani wrote: If i click that file it will show in pain.
This has already been answered (assuming you are not wanting to know how to respond to a mouse click).
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
I think David answered to your question and for show your bmp file you can use of LoadImage or CImage class.
|
|
|
|
|
Hi all,
in my application i m using a wizad dialog here i can use 8 different wizard pages.
when run my application it works poperly but if i work on it over 4-5 hr than it woking like in hang of not responding condition and in this case the memory usage of application is increase upto 30000k.
same condition occurs even i left my application in open condition for long time.
i this there is some problem of memory relese.
if yes please help me.
or give me any other solution for this.
thanks in advance.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
|
i made this code conversion but i have 2 problems there one it works perfectly for a word with 3 chars but it doesnt for a 4 char cant understand why ..
second problem i cant add a simple manu with an if so i can separate the encryption from the decryption ...any ideas how can i do that ..
here is pascal code ...
program shfrovalka;
uses crt;
var text:string;
m,k,c,men:integer;
procedure cez(var text:string; var k:integer);
begin
clrscr;
writeln('vvedite isxodniy text ');
write('$~/> ');
read(text);
write('vvedite klu4 shifrovani9 ');
readln(k);
for m:=1 to length(text) do
begin
c:=ord(text[m])+k;
if c>256 then c:=c-256;
text[m]:=chr(c);
end;
end;
procedure desh (var text:string);
begin
writeln('vvedite kluch deshifrovki' );
readln(k);
for m:=1 to length(text) do
begin
c:=ord(text[m])-k;
if c<256 then c:=c+256;
text[m]:=chr(c);
end;
end;
begin
repeat
clrscr;
writeln('1 - shifrovka ');
writeln('2 - deshifrovka ');
writeln('3 - sosto9nie texta ');
readln(men);
case men of
1:cez(text,k);
2:desh(text); U?
3:begin
writeln(text);
readkey;
end;
end;
until men = 0;
end.
here is my c code..
#include <stdio.h>
#include <string.h>
#include <conio.h>
char text[256];
int m,k,c,men;
void cez(char *Text)
{
printf("%s\n", "give me the text");
gets(Text);
printf("%s\n", "give me the key ");
scanf("%d", &k);
for(m = 0; m < strlen(text); ++m)
{
c = text[m] + k;
if(c > 256) c -= 256;
Text[m] = c;
}
}
void desh(char *Text)
{
printf("%s\n", "give me the decoding key ");
scanf("%d", &k);
for(m = 0; m < strlen(text); ++m)
{
c = Text[m] - k;
if(c < 256) c+=256;
Text[m] = c;
}
}
int main()
{
cez(text);
printf("%s\n", text);
desh(text);
printf("%s\n", text);
_getch();
return 0;
}
|
|
|
|
|
Member 4038335 wrote: char text[256];
Comment this line out and you'll see the problem.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
what is rong with it ? as far as i know it s the way to do it with aski code...what should i replce instead of 256?
|
|
|
|