|
send UI instance (this) into thread as parameter
|
|
|
|
|
I have a dialog that make some validation when a user clicks OK. If the validation fails, the dialog tells the user, and must not close. How can I make a dialog not close when the user clicks OK.
Michel
It is a lovely language, but it takes a very long time to say anything in it, because we do not say anything in it, unless it is worth taking a very long time to say, and to listen to.
- TreeBeard
|
|
|
|
|
if you don't call the CDialog::OnOk in your own OnOK, the dialog won't close.
-c
A conclusion is simply the place where someone got tired of thinking.
|
|
|
|
|
tx Chris
Michel
It is a lovely language, but it takes a very long time to say anything in it, because we do not say anything in it, unless it is worth taking a very long time to say, and to listen to.
- TreeBeard
|
|
|
|
|
Hi I'm using ShellExecuteEx to print the files..
for some files, I got error message saying "file association not found".
So I went to the directory where the file got saved and I set the associate editor by doing so,
click once on file name, right click, open with, choose the application or exe file ( notpad, wordpad,excel...etc.).
lets say, text document, so I open with notepad... it fine for once but not for next text file. I have to repeat the setting editor again...
Is there anyway that I can set the file editor programmatically???
can ShellExecuteEx do so??
|
|
|
|
|
When you right-click the file and select "open with, choose program", you can select the program to open the file with. On this same dialog box, there should be a checkbox to set, asking "Always use the selected program to open this type of file". Make sure this is checked and you shouldn't have any more problems.
ShellExecuteEx will not allow you to set associations. I'm assuming that you could change registry keys, but I'm not sure what, where, or how.
|
|
|
|
|
Hello,
I have a program works fine in Windows XP/2K but having a lot of problem with Windows 98/ME after I've created couple hundred bitmap and inserted to a image list. I do not think it's because not enough memory since I create and destroy them one by one. I sure walk thought the program and I've released all image handle properly.
I also notice that some font has changed to the fixed font and cannot create window after the problem occur. I believe there's some kind of memory leak which only occur in Windows 9x. I used Purify but can't find any leak.
Do you have any clue what's going on? I'm guessing that I forget to release some handle in my program so Window 9x can't let me create font and window? Is there any program runs in Windows 9X shows me how many bmp, font etc handle holding in a program?
Thanks,
Hiusing
|
|
|
|
|
Sounds like a GDI resource leak to me! Some usual indications are: fonts start changing, things do not repaint correctly, and window creation fails.
Posting the code snippets of how you create and destroy the bitmaps may help us help you determine if they actually are being destroyed and freed correctly.
BTW: the resource leak could be with some other GDI code as well...
Peace!
-=- James (Sonork:100.21837)
"There is nothing worse than being oblivious to the fact that you do not know what you are doing."
[Get Check Favorites 1.5 Now!]
|
|
|
|
|
Hiusing wrote:
I do not think it's because not enough memory since I create and destroy them one by one. I sure walk thought the program and I've released all image handle properly.
I am afraid that is not the case. W2000 catches these things and cleans them for you, this is a classic case of bitmaps or other GDI resources not being cleaned up properly.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
|
Which function can allow me to add text in RichEdit MDI acpplications like the ReplaceSel function does?
|
|
|
|
|
I've looked through MSDN and think it's only way do do this.
Set the selection where you want to insert text (SetSel) and call ReplaceSel to insert text.
|
|
|
|
|
If you are asking specifically about Rich Text you need to use the EM_STREAMIN message with the SFF_SELECTION flag to be able to add Rich Text to the control (you can also use it to add plain text, too).
Otherwise, why are you trying to duplicate the functionality of ReplaceSel(...) ?
Peace!
-=- James (Sonork:100.21837)
"There is nothing worse than being oblivious to the fact that you do not know what you are doing."
[Get Check Favorites 1.5 Now!]
|
|
|
|
|
I have some code like so
void FooFunc( )
{
class Bar {
std::string name;
std::info;
};
std::vector<Bar> barVec;
}
Looks good to me, right ?
Not according to Visual C++ (VC6 sp5)!
I get this:
error C2926: 'class FooFunc::Bar' : types with no linkage cannot be used as template arguments
Grrr! Is this correct? Or is this just some missing functionality in the compiler ? If so, is it fixed in VC7?
Certainly not a critical thing just annoying
¡El diablo está en mis pantalones! ¡Mire, mire!
|
|
|
|
|
I did not think you could define a class within a function ?
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
Yes you certainly can. I have done this before, just never used it in a template till today.
¡El diablo está en mis pantalones! ¡Mire, mire!
|
|
|
|
|
I think there's some < and > missing !
Max.
|
|
|
|
|
reply, yeah I forgot to use the gt and lt symbols in the post, I fixed it - thanks for pointing that out
¡El diablo está en mis pantalones! ¡Mire, mire!
|
|
|
|
|
You need to "fill" the type for the vector template, that's all:
std::vector<Bar> barVec;
|
|
|
|
|
I did - I just forgot to use the gt and lt symbols in the html post - what you have in your reply i have in my code and it still bombs out. Weird
¡El diablo está en mis pantalones! ¡Mire, mire!
|
|
|
|
|
You're missing a semicolon after the class definition.
Dave
|
|
|
|
|
oops, I am a sloppy poster - I fixed hte original post - in the code I had the closing semi-colon and still it gave me the error
¡El diablo está en mis pantalones! ¡Mire, mire!
|
|
|
|
|
This isn't supported in V6 and I even think V7.
Solutions?
Move the class outside of the function.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
Looking up the error code explains the problem.
But here is something to think about: Is the reason you are getting the error code because the "template code generator/expander" will only generate code once for a given template and template-argument(s)?
Meaning, given the following code:
<br />
class CClassA<br />
{ <br />
std::vector< long > m_vecLongs;<br />
};<br />
class CClassB<br />
{ <br />
std::vector< long > m_vecMoreLongs;<br />
};<br />
-Does the "code generator" evaluatate and generate code twice, once for each std::vector< long > or does it generate the code one time, and reuse it when it sees that it has already generated the code for that specific template/template-argument before?
If the latter, it explains why the error occurs: there would be no way for the "code generator" to know if a local type called Bar is the same as another local type called Bar someplace else. With external linkage, it has the mangled name (which uses classes/structs) to identify one over the other. I do not believe that local identifiers get mangled.
Just a thought...
Peace!
-=- James (Sonork:100.21837)
"There is nothing worse than being oblivious to the fact that you do not know what you are doing."
[Get Check Favorites 1.5 Now!]
|
|
|
|
|
This is explictly banned in the standard: local classes cannot be used as template arguments (so this time it is not VC++ the one to blame).
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|