|
I vote for CreateProcess() . You get a lot more info about the process you create when you use that function than with any of the other methods (ShellExecute or WinExec ).
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
I'm looking for an example how to disable standard menue items (especially the "Save as.."-method in MS-Office applications like Word and Excel) that have been started by a MFC program using the CreateDispatch method. I want to force the user to save the file with the same name and path that I used to open the file when starting the application.
Peter Fritze
|
|
|
|
|
Peter Fritze wrote: I want to force the user to save the file with the same name and path that I used to open the file when starting the application
You have an interesting problem here,
Thinking about it there are a couple of ways to accomplish what you’re looking for, but neither of them are direct or at least the little bit of searching I did revealed anything direct.
First:
Spy, the handle to that menu item and send it a disable message. I don’t know how well that would work or not.
Second:
Catch the message from DocumentBeforeSave, see examples here.
How to catch Word application events by using Visual C++[^]
Automation and Eventing with Word[^]
DocumentBeforeSave Event[^]
Hope this helps, or at least gets yea started.
I'd love to help, but unfortunatley I have prior commitments monitoring the length of my grass. :Andrew Bleakley:
|
|
|
|
|
how to provide VPN connection between client and server?
|
|
|
|
|
|
Turning from visual c++ (version6) to visual studio c++ 2005 recently i've got errors when compiling this code:
#include "mave.hpp"
template <typename T> class matrix : virtual public mave<T>
{
public:
enum enLineSolver { GAUSS, HOUSEHOLDER, GIVENS, SHOLESKY};
protected:
static enLineSolver lineSolver;
};
// Initialization of lineSolver:
template <typename T> matrix<T>::enLineSolver matrix<T>::lineSolver = matrix<T>::GAUSS;
/* With Visual C++ (Version 6) above line is translated correctly without any
message. With Visual Studio 2005 compilation fails with these messages:
warning C4346: 'matrix<T>::enLineSolver' : dependent name is not a type
e:\007-chera\006-mavex3\matrix.hpp 274
error C2143: syntax error : missing ';' before 'matrix<T>::lineSolver'
e:\007-chera\006-mavex3\matrix.hpp 274
error C4430: missing type specifier - int assumed.
Note: C++ does not support default-int
e:\007-chera\006-mavex3\matrix.hpp 274
I've tried several changes to resolve this error without success. template
is necessary because of indentifier T. matrix<T>::enLineSolver cannot
be replaced by simple int for another error then appears (different type).
*/
Any idea what's wrong?
-- modified at 9:54 Saturday 27th January, 2007
|
|
|
|
|
From the help on C4346:The typename keyword is required if a dependent name is to be treated as a type. You're using the dependent type matrix<T>::enLineSolver (meaning, it depends on the template parameter T ) so you have to add typename before it:
template <typename T>
typename matrix<T>::enLineSolver matrix<T>::lineSolver = matrix<T>::GAUSS;
|
|
|
|
|
Hi everybody.
I wanna write an application which has a database created using SQL-Server2000.
In this app I need to have a beautiful graphical user interface and on the other hand have to be able to work with the data tables in an mfc application that is created with vc 2003.(not .net)
what do you suggest?
i think a web service would help if so, can i write it with .net2.0 using c# and asp.net and use the web service with mfc 1.1?
please help me!!!!!!
Sepehr
|
|
|
|
|
How do you convert a array of bitmap bits to a HBITMAP?
I cannot seem to figure it out.
|
|
|
|
|
|
|
Hi,
i am using the function :
FindWindow(LPCTSTR lpszClassName,LPCTSTR lpszWindowName )
and i need to input the lpszClassName of my main frame window created using MFC MDI application.
anyone knows how?
tks.
|
|
|
|
|
From MSDN:
lpClassName
[in] Pointer to a null-terminated string that specifies the class name or a class atom created by a previous call to the RegisterClass or RegisterClassEx function. The atom must be in the low-order word of lpClassName; the high-order word must be zero.
If lpClassName points to a string, it specifies the window class name. The class name can be any name registered with RegisterClass or RegisterClassEx, or any of the predefined control-class names.
If lpClassName is NULL, it finds any window whose title matches the lpWindowName parameter.
You can use that parameter as NULL. and then the program will search for any window with that specific name.
If you want, you can call the functions RegisterClass or RegisterClassEx in order to set the name of that class.
Hope this helps.
|
|
|
|
|
You can use the GetClassName() API on the HWND of your main frame window to get its class name.
You can also set the class name, as Joan Murt suggested.
Mark
|
|
|
|
|
Mark Salsbery wrote: You can use the GetClassName() API on the HWND of your main frame window to get its class name.
Actually, he wanted class name to find window in question. If he had window handle, then there is no question of getting class name.
As somebody already answered, passing NULL for classname he can find window.
|
|
|
|
|
Gotcha, thanks
I was thinking if he needed the classname that MFC uses when it registers the class. Just
do it once so he'd know whe string to use in the other app. It made sense to me when I typed
the vague reply Using the title is much easier.
Thanks for the correction!
Mark
|
|
|
|
|
I have gone through the directX SDK. I am a bit confused with the routines given in the MS Visual C++ documentation of using DirectX API's. I would need a small help in getting the sequence of calling the API's to show an image(just pixel values) stored in memory.I can do it only in a plain Win32 project or MFC based project.
|
|
|
|
|
I have a CListBox that get some text. I want to go to the last input so I can see what text its comming. How can I do that?
|
|
|
|
|
Hello Larsson,
You should get the number of items using GetCount();
and then use GetText(int A, CString &CS);
Where A must be the index of the last item.
Where CS must be a receiver CString.
Hope this helps.
|
|
|
|
|
I cant get this to work, can you please typ a exemple here so I can see.
I hace try to use this,
iGo = m_AddLogg.GetCount();
m_AddLogg.GetText(iGo, sText);
But this dont make me go down in the list. Note that sText in this case is emty.
|
|
|
|
|
Larsson wrote: iGo = m_AddLogg.GetCount();
m_AddLogg.GetText(iGo, sText);
Index is zero based, so you need to use following code,
iGo = m_AddLogg.GetCount();
m_AddLogg.GetText((iGo-1), sText);
|
|
|
|
|
Weekend, sorry, I hope that the answer from prasad_som has been useful.
Good luck...
|
|
|
|
|
Please help me,
When does user insert CD into driver CD.I want my program will automatically detect and show all of them(file and folder) are showed in a listbox.
My program is written y MFC
Thank you very much.
|
|
|
|
|
You need to create an AutoRun.Inf file that will inform Windows which program to run when the CD is inserted into the drive.
You can have it run your special program with the list in it you want.
|
|
|
|
|
Forgive me is this is a stupid question, but I'm kinda new to DirectX. I'm drawing 2D images using textured quads. Is it possible to draw two textures at the same time onto a single quad? I could do this by swapping the texture and drawing the sprite twice, but surely there is a way to do this in one blow.
|
|
|
|