|
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
|
|
|
|
|
HI
Can some tell me where can I find good source for MP3 Encoder & Decoder, whether its Commercial / free
Thanks
Sansky
|
|
|
|
|
Go to http://www.mpeg.org and click the bold "MP3" link at the top of the page. Scroll about 3/4 of the way down on the resulting page, and you should see links to several MP3 encoders and decoders.
--
Paul
"I drank... WHAT?"
|
|
|
|
|
Hey all,
Having been through RFC959, I'm wondering what is SMNT command(Structure mount) for? where is it useful and how do I use it? Is it used to mount a network share or drive?what are the semantics?
TIA.
I'm an alien, I'm an alien
it's a beautiful life....
Bush
|
|
|
|
|
hi thanks for reading my post
I'm just trying to make a hello world using VC++
#include <iostream.h>
void main()
{ cout << "test/n"; }
and after a while, I came up with that *points up*
so I was very happy and one day I went home and tried it on my borland C++ so I could impress everyone and I did the same thing and it said
[Linker Error] Unresolved external '__InitVCL' referenced from D:\BORLAND C++ 5 ENTERPRISE\LIB\CP32MTI.LIB|crtlvcl
[Linker Error] Unresolved external '__ExitVCL' referenced from D:\BORLAND C++ 5 ENTERPRISE\LIB\CP32MTI.LIB|crtlvcl
[Linker Error] Unresolved external 'WinMain' referenced from D:\BORLAND C++ 5 ENTERPRISE\LIB\C0W32.OBJ
and I don't understand what it's saying. can anyone help?
|
|
|
|
|
It looks like you are using Borland C++ Builder...
Then you need to tell it that it's a console application you are making, you should be able to do that somewhere in the project settings...
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
I did tell that to the builder
I went to "new" and then in the new projects, I chose "console wizard"
any ideas?
|
|
|
|
|
If I build an application with the settings Use MFC in a shared DLL, what versions of windows and what percentages of those installations could I expect to have the required DLL's to allow my application to work?
Michael Martin
Pegasystems Pty Ltd
Australia
martm@pegasystems.com
+61 413-004-018
"Don't belong. Never join. Think for yourself. Peace"
- Victor Stone
|
|
|
|