|
Help!!!
What should i do.
|
|
|
|
|
Edit controls have to be multiline, created with the ES_MULTILINE style, and newlines are the "\r\n".
Tooltips are by default single line only. You have to use a custom tooltip control for multiline tooltips. Do a search on CP for some excellent multiline tooltip controls.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04
"There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05
Within you lies the power for good - Use it!
|
|
|
|
|
nop, it couldn't.
from the MSDN[^], "Text lines in a multiline control are separated by '\r\n' character sequences."
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Hi,
After starting some certain applications with ShellExecuteEx() function and getting their process handles in return, on some other event I want to get the CWnd handle to those windows and bring them to the front and resize, for which I use SetWindowPos.
How I try to get the mentioned CWnd handle:
- After starting the application, I get the process ID with
OpenedThreadPID = GetProcessId(ProcessHandle);
- Then I call EnumWindows function
- and then in the callback function I check the called window's process ID with
GetWindowThreadProcessId(pWnd->m_hWnd,&FoundThreadPID);<br />
if(FoundThreadPID == OpenedThreadPID)<br />
SearchedCwnd = pWnd;
- Then I use
SetWindowPos(&SearchedCwnd->wndTopMost,StartX,StartY,Width,Height,<br />
SWP_NOREPOSITION|SWP_NOSENDCHANGING|SWP_NOZORDER|SWP_SHOWWINDOW<br />
);
The callback function is not called. What am I doing wrong? BTW, can I also reach the windows minimized to tray?
Any help appreciated. Thanks in advance
Caykahve
|
|
|
|
|
EnumWindows returns the raw HWND of the windows, not the CWnd of the windows. You should try to use raw Win32 API calls from within the EnumWindows callback instead of the MFC CWnd classes or CWnd pointers to windows. Then it will work fine.
|
|
|
|
|
Actually I do it as told in Joseph Newcomer's article (http://www.codeproject.com/cpp/callbacks.asp?msg=27622)
And the CWnd is retrieved by CWnd::FromHandle(). Why is that a problem?
|
|
|
|
|
Not necessarily a problem, it could use up memory a lot depending upon what you do in the enumeration, since each CWnd created this way is a temporary added to a map. I just try to avoid doing anything MFC related in a callback like that.
I am not sure what Joseph did. Threre might be a separate problem in your code.
BTW: I tried to e-mail you a sample, but your GMail address might be bad.
|
|
|
|
|
I created a MDI application and changed the title of the child window using the CChildFrame::OnUpdateFrameTitle(BOOL bAddToTitle) function.
When i call this function to add some text to the title, it fails when the child window is maximized. To be more precise, i call GetActiveView to get some info from the view when updating the frame title and it returns NULL if the child window is maximized. Can somebody explain to me what happens if the child frame is maximized, so i can solve this small error?
I have another question about updating the frame title. When opening/creating a document, the title is added to the window menu. I want to have a somewhat different text displayed here then the title of the document. How can i adjust that?
Greetings and thanks, Joris
|
|
|
|
|
I'm developing an image processing sdk ..I thought of using vc++..could u suggest where & how to start?what functions to learn about and what tutorials to refer to??
|
|
|
|
|
|
|
Hello
Are you planning to use C++ or managed C++ ?
If you want to use C++, you can look at existing libraries:
Intel's OpenCV[^],
CxImage (here on CP)[^],
PaintLib[^],
Image Analysis Explorer Pro[^], etc.
If you are thinking about using GDI+ (managed or unmanaged c++), then you can read a set of Christian Graus articles here on CP. Or mine "Image Processing Lab". These articles are using C#, but the idea can be used in C++ easily.
With best regards,
Andrew
|
|
|
|
|
"Programming Windows Fifth Edition" by Charles Petzold
Plus articles at CP and game programming sights.
To make it usable to the most amount of peaple, then write it in C.
What ever you chose, write as much of it as possible in standard C/C++. In other words; if it does not involve the interface (viewing), then make it as system independent as possible.
INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
|
|
|
|
|
Hello, I have written the below code to simulate a person "typing" into a text box:
for(int i=0;i < str.GetLength();i++)
{
SetDlgItemText(MYEDIT,str.Left(i));
Sleep(100);
}
While this works with a CStatic control, a CEdit control will simply display the entire text(str) after sleeping 100 * GetLength. Why is this? More important, how can I get CEdit to achieve the same effect? Thanks.
|
|
|
|
|
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
|
|
|
|