|
Methods and macros that rely on contiguous control and command ids lead to unmaintainable code and hard to find run-time errors. They don't pass our code reviews.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Hi,
The Find window of Visual studio provides now possibility to use regular expressions.
Can anybody help me with an regular expression for the string
if (XX=YY
I would like check all my code for the assignments inside if
The expression shouldn't match to
if (XX==, if (XX>= , if(XX<= and so on
|
|
|
|
|
Set the warning level to 4 and you'll have the compiler issue a warning for each assignement in a conditional statement
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
I used the following in VS.NET 2002:
if:b*\(:b*:i:b*\=~(\=).+\)
Software Zen: delete this;
|
|
|
|
|
Thank you very much, Gary
|
|
|
|
|
I have no idea what the expression "if(XX==YY" is suppose to mean. It appears you are looking for a pclint type program to verify that your code is correct.
Modern complires are great: write some code, compile code, look at warnings
and error. Then correct program errors or warnings (if you know what caused them), that is all.
INTP
|
|
|
|
|
Hi,
Thanks for this advices. But I needed a regular expression. The reason is, that I have a bunch of files which are from other providers. And they produce many warnings(which are mostly ok).
|
|
|
|
|
Is an edit control in an HTML page displayed in a browser the same as a CEdit ? If so, is it possible to get the HWND of the one with focus, if I know the HWND of the IE instance (i.e. the Internet Explorer_Server window hosted in IE)?
(I'm trying to figure out how to programatically paste content into the currently selected edit field in an HTML page.)
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
u can use EnumWindows() to get HWND of any windows, but i think you can not replace text on html page, SetWindowTest() is not available except you just need plain text (no colors, fonts etc). to do that, your program must have rights to access IE - only IE itself has rights (same thread) to do that.
includeh10
|
|
|
|
|
Actually you can modify the text of a window belonging to a separate thread by using a hook - this[^] article showed me how to do it. So my problem has boiled down to finding the target window handle.
[edit]
Btw, I don't want to change the HTML - I want to paste text into (the currently selected) edit control on an HTML page.
[/edit]
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
it will cause big trouble, if u don't beleive, u can try
includeh10
|
|
|
|
|
I pasted the text into the clipboard and fired a Ctrl/V to IE. Works great! (I'm not sending a WM_SETTEXT ).
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
|
Ravi Bhavnani wrote:
Is an edit control in an HTML page displayed in a browser the same as a CEdit?
Hi Ravi,
I don't think so. I doubt it is a window. You can enumerate the DOM to find the html element then use something like PutinnerHTML(). Have a look at IEHelper here on CP. If you need more help just let me know.
Neville Franks, Author of ED for Windows www.getsoft.com and coming soon: Surfulater www.surfulater.com
|
|
|
|
|
Thanks, Neville! What I really wanted to do was to paste text into the currently highlighted edit control of the active app. Temporarily copying text to the clipboard a firing a Ctrl/V at the active app seems to do it!
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Aha, I was wondering how SendKeys was the answer. Now I know. You should still be able to all of this working directly with the MSHTML control. As I said if you need any more help let me know.
Neville Franks, Author of ED for Windows www.getsoft.com and coming soon: Surfulater www.surfulater.com
|
|
|
|
|
|
I think you need a DHTMLView to view your HTML and through the DHTMLView expose functions which could access the object of your HTML.
Sonork 100.41263:Anthony_Yio
|
|
|
|
|
Anthony_Yio wrote:
I think you need a DHTMLView to view your HTML
No - what I wanted to do was to paste text into the currently selected edit control in an IE page. As you can see from my previous notes, I was able to do this thanks to an article on CP.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
How do I do that? I do this:
szText += m_xTextBuffer.GetLineChars(nLine);
szText += "\r\n";
which produces the funny stuff. When I add in a null character at the end, i.e.
szText += m_xTextBuffer.GetLineChars(nLine);
szText += "\0";
szText += "\r\n";
szText += "\0";
the funny stuff remains. What am I doing wrong. Heeeeeeeeeeeeeeeeeeeeeelp...
|
|
|
|
|
As another reply states please post you 'full' code, this looks totally wrong! But I could be wrong
"Laughing at our mistakes can lengthen our own life. Laughing at someone else's can shorten it."
- Cullen Hightower
|
|
|
|
|
What datatype is m_xTextBuffer ?
From experience, there is nothing wrong with the method of concatenating strings that you are using. I suspect, however, that m_xTextBuffer.GetLineChars(nLine) is not returning a NULL terminated string.
I Dream of Absolute Zero
|
|
|
|
|
m_xTextBuffer is an instance of CCrystalTextBuffer. GetLineChars() returns LPTSTR or a pointer to TCHAR.
|
|
|
|
|
what is szText declared as? If it is CString then OK if it is char* then it won't work
If all else fails use the debugger and step through each line until szText becomes corrupted.
"Laughing at our mistakes can lengthen our own life. Laughing at someone else's can shorten it."
- Cullen Hightower
|
|
|
|
|