|
hi all
please tell me how to open microsoft word,exel using a button in vc++(MFC)
thanks
|
|
|
|
|
Use the function in thecommand handler of button submit.
Here Write.exe is the exe you want to execute.
WinExec("Write.exe", SW_MAXIMIZE);
|
|
|
|
|
use ShellCommand on button event to launch the desired application.
|
|
|
|
|
|
Hi
Accidentally i have added an action for File Folder. But i can't remove it, remove and edit are shown as disabled. How I removed that action.
the procedure i did was like
Tools->Folder Option->File Types -> select File Folder, Press Advanced and added new action
Thanks
Anil
|
|
|
|
|
Search the Action name you gave in registry under the key HKEY_CLASSES_ROOT.
The Application name should be there under command Key.
Delete the action Name key.
|
|
|
|
|
I am new to MFC. In my gui application I see that some of the controls are not visible. They become visible when I move the mouse cursor over them.
Thanks for the help....
|
|
|
|
|
Are these controls created as part of a dialog (from a resource) or are you creating them yourself?
If creating them yourself, from where in the code?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Mark,
I am creating the controls as a part of a dialog.
Let me know if you need any further information!
Thanks!!
|
|
|
|
|
hi
please check the visibilty property of each control
|
|
|
|
|
Do the controls overlap each other?
Or are you doing any painting (or drawing) in the dialog?
- NS -
|
|
|
|
|
Yes, the controls overlap each other. I have a list control which resides in a property page and the propertypage is display in a tab of a tab control.
|
|
|
|
|
Property pages should be in a property sheet, not a tab control.
For a dialog, if the controls are part of the dialog resource, you
shouldn't have to do anything to make controls appear unless they
are not created with the WS_VISIBLE style.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi,
Let suppose, there is an exe file and it has a certain output at console. Is it possible to read that console output anyway?
I would appreciate the suggestions.
Wali
|
|
|
|
|
Is it your code or some other exe? If it's some other EXE, why can't you read the console ouput?
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Let me explain what I am trying to do. I have one executable file that shows the tracking data at console as 0utput. I want to write a c++ code that can read the tracking data in loop from console. I want to use that tracking data in my own application.
I hope now the question is clear.
Wali
|
|
|
|
|
Perhaps it would be easier to understand your question if you told us exactly what you are trying to do.
Are you trying to determine how the application derives the output before it is actually written to the console?
|
|
|
|
|
Wajid Ali wrote: Is it possible to read that console output anyway?
Certainly. Read here and here.
"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
|
|
|
|
|
Thanks! I will try it soon.
|
|
|
|
|
Use > operator at command prompt. For ex. if the file name is hello.exe use
c:\hello.exe>output.txt and all the console output will be stored in output.txt file.
Now you can use this file.
|
|
|
|
|
Hi, I've got 17 error codes to #define with some "context" for them and I'm searching for a quick way to do so.
Besides writing them out "longhand" I decided to try the paste (##) operator by doing this:
<br />
<br />
#define ERROR_CONTEXT_CODE(context,code) \<br />
#define ERR_##context (code+00) \<br />
#define ERR_##context##_ERROR1 (code+01) \<br />
#define ERR_##context##_ERROR2 (code+02) \<br />
#define ERR_##context##_ERROR3 (code+03)<br />
<br />
I expect to have about 8 contexts and 17 error codes per context. The context is important because when there is an error I'd like to trace it back to the (code+0x) value so I'd be able to pinpoint the error to, say, file access vs HTTP access (or whatever the context is).
I intend to this code
ERROR_CONTEXT_CODE(FILE,7100)
ERROR_CONTEXT_CODE(HTTP,7200)
to output:
<br />
#define ERR_FILE (7100+00) \<br />
#define ERR_FILE_ERROR1 (7100+01) \<br />
#define ERR_FILE_ERROR2 (7100+02) \<br />
#define ERR_FILE_ERROR3 (7100+03)<br />
<br />
#define ERR_HTTP (7200+00) \<br />
#define ERR_HTTP_ERROR1 (7200+01) \<br />
#define ERR_HTTP_ERROR2 (7200+02) \<br />
#define ERR_HTTP_ERROR3 (7200+03)<br />
I *think* I've made my intention clear at this point.
How can I accomplish this? I was thinking of incorporating the stringize(#) and paste(##) operators to do this.
(ed-Fixed a copy/paste error in second code block)
|
|
|
|
|
How would I go about using a windows style of WS_EX_COMPOSITED with an MFC View window? (I don't want to know about other methods of double buffering, just how to set this style.)
Thanks!
|
|
|
|
|
I would recommend reading the docs for CreateWindowEx() -
specifically anything there related to WS_EX_COMPOSITED.
To use the style in MFC, specify the WS_EX_COMPOSITED extended style
when calling CreateEx() to create a window.
This style can also be set in a window class' PreCreateWindow() override.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi,
Thanks. Actually, I have already read up on that, and have no problem with WS_EX_COMPOSITED when not using MFC. However, I am not seeing the expected results when I use WS_EX_COMPOSITED with MFC. I am overriding the PreCreateWindow method for a View in a MDI Doc/View application:
BOOL CMyProgView::PreCreateWindow(CREATESTRUCT& cs)
{
cs.dwExStyle &= WS_EX_COMPOSITED;
return CScrollView::PreCreateWindow(cs);
}
but I still get flickering when I draw the window by overriding the OnDraw method. In OnDraw, I'm using a GDI+ Graphics object, and I use the Graphics::Clear method before doing my drawing. There is no flickering when NOT using MFC, even using Graphics::Clear, if the WS_EX_COMPOSITED window style is used.
I thought maybe MFC was using some conflicting window styles, but don't know. Just wondered if something more was required, such as changing some other window style(s) to be compatible with WS_EX_COMPOSITED, or something like that.
Thanks again.
|
|
|
|
|
Californian2 wrote: cs.dwExStyle &= WS_EX_COMPOSITED;
Maybe try
cs.dwExStyle |= WS_EX_COMPOSITED;
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|