|
i have an MDI application and I am able to save the Document . Now before the Document is saved and the FileDialog invoked i need to save some parameters . If i implement "ONFileSave()" in my view class I no longer get the File Dialog prompt.
I need to be achieving both .
1. Saving my changes
2. Then call the default save mechanism of windows
Also in the FileDialog that appears how do I specify the type of the File (i.e File FIlter). I want my documents to be saved with my custom File extension .
Please help
|
|
|
|
|
(Not sure) Try calling your document's OnFileSaveAs message handler inside yours.
If this does not work, Nish has written an article that may help you: CDocument::DoSave revealed[^].
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
i am having a window hwnd and i want to get its child window hwnd that has keyboard focus.
how to get it
r00d0034@yahoo.com
|
|
|
|
|
|
How do I determine the default browser of an NT-based (that is, NT 4/2k/XP/.NET) system? Is there an API call?
Actually, the simplest solution is to call ShellExecute() and just launch the HTML file. Is there a way to get an HWND for a console application?
Barring that, I need to determine the default browser, launch it, and have it open a specified URL.
Jon Sagara
If you think of wheat fields as questionable metaphors, you can think of me as the state of Kansas.
-- Mike Blaszczak
|
|
|
|
|
I'm going to create a temporary window (::CreateWindow()), and then use that to call ShellExecute(). Can anyone see any problems with this strategy? Is there a better way to do this?
Jon Sagara
If you think of wheat fields as questionable metaphors, you can think of me as the state of Kansas.
-- Mike Blaszczak
|
|
|
|
|
It appears you can just pass in NULL for the HWND.
Jon Sagara
If you think of wheat fields as questionable metaphors, you can think of me as the state of Kansas.
-- Mike Blaszczak
|
|
|
|
|
I've looked at the MSDN example, but the pEnum->Next function returns S_FALSE which means that the number of filters that were requested to be enumerated, wasn't enumerated.
IGraphBuilder *pGraph = NULL;
IEnumFilters *pEnum = NULL;
IBaseFilter *pFilter = NULL;
ULONG cFetched;
HRESULT err;
<br>
CoInitialize(NULL);
err = CoCreateInstance(CLSID_FilterGraph, NULL, CLSCTX_INPROC_SERVER, IID_IGraphBuilder,(void**)&pGraph);
pGraph->EnumFilters(&pEnum);
<br>
while((err = pEnum->Next(1, &pFilter, &cFetched)) == S_OK)
{
FILTER_INFO fiFilterInfo;
char szFilterName[256];
pFilter->QueryFilterInfo(&fiFilterInfo);
WideCharToMultiByte(CP_ACP, 0, fiFilterInfo.achName, -1, szFilterName, 256, 0, 0);
SendMessage(GetDlgItem(ghWnd, IDC_FILTERS), LB_INSERTSTRING, -1, (LPARAM)szFilterName);
fiFilterInfo.pGraph->Release();
pFilter->Release();
}
<br>
pEnum->Release();
pGraph->Release();
CoUninitialize();
}
All help is apprecaited! Thanks all
-Rune Svendsen
|
|
|
|
|
Try calling pEnum->Reset(); before enumerating.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Didn't work thanks anyway man.
-Rune SVendsen
|
|
|
|
|
Wait... Seems you're constructing an IGraphBuilder and then enumerating its filters, but an empty IGraphBuilder won't have any. Try using for instance IGraphBuilder::RenderFile on some .avi prior to enumeration.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Thankyou i'll try that. But do you know if there's a way to enumerate all the available filters on the current machine?
-Rune Svendsen
|
|
|
|
|
I am trying to do something and the part that sounds the simplest is turning out to the hardest. I am putting a button on a toolbar. What this button will do is allow a user to set the button up to point to an executable. For instace, if the user wants this button to launch solitaire, it goes through the process of having the user find the .exe file. This is simple. The hard part is I am trying to use the icon from the .exe file as the bitmap for my button. And I cannot figure out how to do it. Any ideas? I have looked on this website but haven't found anything, it might be that I don't know where to look exactly...
|
|
|
|
|
Look for ExtractIcon in the documentation.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
In addition to Joaquín's suggestion, you may also want to look at ExtractAssociatedIcon documentation.
Roger Stewart
"I Owe, I Owe, it's off to work I go..."
|
|
|
|
|
I have a dialog app that uses timers. It updates fine at first, but then after running for a while it some times doesn't draw all the objects that are on the page. Also, the drop down arrows becomes 6s and some of the buttons just completely disappear. I thought there maybe the system was too busy, but I?ve looked and there is lots of idle time.
Anybody have any clues as to why this is happening? I?m hoping I don?t have to take over drawing each and every object, but if I have to how?
Thanks all!
|
|
|
|
|
Almost surely you're leaking GDI objects (could be fonts, DCs, brushes, etc.) Follow this trail.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I really haven't done anything with DC or painting or really any kind of handling of drawing.
One think though...I'm using ButtonST from this site...any problems with that?
HELP!!!!!!
|
|
|
|
|
I don't think it is CButtonST , which seems a thoroughly tried control. What exactly are you doing in your OnTimer ? If the code for this handler is short enough maybe you could post it here.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
This is one of the smaller timers that I use. Most of the timers are like this one with the exception that they have many more items to check.
if(nIDEvent == 1122)
{
for(short i = Temp_RX; i<(Perm_DR+1); i++)
{
m_mcontrol[i].m_MouseOnButton = iControlstatus[i];
m_mcontrol[i].Invalidate(TRUE);
m_mcontrol[i].UpdateWindow();
}
}
Thanks for the help, much appriciated.
|
|
|
|
|
This is weird! To make sure the problem does not lie in CButtonST , you might want to replace it (for testing purposes) with standard CButton (you'll have also to comment out the code specifically related to CButtonST ). If the error persists, the problem is elsewhere.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Hello
I'm trying to run a program from inside my program. I thought that createprocess would be the best way to go. But i'm having a hard time trying to figure it out please help
|
|
|
|
|
try this:
STARTUPINFO siInfo;
PROCESS_INFORMATION piInfo;
siInfo.cb = sizeof(STARTUPINFO);
siInfo.lpReserved = 0;
siInfo.lpDesktop = NULL;
siInfo.lpTitle = NULL;
siInfo.dwFlags = STARTF_USESHOWWINDOW;
siInfo.cbReserved2 = 0;
siInfo.lpReserved2 = NULL;
CreateProcess("F:\\path\\program.exe", "", NULL, NULL, false, NORMAL_PRIORITY_CLASS, NULL, "F:\\path\\", &siInfo, &piInfo);
|
|
|
|
|
thank you i'll try it. what include statements do i need to show
Richard
|
|
|
|
|
Have you ever tryed:
WinExec ("CMD.EXE /C PROGRAM_NAME.EXE",SW_SHOW);
Much easier
|
|
|
|