|
In that case, I'd look at the command value(s) that "window 1", "window 2", etc pass. These will go through the normal command routing mechanism.
I've just looked, and the first window command is
#define AFX_IDM_FIRST_MDICHILD 0xFF00 // window list starts here
You could use
ON_COMMAND_RANGE_EX (AFX_IDM_FIRST_MDICHILD, AFX_IDM_FIRST_MDICHILD + 8, MyWindowHandler)
...
BOOL CMyFrame::MyWindowHandler (UINT nCmd)
{
....
return FALSE;
}
I can't remember the exact details of the handler definition, or whether the return should be true or false, but you can do the legwork - I'm too lazy.
Probably simpler than getting a menuselect handler wrong!
Iain.
|
|
|
|
|
Thanks to you pointing me in the right direction I was able to do it in the end:
<br />
BOOL CMainFrame::OnCommand(WPARAM wParam, LPARAM lParam)<br />
{<br />
if (wParam >= AFX_IDM_FIRST_MDICHILD && wParam <= AFX_IDM_FIRST_MDICHILD + 8)<br />
{ <br />
HWND hWnd = ::GetDlgItem(m_hWndMDIClient, wParam);<br />
CMDIChildWnd* pChild = (CMDIChildWnd*)CWnd::FromHandlePermanent(hWnd);<br />
<br />
pChild->DoWhatEver();<br />
}<br />
<br />
return __super::OnCommand(wParam, lParam);<br />
}
The trick was realising that GetDlgItem() works with MDI child windows.
Thanks for your help,
Jim
|
|
|
|
|
good day to all of you!!!
by the way i have a trouble in understanding the timer botton in MFC coz im a beginner, then its really difficult for coz i dont have books, so please help me.
thank you so much.... i'll wait for ur reply
|
|
|
|
|
Are you asking what the equivalent in MFC of the VB timer event control?
AFAIK, MFC has no timer buttons.
I Dream of Absolute Zero
|
|
|
|
|
I'm working on a project that extracts the content (plain text and preferably image) of a html document and a url. Does anyone know how any method to do so?
|
|
|
|
|
It depends on what you're using. Is you're using MSHTML then you could get the text by using the innerText property on the body element. In C++ using ATL this could look something like this:
HRESULT GetText(IHTMLDocument2* pDoc, BSTR* pTextOut)
{
if ( pTextOut == NULL )
{
return E_POINTER;
}
*pTextOut = NULL;
CComPtr<IHTMLElement> spBody;
HRESULT hr = pDoc->get_body(&spBody);
if ( FAILED(hr) )
{
return hr;
}
return spBody->get_innerText(pTextOut);
}
To get the images you can use the IHTMLDocument2::get_images method.
NOTE: I haven't tried this code!
Steve
|
|
|
|
|
Hmm how do i get the images from IHTMLElementCollection? I shld use image rite but what parameters do I have to pass?
|
|
|
|
|
How do i extract text from MS word? It would be better if the end user does not need to have microsoft office installed.
|
|
|
|
|
The words from .doc file???
|
|
|
|
|
Well, try searching for any character with an ASCII value of between 32 and 128 (i think thats right, the characters that can be typed on a keyboard, but just check it before you do)
|
|
|
|
|
|
What i need is to convert a microsoft words document to a text file. How can I do this without having microsoft office? If not, using library in microsoft office is fine but how?
|
|
|
|
|
Geez. Open the document, parse it, but discard any formatting information - just keep the text. Write the text to a file. Done.
WHY, do YOU think, "Office-to-anything-else" converters are so freaking expensive?
Cheers,
Sebastian
--
Contra vim mortem non est medicamen in hortem.
|
|
|
|
|
|
From now on, questions are answered at a rate of 40 EUR/h.
Answering your last question would take around 6-12 months. Should I go ahead?
Seriously, if you really want to do it, you will have to analyze the file yourself. I aint got no clue how Word hides its content.
Cheers,
Sebastian
--
Contra vim mortem non est medicamen in hortem.
|
|
|
|
|
I could recommend www.wordcnv.com[^] - these guys have fastest library, which can be supplied in a small (<50K!) lib file, and their support is great. I'm using their library myself.
Igor Green
http://www.grigsoft.com/ - files and folders comparison tools
|
|
|
|
|
like others wrote, you need to do your own reverse engineering on the Word format to extract the text; which is no walk in the park.
I'm certain that if you google enough you might find something interresting on the subject.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
Without using Word, you'll need to know the format of a .doc file. See http://www.wotsit.org/[^] for this.
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli
|
|
|
|
|
hi
Just type this in your VC project
void operator: (int kd)
{
}
Some time u may need to compile..
The visual studio will disappear ..
regards
krishnan
If u can Dream... U can do it
|
|
|
|
|
|
if u save that in some cpp file.. Then u can never able to open Your project.
If u can Dream... U can do it
|
|
|
|
|
|
He was trying to crash VS.NET 2003...
I'd say thats Intellisense at work, trying to interpret that code, not able to and, thus, subsequently tearing VS.NET down.
Cheers,
Sebastian
--
Contra vim mortem non est medicamen in hortem.
|
|
|
|
|
it does not matter what he was trying to do, if the editor disappears because you type something then it is a bug.
I guess it could be related to intelli-sence.
|
|
|
|
|