|
KongHL wrote: Is it possible for me to display the message box and let the nxt function to process while the message box remains displayed and the user cannot close it.
You'll have to use modeless dialogs for that. Take a look at this article[^].
KongHL wrote: Another question is how can I display a dialog box ( using doModal() ) and perform a function immediately without User Interaction?
Override OnInitDialog and call the function there.
Cédric Moonen
Software developer
Charting control
|
|
|
|
|
Hmm I mean doModal(), then call a function of that dialog class immediately after the dialog is being displayed.
Is it possible?
|
|
|
|
|
you can write your funtion in OnShowWindow ;
But still it won't fulfill your purpose as you want to call the funtion after the dialog is displayed.
In that case I have two options.
First in the OnInitDialog function you call SetTimer to set time say 1 sec.
Then call your funtion in OnTimer and kill the timer in OnTimer function.
Second method is that you create a thread to call your funtion.
and start the thread in OnShowWindow.
Regards
Anil
|
|
|
|
|
_anil_ wrote: First in the OnInitDialog function you call SetTimer to set time say 1 sec.
very bad idea...!!
consider the case where you init your dialog with a database which it connection is long to establish (at least more that 1 sec)... the program will behave badly.
TOXCCT >>> GEII power
[VisualCalc 3.0 updated ][Flags Beginner's Guide new! ]
|
|
|
|
|
Yes you are right , Its a bad idea, depending on the situation.
But the programmer know what he wants, and aware of the conditions. if the condition is according to you then we can use thread instead.
But I think still I can make it to work.
<code>
void OnShowWindow(){
SetTimer(....);
return;
}
</code>
second case
<code>
void OnShowWindow(){
SetTimer(....);
return;
}
</code>
It depends on when you set the timer.
But I still agree with you that its a bad idea.
But is one of the solution depending on the situation.
Regards
Anil
-- modified at 5:25 Friday 2nd June, 2006
|
|
|
|
|
|
KongHL wrote: Is it possible for me to display the message box and let the nxt function to process while the message box remains displayed and the user cannot close it.
This goes against the concept of a message box. One way you could get this effect is to display the message box in another thread. It might be simpler to make your own modeless dialog however.
Steve
|
|
|
|
|
Delay MessageBox delays a short period of time before going to the next step of code.. But I would like to display the messagebox and continue the nxt step of code as per normal..
Am I correct to say that?
|
|
|
|
|
KongHL wrote: Delay MessageBox delays a short period of time before going to the next step of code.. But I would like to display the messagebox and continue the nxt step of code as per normal..
Create the ModelLess Dialog box!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
KongHL wrote: Is it possible for me to display the message box and let the nxt function to process while the message box remains displayed and the user cannot close it.
Please have a look on Mauro Leggieri's Background Task Dialog[^] Good luck and keep the good coding!
|
|
|
|
|
|
toxcct wrote: you could also call it from another thread...
UI Thread or worker Thread
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
i'm not good at using thread (i nenver used them yet), so i cannot say exactly where is the difference b/w them.
TOXCCT >>> GEII power
[VisualCalc 3.0 updated ][Flags Beginner's Guide new! ]
|
|
|
|
|
toxcct wrote:
i'm not good at using thread (i nenver used them yet), so i cannot say exactly where is the difference b/w them.
Kiddin, it work well from both Option!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
|
|
What is meant by bitmap planes?
SaRath
"D on't blindly follow rules you read somewhere without verifying that it makes sense for your situation!"
|
|
|
|
|
|
BitMap Plane is a Flag ,which indicates Whether the BitMap is MonoChrome(if falg is reset) or Color(if falg is set).
Appu..
"If you judge people, you have no time to love them."
|
|
|
|
|
Being a begginer, I have many problems...
Consider this situation
Suppose I am building a usefull library. One way is that I distribute it along with all the source and all the header files.... Right? Client programer will include the main header and will start using the functionality present in the library.
Other scenario, what if I only give him the header files along with lib files? How I can do that? Means what compiler options I will have to set? (Assuming I am using VC.NET 2003)
Lastly, I present here a realife example that somewhat confused me... Its the FreeType Library which is a true type rasterizer. http://www.freetype.org
There are two distributions, one is the source of the library, and the other is library in usable form.
I set my include paths as indicated by the documentation of FreeType. When I compile, I get "Uresovled symbols in function _tmain()". Ok, I figure out that either I have to provide the linker with the .lib file. Ok, I do so... All very well... Program complies and executes but terminates... It says "Cannot load library freetype6.dll".
At the next step I find the .dll library and place it in the current directory of the program. Now I compile, and execute... all very well... Program is running...
My question is that when I provided it with .lib file, FreeType library should be statically linked to my program why it requires the .dll to be accessible for the EXE?
Please explain me what are .obj and .lib and .dll files are and what is there relation to each other and how they fit togather?
Morevoer, if there is any article, book or tutorial on these issues, please let me know...
If anything seems to you stupid, please dont mind as I am a begginer...
Best regards,
Mohsin Hijazee
Polite Programmer
More Object Oriented then C#
|
|
|
|
|
Polite Programmer wrote: My question is that when I provided it with .lib file, FreeType library should be statically linked to my program why it requires the .dll to be accessible for the EXE?
No, this is not entirely true. The lib files doesn't not contain the code of the library but rather the 'prototypes' of the functions from the dll. So, you need to link with it in order to know wich are the functions from your dll. Then, of course you need to have your dll in your working folder in order to load the functions at run-time. You don't need the lib file only if you load explicitely the functions from the dll (using LoadLibrary and GetProcAddress).
Of course, you can also have lib files which contain code (so, that are not associated with a dll).
Cédric Moonen
Software developer
Charting control
|
|
|
|
|
One more major difference is .lib file comes into picture at Compile time.
Where as .dll comes into picture at Run Time.
Appu..
"If you judge people, you have no time to love them."
|
|
|
|
|
It implies that if I create a DLL, I will get a .LIB file for free? Any details or any article addressing these issues please?
Polite Programmer
More Object Oriented then C#
|
|
|
|
|
Hi,
I have a function that is declared as follows:
void func(int A, int B, int C, int D=-1, int E=-1);
arguments D and E are optional, and so if the function is called like this:
func(A,B,C); then D and E recieve the value -1.
What I want to do is add another optional argument, let's say int F that will also receive -1 as default, for example.
The problem is that sometimes I want to call the function only with the parameters A,B,C and F. If I declare the function like this:
void func(int A, int B, int C, int D=-1, int E=-1, F);
will I be able to call the function in this manner:
func(A,B,C,,,F); ?
|
|
|
|
|
SWDevil wrote: void func(int A, int B, int C, int D=-1, int E=-1, F);
will I be able to call the function in this manner:
func(A,B,C,,,F); ?
No.
Nibu thomas
A Developer
Programming tips[^] My site[^]
|
|
|
|