|
dy13 wrote:
GetLength. Why is this?
this CString member function returns the length of the string (number of characters contained).
it seems that you use MFC. so, why dont you do so :
CEdit* mEdit = (CEdit*)GetDlgItem(IDC_MY_EDIT);
for (int i = 0; i < str.GetLength(); i++) {
mEdit->SetDlgItem(str.Left(i);
}
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Have you tried this?
for(int i=0;i < str.GetLength();i++)
{
SetDlgItemText(MYEDIT,str.Left(i));
UpdateData(FALSE);
Sleep(100);
}
|
|
|
|
|
UpdateData() is used to set member variables to the control associated.
here, he uses directly a pointer on the control, so there's no variable, and no need for UpdateData()...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Sorry, I was looking at your suggestion, not the original post.
My mistake.
|
|
|
|
|
but it remains the same, i use pointers too (CEdit* )...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
dy13 wrote:
Why is this?
Because CEdit uses WM_PAINT - a lazy, low-priority message - to draw its text; it prefer to wait for all WM_SETTEXT handlers to finish their job. The static window will use WM_SETTEXT to both set and draw the text, that's why you get no delay when using this class of window.
The Sleep(100) call is irrelevant since it frozes the entire thread execution - including the message queue pumping engine.
dy13 wrote:
how can I get CEdit to achieve the same effect?
Force WM_PAINT after every WM_SETTEXT :
for(int i=0; i < str.GetLength(); i++)
{
SetDlgItemText(MYEDIT, str.Left(i));
GetDlgItem(MYEDIT)->UpdateWindow();
Sleep(100);
}
"tous les sifflets des trains, toutes les sirènes des bateaux
m'ont chanté cent fois la chanson de l'Eldorado"
rechi+
|
|
|
|
|
Hello again guys!
I'd like to ask some help with this matter.
I have a data of X represents the line number, Y as column number and length of string from the position XY Coordinates and an html file. I need to locate the string in an html file based from the data and highlight that string.
I already did the parsing of the data into an Array (xCoorArray, yCoorArray and strLenArray). Without knowing what is the html content, I have to highlight the word or sentence based from the data.
For e.g.
Data:
XCoor YCoor StringLength
-------------------------------------------
8 21 8
Html File:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Test</title>
<body>
// Comment
<caption>For testing purposes only!!!</caption>
</body>
</head>
</html>
*With that data, the created html file should be something like this:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Test</title>
<body>
// Comment
<caption>For testing <span bg-color=yellow>purposes</span> only!!!</caption>
</body>
</head>
</html>
So, when the html file open in a web browser, the string "purposes" has been highlighted with a color yellow.
I hope you can help me with this matter. Thanks in advance.
With great power comes a great responsibility.
|
|
|
|
|
|
hum, it seems that you don't post the whole code that is crashing...
firstly, give the entiere definitions of struct link ans class linklist.
secondly, give the code where you use the class' member functions
then, give the error messages as they are provided (certainly with the file location and the line where the error occured).
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
|
Rupali sarda wrote:
struct link{};
class linklist
{
link additem();
}
What error it is giving
"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
|
|
|
|
|
Rupali sarda wrote:
it is not working
it should...
what is the error code provided ??
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Hello,
Try the following:
struct link;
class linklist
{
link* additem();
};
Maybe you want struct link{}; to be just a prototype declaration. Here you define the structure. If you defined the structure also in another file, you get those conversion problems. If you want to return the link by value, you should include the header of the link struct instead of using a prototype declaration...
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
Geeez... You are both on the race today
|
|
|
|
|
Thanx Bob ...
Its working.
Rupali Sarda
|
|
|
|
|
just waiting for the red lights turn off... !!!
wroooooom vroooomm vRRRRRRROOOOOOOMMM
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
You're welcome
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
cedric moonen wrote:
You are both on the race today
after Very long time
"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
|
|
|
|
|
Holidays ?
|
|
|
|
|
cedric moonen wrote:
Holidays ?
naah!!! Busy With JOb
"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
|
|
|
|
|
hi .....
i am not professional in programming ,this is my first real experience , so i need a help
i wanna make interface ,from it i can enter the name and number of person ,then i will pass these parameters into function to proccess them .
|
|
|
|
|
|
lallaba wrote:
i wanna make interface ,from it i can enter the name and number of person
if you looking for COM interface :-
http://www.codeproject.com/atl/SimpleATLCom.asp[^]
"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
|
|
|
|
|
By interface, you mean GUI (graphical user interface) ? That is the window with the controls on it in which you can enter the data ?
If yes, I would choose a Dialog Based application when you create your project (in the wizzard for seting up your project). Then play a little bit with that, find some article on this website (or even better, buy a good book that explains how to work with MFC and class Wizzard) try it by yourself and if you have some specific questions, come back and ask. It's really too long to explain everything here.
|
|
|
|
|
Hello.,
I have two radio button , Yes and NO
and a Spin Control in a dialog based application.
My Question is .,->
When I select Yes Radio button ,I want to activate that Spin control.
In this EnableWindow() is not working.
Praveen
|
|
|
|