|
List control enters modal message loop after pressing the mouse button. Here's what MSDN says:
WM_LBUTTONDOWN: Processed in different ways depending on whether a click or drag operation is being initiated. To determine which operation is involved, the list view control enters a modal message loop until either the button is released or the mouse is moved.
This means that WM_LBUTTONUP will not get through message loop of your application.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Thank you very much!
I will now resort to MSDN to read what exactly "modal message loop" is
|
|
|
|
|
Hi,
I am using MFC(singledocument) to display some 3D physical simulation with OpenGL. My problem is that the display is really slow when my display-window is large. Does anyone have any good ideas on how to speed up the display? The graphics is really simple, (i.e not photographic).I only need 8bit colors. For the smoothness of animation I need doublebuffering, but antialiasing is already turned off. Often only small parts of the window changes between frames. Is it possible to redraw only parts of the screen? I have also tried different settings for the pixelformat, f.x lowering the colordepth etc, but that has not made any large impact. Any ideas on the topic is welcome. Thanks.
JoNy
|
|
|
|
|
Are you SURE you're finding your 3d hardware correctly?? Perhaps your app isn't initializing OpenGL correctly, and you're ending up with the software implementation??
|
|
|
|
|
Thanks,
how do I check if the application finds the 3d hardware?
/JoNy
|
|
|
|
|
I almost finished my tree view... One thing though, when I end editing a label, I have to click somewhere outside the temporary edit control that the treeview created. I want to type the label ending by pressing return. Is there a way to do this? I think I must get the temporary edit control's messages, but how? I "can" get a pointer to the temporary eidt control. One more thing, it's a plugin for 3d Studio Max, so I have to turn off accelerator keys when editing a label, otherwise max's shortcuts get performed. Maybe this is why pressing return doesn't end label editing? Thanks for your time,
WAVK
|
|
|
|
|
You don't have to explicitly handle Enter key during in-place item edit. I think 3DSMAX is interfering. Use CTreeCtrl::GetEditControl if you need to directly access in-place edit control. However, this will not help if MAX is using Enter as accelerator - the message will never reach your window.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Thanks for your reply Few questions...
- You don't have to explicitly handle Enter key during in-place item edit.
So when someone presses Enter after editing the name, the TVN_ENDLABELEDIT message should be sent, or do I get this wrong?
- I think 3DSMAX is interfering. Use CTreeCtrl::GetEditControl if you need to
- directly access in-place edit control. However, this will not help if MAX
- is using Enter as accelerator - the message will never reach your window.
I called DisableAccelerators() so that no accelerator keys get carried out, including max's. Is Enter considered an accelerator? And if I directly access the in-place edit control, how do I catch messages for it ( if max doesn't steel them from me ). Thanks again
WAVK
|
|
|
|
|
I've a class that's not a message map(non CWnd derived) and I want to add some kind of timer(delay) in my function.
Thanks in Advance
Le Ridder Noir
Considderd to be the worlds fastest knoppenbonker.
one year of working experience with the worlds fastest copie paster(about 2000 lines a minute).
And experience with the one and only NewEra Guru and Crystal Ace.
|
|
|
|
|
If you want to just have a delay you can use sleep(). To use Windows timers without messages (and thus messagemaps) you can simply pass the address of a callback to SetTimer(). But remember, this callback cannot be a non-static member function of a class (because of the this pointer).
Cheers
Steen.
"To claim that computer games influence children is rediculous. If Pacman had influenced children born in the 80'ies we would see a lot of youngsters running around in dark rooms eating pills while listening to monotonous music"
|
|
|
|
|
In Java, you can add a static initializer to a class, which will get executed exactly once when that class is loaded. In Pascal, you can add an initialization section to a source file, which will get executed exactly once at program startup.
I would like to do something similar in C++, i.e. I want to add some code to each class or source file, which I can execute at startup without having to explicitly call it from WinMain(). The reason for this is simple: if I add an initialization block to every one of the almost 200 modules currently in my project, I will need to write 200 lines with nothing but initializeFile1(); initializeFile2(); and so on.
BTW, what I'm trying to do is to get code modules to automatically register a set of function pointers with a simple command prompt system. Is there any way I can mimic the Java or Pascal functionality in C++?
Thanks,
- Tom
|
|
|
|
|
Create a static function and call it from the constructor only if registration has not occured. You can set this up with a static bool, if it's not easy to check.
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
I'm not sure what do you mean by module. You may try to create a simple struct with init code in constructor:
struct InitSomeStuff
{
InitSomeStuff()
{
}
} iss;
iss variable is a global one - it's constructor will be called before main or WinMain. In your case, you'd have many such structs, each named differently - if you need a static initializer for CFoo, name it CFoo_init or initCFoo or static_initializer_for_class_CFoo.
Note that C++ does not guarantee the order of initialization: if you'll have InitFoo, InitBar and InitBaz defined in multiple .cpp files, you can't assume that InitFoo will be called before or after InitBar.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Thanks for the suggestions. My code is part procedural and part object-oriented, so Tomasz's suggestion seems to be the way to go.
- Tom
|
|
|
|
|
Hi all,
I apologise if this is real simple stuff, I am new to C++.
I come from a 16 yr UNIX background, so I think in script & Perl.
I am trying to check if a character in a CString is a uppercase Alpha.
if ( yousaid.GetAt(current_pos) == "[A-Z]" )
This obviously isn't how to do it in C++
Any help appreciated.
Cheers Dudes
Tryhard
|
|
|
|
|
The function isalpha will tell you if a character is a letter, the other way is to get a char out, like this:
CString s("dsASdFDftSaSdAaasDdR");
char a = s[0];
if (a >= 'A' && a <= 'Z')
{
AfxMessageBox("Uppercase");
}
If you wanted to test a whole string you could do this:
CString s("dsASdFDftSaSdAaasDdR");
CString d(s);
d.MakeUpper();
if (s==d)
AfxMessageBox("All Upper");
I'm sure someone else will suggest more intelligent ways of doing it, but those are the ways that spring to mind if you're using CString. If you were using basic_string you could do cool iterator stuff, but that is another story ( and CString is more useful than basic_string overall ).
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
if(_istupper(yousaid.GetAt(current_pos)) is the correct, characterset and locale independent way to do it in VC++.
|
|
|
|
|
hi,
Please help, I am developing an activex control which is embodied in HTA file. This control has a menu bar from which I would like to invoke independent ASP page.
Does anyone know how can I load a ASP page from CDialog ?
(Choose Raports from menu and Archive from submenu --> load ASP page)
This is the last piece in my project and I am running out of time ;(
thank you,
Bartek
|
|
|
|
|
|
Thank You - that's what i was looking for
|
|
|
|
|
1. Whether there is any tool, for creation the toolbar or the bitmap to it with 256 colors or more.
The editor of resources Visual Studio creates only 16 colors.
2. How to set a transparent mask at loading the bitmap to the toolbar
|
|
|
|
|
check out this link, it does what you ask for, I'm not sure on how to designing 256 color in visual studio...
http://msdn.microsoft.com/msdnmag/issues/01/07/c/c0107.asp
hope this helps
cheers
Kannan
|
|
|
|
|
guyz!!
i have a main process in which i am loading a DLL using LoadLibrary().
there is one 'flag' defined in the main process that this DLL should toggle on being invoked.
now how do i make this variable common between the main process and the dll.
PLEASE HELP !!
|
|
|
|
|
safest thing to do is to create an exported frunction from the dll which reads/writes this variable
void SetFlag(DWORD dwFlag)
{
g_Flag = dwFlag;
}
DWORD GetFlag()
{
return g_Flag;
}
Export these two function and you should be ok.
Jeremy.
"Hey man, Taliban, Tali me Banana."
|
|
|
|
|
Here is what i want to do.....
I want to print a tree with selected nodes but not using CTreeCtrl..
Can any one tell how can i do this...
Thanks
|
|
|
|