|
Your threads can generate a message (see WM_APP or RegisterWindowMessage) whic is caught by your main app, which updates your variable. The CStatic would show the new value after a UpdateData().
|
|
|
|
|
I'm using the WebBrowser control to display some XML file.
Do you know how could i programmaticaly select the text between two distinct positions from the file?
rechi
|
|
|
|
|
If you have the XML file and are using C++, what you can do is override the default XSL stylesheet applied by IE when the XML content is rendered. To get the default XSL code, type res://msxml.dll/defaultss.xsl in your browser.
If you are an interactive user, you may find useful to select a region based on the current html tag under the mouse cursor. For instance, in Javascript, I have a onmouseover event handler implemented like this :
var elem = window.event.srcElement;
var rng = document.body.createTextRange();
rng.moveToElementText(elem);
rng.select();
MS quote (http://www.microsoft.com/ddk) : As of September 30, 2002, the Microsoft® Windows® 2000 DDK, the Microsoft Windows 98 DDK, and the Microsoft Windows NT® 4.0 DDK will no longer be available for purchase or download on this site.
|
|
|
|
|
Thanx a lot for your advice!
The case: i have a fragment from the XML text and i want to highlight it.
Your first suggestion seems to be more appropriate but unfortunately i'm not familiar with XSL and it's gonna take some time. How could i change the default one?
Are there no other possibilities but these two?
rechi
|
|
|
|
|
Bogdan Rechi wrote:
How could i change the default one?
You've got to add this <?xml-stylesheet type="text/xsl" href="show_book.xsl"?> just below the <?xml version="1.0"> header of your Xml file.
MS quote (http://www.microsoft.com/ddk) : As of September 30, 2002, the Microsoft® Windows® 2000 DDK, the Microsoft Windows 98 DDK, and the Microsoft Windows NT® 4.0 DDK will no longer be available for purchase or download on this site.
|
|
|
|
|
I'll try to do it this way.
Thanx again.
rechi
|
|
|
|
|
I want to send ALT + S to an application, ive tried:
PostMessage ( hHandle , WM_SYSCHAR , 's' , 0 );
What im i doing wrong cos its not working
Papa
Murex Co.
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Try passing 0x20000000 as lParam value. According to the docs, that defines the ALT key as being pressed.
Look! They have the Internet on computers now! (Homer J. Simpson)
|
|
|
|
|
PostMessage ( hHandle , WM_SYSCHAR , 's' , 0x20000000 );
didnt work? Why?
Papa
Murex Co.
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
See SendInput, keybd_event.
|
|
|
|
|
yeah ok, but what message to send??
is there a VK_ALT cos i didnt find any
Papa
Murex Co.
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Fill out the KEYBDINPUT structure and use .type = INPUT_KEYBOARD
or use keybd_event()
...make it about Visual C++, and don't ever mention Visual Basic. Nick Hodapp (MSFT) in Semicolon[^]
|
|
|
|
|
Yes, but please, if i want to state that the keyboard event is the ALT Key, how should i do that?
Papa
Murex Co.
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Should be something like
keybd_event( VK_MENU,0,KEYEVENTF_EXTENDEDKEY,0);
keybd_event( 's',0,0,0);
keybd_event( 's',0,KEYEVENTF_KEYUP,0);
keybd_event( VK_MENU,0,KEYEVENTF_EXTENDEDKEY|KEYEVENTF_KEYUP,0);
...make it about Visual C++, and don't ever mention Visual Basic. Nick Hodapp (MSFT) in Semicolon[^]
|
|
|
|
|
Thank u very much, long live VC++ !
Papa
Murex Co.
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Does VC++6.0 have problems with function templates?
I have a function template:
template < class T>
void classA::copyList(os_Dictionary< void*, T*> *pTarget, os_Dictionary< void*, T*> *pSource)
{
// some copying
}
and where i called it in one of classA's member fns:
// pList1 and pList2 are os_Dictionary< void *, float*> pointers
copyList(pList1, pList2); // C1001 error here
I get a "fatal error C1001: INTERNAL COMPILER ERROR (compiler file 'msc1.cpp', line 1794)"
Any idea what's the problem??
|
|
|
|
|
It might be a problem with your template definition. Make sure every line and (template) class-closing curly bracket has a semi-colon. It's usually just a typo that's causing it. (Usually, but not always... I found the non-inline template destructor bug in C++ Builder 4.0 by myself... )
|
|
|
|
|
That's not a function template, that's a member function template.
Yes, VC6 have serious problems and bugs when it comes to template handling. One of them is IIRC that member function templates must be both declared and defined within the class declaration.
One could argue that it's about time ObjectStore fixed their library to allow standard C++ operations (begin(), end(), assignment, ...), but I digress.
|
|
|
|
|
Yup, solved the problem by taking it out of the class. And i have to explicit specify the type when making the call. Thanks guys
|
|
|
|
|
Sir, I want to create bitmap which must uses 1 bytes per pixel using CreateBitmap() API function. But I am very much confused and I don't get success in setting up of 5th parameter. Would you please help me regarding this........If there is any sample program, please send.
C.R.Naik
|
|
|
|
|
The CreateBitmap function creates a device-dependent bitmap.
Try CreateDIBSection.
|
|
|
|
|
Hey!
After writing a C++ application , what are the steps to release it and get the .exe file?
Thank u.
Bebe Harhour
|
|
|
|
|
To get the release version, go to build, set active configuration. The dialog that comes up allows you to set your project configuration. Set it for Win32 Release. Rebuild your program. VC++ should make a new folder in your program directory called Release. This is where your executable is. Hope this helps.
Brad Jennings
|
|
|
|
|
Hi,
I inserted a class into a new DLL win32_DLL project and got following debug result:
<br />
<small> --------------------Configuration: HydroDLL - Win32 Debug--------------------<br />
Compiling...<br />
CommMonitor.cpp<br />
C:\Program Files\Microsoft Visual Studio\MyProjects\HydroDLL\CommMonitor.cpp(34) : error C2065: 'TRACE' : undeclared identifier<br />
C:\Program Files\Microsoft Visual Studio\MyProjects\HydroDLL\CommMonitor.cpp(34) : error C2065: '_T' : undeclared identifier<br />
C:\Program Files\Microsoft Visual Studio\MyProjects\HydroDLL\CommMonitor.cpp(80) : error C2065: 'CString' : undeclared identifier<br />
C:\Program Files\Microsoft Visual Studio\MyProjects\HydroDLL\CommMonitor.cpp(80) : error C2146: syntax error : missing ';' before identifier 'strPort'<br />
C:\Program Files\Microsoft Visual Studio\MyProjects\HydroDLL\CommMonitor.cpp(80) : error C2065: 'strPort' : undeclared identifier<br />
C:\Program Files\Microsoft Visual Studio\MyProjects\HydroDLL\CommMonitor.cpp(83) : error C2440: '=' : cannot convert from 'char [11]' to 'int'<br />
This conversion requires a reinterpret_cast, a C-style cast or function-style cast<br />
C:\Program Files\Microsoft Visual Studio\MyProjects\HydroDLL\CommMonitor.cpp(87) : error C2228: left of '.Format' must have class/struct/union type<br />
C:\Program Files\Microsoft Visual Studio\MyProjects\HydroDLL\CommMonitor.cpp(263) : error C2065: 'ASSERT' : undeclared identifier<br />
C:\Program Files\Microsoft Visual Studio\MyProjects\HydroDLL\CommMonitor.cpp(435) : error C2065: 'AfxMessageBox' : undeclared identifier<br />
HydroDLL.cpp<br />
Generating Code...<br />
Error executing cl.exe.<br />
<br />
HydroDLL.dll - 9 error(s), 0 warning(s)
My question is : I guess I forgot the header file, could u tell me what's that
Thx
Extreme programming. Do the No.1
|
|
|
|
|