|
|
Hi all,
I wrote an editor type program, that uses a dialog box as its main window. I would like the program to return immediately, but the dialog box to remain active. I have tried to use "Create" and "ShowWindow" in the "InitInstance" which works fine, except that the dialog box is immediately destroyed when the program terminates.
How can I achieve this?
Thanks in advance
William
PS
I have already tried "SetParent (NULL)" to change the parent of the dialog to the desktop, but this did not have any effect at all.
W
|
|
|
|
|
Try calling another time your own programm in a second instance (with a m_bAlreadyOpened variable to make a sleep or avoid the return) before returning on the first one.
But what happens to you is totally logical. If the programm ends, the windows disappear. If not, any message called from the dialog would end in an error because there is nothing to answer him, or assertions or something like that.
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
Consider to write 2 programs or why do you need to habe the dialog if your program terminates?
Greetings from Germany
|
|
|
|
|
William Engberts wrote: I wrote an editor type program, that uses a dialog box as its main window. I would like the program to return immediately, but the dialog box to remain active.
This makes no sense, as the program and the dialog box are one in the same. If one goes away, so does the other.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
True. However, I am looking for something like a normal editor: If I call for example notepad from a command box, I get the editor, but the command box is immediately available again (I immediately get the cursor back), even when the editor is still running. If I use my current program, I can only get my cursor back again in my command box by terminating the program. Therefore I intended to detach the dialog box from the program itself, which woudl enable me to terminate the program and keep the dialog box running. If this is not possible; does anyone have another solution?
Thanks in advance
William
|
|
|
|
|
You need two executables: one to do the launching (using CreateProcess() ), and the other to be launched.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
As David said, you need to use two exe's. In your example you call notepad.exe from the command box, which is cmd.exe. Internaly cmd.exe calls CreateProcess with the path to notepad.exe.
Another method you could try is not close your main window, but simply hide it.
Waldermort
|
|
|
|
|
Hi,
what is different between const char * and const char const *.
|
|
|
|
|
I would like to think the best answer to this question lies in actually coding something up and experimenting with the two to see what can and cannot be done. Has this form of research died off?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
DavidCrow wrote: Has this form of research died off?
Apparently, we're the last generation to know how to do this...
|
|
|
|
|
I hope i say it right ...
a char * is a pointer on a char-array where you can change all chars into the string.
a const char* is a pointer on a string which you can't change, because he is declared or really constant ( for example "test" is a constant string in your memory, you can't change it)
and a const char const * is even the pointer constant. That means if the pointer is initializated you can't re-use him
const char const *locked = malloc(sizeof(char)*5);
...
locked = malloc(sizeof(char)*15); --> DOESN'T WORK
I hope i don't have sayed bullshit
|
|
|
|
|
Hi ,
The second way is wrong. we cannot use same type qualifier more than once. A type declaration or definition uses a type qualifier (const, volatile, signed, or unsigned) more than once. This causes a warning with Microsoft extensions (/Ze) and an error under ANSI compatibility (/Za).
Yes U Can ...If U Can ,Dream it , U can do it ...ICAN
|
|
|
|
|
mohindar_kks wrote: what is different between const $char * and const char const * .
If you exchange const char const * with const char * const ,
'baerten' ist right.
The order of words here is only important in that one const has to be before and one after the *
Though I speak with the tongues of men and of angels, and have not money, I am become as a sounding brass, or a tinkling cymbal. George Orwell, "Keep the Aspidistra Flying", Opening words
|
|
|
|
|
Hi , I have already given explaination for that please see the post
by Shraddha Gautam 8:27 24 Sep '07
Short decription :
Pointer To constent
const char * and char const * both are same.
Constent Pointer
char * const
Const Pointer to constent
const char * const and char const * const both are same.
Hiren Thakkar
|
|
|
|
|
After a question about the MFC42.dll and one of the answers with the "dependancy walker", I would like to know if my project would have problems in other computers where Visual Studio is not installed.
I have used the dependancy walker and it says that there are 3 problems. The *.dll are:
DWMAPI.dll
MPR.dll
SHLMAPI.dll
I have tested my release version with the computer of a partner without VS in his system and it has been opened without problems and some basic functions worked too. I have just used MFC controls and commands (95% sure about this), so I guess my programm will run good in other computers with basic operating systems. But...
What are the above mentioned DLLs for? (Just curiosity)
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
Nelek wrote: DWMAPI.dll
Microsoft's Desktop Window Manager API.
Nelek wrote: MPR.dll
Microsoft's Multiple Provider Router.
Nelek wrote: SHLMAPI.dll
If you meant SHLWAPI.DLL, it is Microsoft's Shell Light-weight Utility Library.
Nelek wrote: What are the above mentioned DLLs for? (Just curiosity)
Have you tried to right-click them in Explorer and select Properties?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
"Have you tried to right-click them in Explorer and select Properties?"
yes, I tried with the dependancy walker and with the normal windows explorer under c:\windows\system32
but the information they gave told me nothing. Just the name, the version and some numbers more and the F1 help says nothing about them.
Anyways, it doesn't matters, as long as I can know, they have nothing to do with my software, so they are not going to give me any problem. When I need to know about them, I will search all I need to understand their function.
Edit: Something deleted
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
Hello to all,
i am writting such a program that, from VC++ application by using "ShellExecute" function i am opening a website and i want to send a perticular text file name from this function to the website and i want to get this text file name in php application. can anybody help me plz how this can be done? how can we send text file name through "ShellExecute" function and how can we get parameters sent through VC++ application in php application? my code is as given below,
::ShellExecute( this->m_hWnd,
"open",
"www.telemedconcepts.com/EDS/EDSLogin.php",
strTextFileName,
NULL,
SW_SHOWNORMAL);
"strTextFileName" contains name of my text file and i want to access this name in php application, how can we do it?
Thanks & Regards,
Anay Kulkarni
|
|
|
|
|
AnayKulkarni wrote: ...using "ShellExecute" function i am opening a website and i want to send a perticular text file name from this function to the website...
Unless it's part of the URL, you can't.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
hi, everybody! I face the interest challenge. I want to change the view of system buttons (but i'm speaking not about BS_BITMAP or BS_OWNERDRAW ), i'm want to view buttons with my style as soon as windows loads their (maybe subclassing or api hooks)
|
|
|
|
|
|
mitok wrote: but i'm speaking not about BS_BITMAP or BS_OWNERDRAW
mitok wrote: maybe subclassing
In general BS_OWNERDRAW and subclassing are combined to draw custom buttons. But you specified that you dont need BS_OWNERDRAW but subclassing.
My doubt is that, are you interested in window proc subclassing?
- NS -
|
|
|
|
|
thanks for answer.
i don't know exactly that i need. i use C++ and WinAPI (without MFC) and my currently task consist in creation button with own style in my application (put bmp on button, etc.), but can't use BS_BITMAP or other button style by some reasons. OS Windows must load button with my styles. I need redefine system style button only in my application.
|
|
|
|
|
mitok wrote: but can't use BS_BITMAP or other button style by some reasons.
AFAIK without BS_OWNERDRAW, customization of button will be difficult. And I am not sure about the possibilities of the window hook for this case...
Can you describe a little more about why you cant use the styles?
- NS -
|
|
|
|