|
In the app after mainframe creation
m_poMainFrame->SetMenu(NULL);
In a custom CMdiClient intercept and eat
ON_MESSAGE(WM_MDISETMENU , OnMDISetMenu )
ON_MESSAGE(WM_MDIREFRESHMENU, OnMDIRefreshMenu)
|
|
|
|
|
HI joey Bloggs!
thank you for your reply!
i add the SetMenu(NULL).it works!@thank you very much,
but still has problems..
I add the micros to the ChildFrame as you metioned manually(there isn't WM_MDISETMENU message in my class wizard of VC6)as follow:
in the childfrm.cpp:
BEGIN_MESSAGE_MAP(CChildFrame, CMDIChildWnd)
ON_MESSAGE(WM_MDISETMENU , OnMDISetMenu )
ON_MESSAGE(WM_MDIREFRESHMENU, OnMDIRefreshMenu)
END_MESSAGE_MAP()
and int the childfrm.h i add :
afx_msg void OnMDIRefreshMenu();
afx_msg void OnMDISetMenu();
but int the functions OnMDISetMenu() and OnMDIRefreshMenu(),it can't receive the message WM_MDISETMENU and WM_MDIREFRESHMENU!
could you explain it detailedly?
thanks a lot!
|
|
|
|
|
It's not ChildFrame it's MDIClient that you need to customise
class CMdiClient : public CWnd<br />
{<br />
.<br />
.<br />
.<br />
afx_msg LRESULT OnMDIMaximize (WPARAM wParam, LPARAM lParam);<br />
afx_msg LRESULT OnMDIRestore (WPARAM wParam, LPARAM lParam);<br />
afx_msg LRESULT OnMDISetMenu (WPARAM wParam, LPARAM lParam);<br />
afx_msg LRESULT OnMDIRefreshMenu(WPARAM wParam, LPARAM lParam);<br />
}
Then make CMdiClient a member of MainFrame and subclass it in the create
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)<br />
{<br />
if (CMDIFrameWnd::OnCreate(lpCreateStruct) == -1)<br />
{ <br />
return -1;<br />
}<br />
<br />
if (!m_oMdiClient.SubclassWindow(m_hWndMDIClient))<br />
{<br />
MYTRACE(_T("Failed to subclass MDI client window\n"));<br />
return -1;
}<br />
-- modified at 1:53 Tuesday 11th April, 2006
|
|
|
|
|
Hai,
I am struggling, not able to put IStream object into IDataObject.Here is the code snippet.I get error at set data line as Access Violation.Pls help me
LPDATAOBJECT pDO ;
FORMATETC fmtetc = {0};
fmtetc.cfFormat = CF_TEXT;
fmtetc.dwAspect = DVASPECT_CONTENT;
fmtetc.lindex = -1;
fmtetc.tymed = TYMED_ISTREAM;
fmtetc.ptd = NULL;
//STGMEDIUM definition
STGMEDIUM medium = {TYMED_ISTREAM,NULL,NULL};
medium.tymed = TYMED_ISTREAM;
medium.pstm->AddRef();
//error in this line during execution
pDO->SetData(&fmtetc,&medium,TRUE);
Saravana Kumar
|
|
|
|
|
saravana pandy wrote: STGMEDIUM medium = {TYMED_ISTREAM,NULL,NULL};
medium.tymed = TYMED_ISTREAM;
medium.pstm->AddRef();
Where is pstm set - It should be a pointer to a stream. I would think this code would crash when you call AddRef as you're calling it on a NULL pointer.
Steve
|
|
|
|
|
Yes the progam crashes at that point.
How to set the pointer to the Stream.
If i give the pointer to the stream it throws error as
'initializing' : cannot convert from 'struct IStream' to 'struct HBITMAP__ *'
I just give like this:
LPSTREAM lpStream = NULL;
.
.//Write some data into stream
.
STGMEDIUM medium = {TYMED_ISTREAM,lpStream,NULL};
medium.pstm = lpStream;
Saravana Kumar
-- modified at 7:23 Saturday 28th January, 2006
|
|
|
|
|
Here's how I'd do it:
STGMEDIUM medium;
medium.tymed = TYMED_ISTREAM;
medium.u.pstm = lpStream;
lpStream->AddRef();
medium.pUnkForRelease = NULL;
Steve
|
|
|
|
|
Hai stephen,
Thanks for reply.
Wht is that medium.u.pstm?
I dnt get any thing called medium.u
Instead i set value as
medium.pstm = lpStream
lpStream->AddRef();
It gives me the same exception as access violation at
LPDATAOBJECT pDO;
FORMATETC fmtetc = {0};
fmtetc.cfFormat = CF_TEXT;
fmtetc.dwAspect = DVASPECT_CONTENT;
fmtetc.lindex = -1;
fmtetc.tymed = TYMED_ISTREAM;
fmtetc.ptd = NULL;
//Access violation exception 0xC0000005
pDO->SetData(&fmtetc,&medium,TRUE);
Can u please point out where i am going wrong?
Thanks for ur help.
Saravana Kumar
|
|
|
|
|
Did you NULL out "pUnkForRelease" and set "tymed" like in the code below?
STGMEDIUM medium;<br />
medium.tymed = TYMED_ISTREAM;<br />
medium.pstm = lpStream;<br />
lpStream->AddRef();<br />
medium.pUnkForRelease = NULL;<br />
Steve
|
|
|
|
|
Yes.Here is the code part using IDataObject:
LPDATAOBJECT pDO;
//FORMATETC definition
FORMATETC fmtetc = {0};
fmtetc.cfFormat = CF_TEXT;
fmtetc.dwAspect = DVASPECT_CONTENT;
fmtetc.lindex = -1;
fmtetc.tymed = TYMED_ISTREAM;
fmtetc.ptd = NULL;
//STGMEDIUM definition
STGMEDIUM medium ;
medium.tymed =TYMED_ISTREAM;
medium.pstm = lpStream;
lpStream->AddRef();
medium.pUnkForRelease = NULL;
pDO->SetData(&fmtetc,&medium,TRUE);
Is there any thing i have to add before setdata()?
Saravana Kumar
|
|
|
|
|
I can't see anything obviously wrong here. Can you send the machine code around the instruction that is causing the crash and a stack trace?
Steve
|
|
|
|
|
i have to give a presentation on any rescent trends in IT... can anyone suggest a good title... thanks-V.G
|
|
|
|
|
"Beauty & the Beast" (lucrative but dangerous)
"Earn like kings & live like Queens" (more salary, posh living)
"Respected Career" (b4 only docs & engrs were respected, now IT guys also)
Best Regards,
Bobby
|
|
|
|
|
Hi,
I'm running this package at http://www.codeproject.com/audio/featuretracking.asp in visual studio.net and encountering the following problem:
c:\featuretracking_src\Tracker.rc(436): fatal error RC1015: cannot open include file 'res\Tracker.rc2'.
Please help.
Thanks & Regards
Anish chowdhri.
|
|
|
|
|
Look for the file "c:\featuretracking_src\res\Tracker.rc2". Is it present?
Steve
|
|
|
|
|
Hi Steve,
Thanks for your response.
When I downloaded this package it did not have any 'res\Tracker.rc2'.
But when I try to run this package it certainly asks for it.
Is the file missing from the package?
<<if you="" want="" can="" have="" a="" lok="" at="" the="" package="" "http:="" www.codeproject.com="" audio="" featuretracking.asp"="">>
Thanks & Regards
Anish chowdhri.
|
|
|
|
|
|
Hi Steve,
Thanks for your help. I too think that a file is missing from the package. But there is no such comment on the page where this package is released. There are only +ve comments.
Please help.
Thanks & Regards
Anish chowdhri.
|
|
|
|
|
Is there a way to make an output such as
<code>Cout << "your message here" << endl;</code>
look as if it were being slowly typed out instead of just poping up instantly? like perhaps putting a pause between each letter? I know my post is a little grey,Thanks for your time!
Fresh picked coder
-- modified at 18:18 Friday 27th January, 2006
|
|
|
|
|
Output one letter at a time with a call to Sleep() inbetween each leter.
cout << 'y';
Sleep(50);
cout << 'o';
Sleep(50);
...
cout << endl;<pre>
<hr>
"You're obviously a superstar." - <small> Christian Graus about me - 12 Feb '03</small>
"Obviously ??? You're definitely a superstar!!!" - <small>mYkel - 21 Jun '04</small>
"There's not enough blatant self-congratulatory backslapping in the world today..." - <small>HumblePie - 21 Jun '05</small>
Within you lies the power for good - Use it!
|
|
|
|
|
|
If you want this behaviour on more places, you should create a new output stream that accepts strings like your example and internally pauses between outputting each letter. The basic idea is the following:
class StdOutWithPause
{
public:
StdOutWithPause& operator << (const char* pszArg)
{
for( int i = 0; i < strlen(pszArg); i++ )
{ std::cout << pszArg[i]; Sleep(100); }
return *this;
}
};
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
We have a need to change the title bar of our SDI application. I have successfully used the Dundas Ultimate Toolbox 9 COXCaptionPainter and COXCaptionInfo classes to achieve this. I have resolved issues I faced with title bar changing back to Windows style look when the application window loses focus or is partially covered by another window etc. The one problem I am now wrestling with is while displaying modal windows such as the "About box" or "File Open". In these situations, the parent SDI window title goes back to its native Windows style look! Since the parent message loop does not execute when a modal window is displayed, how can I ensure the parent title bar is painted correctly? Any help will be appreciated.
Thanks,
Ganesh
|
|
|
|
|
hiho@ll
what i'm interested in:
zonealarm opens a window if a "unkown" app wants to access the internet and asks if this app is allowed to do this
spybot does the same for the registry. if a app wants change the registry a window is opened to ask the user if this is allowed
btw: i'm not only interested in how do zonealarm and spybot know such stuff (that a app wants to change something), how can zonealarm or spybot can decide if the app is allowed or not? how can zonealarm control what the other apps are allowed to do?
how does such stuff work?
does it work for everything? (control of hardware and every software e.g. check if a specific function of a dll should be called?) is it a hook? if yes, how do they work? (a hint should do it)
thx@ll
-- modified at 14:58 Friday 27th January, 2006
|
|
|
|
|
Not exactly what you want, but I think it will show you how to control process creation system-wide, using hooks. Clickety
"Success is the ability to go from one failure to another with no loss of enthusiasm." - W.Churchill
-- modified at 5:38 Saturday 28th January, 2006
|
|
|
|