|
if you want install a local hook,the instance parameter should be NULL and the last parameter is the ID of your thread
I am seeking...
For what?
Why did you ask me for what? I don't know!
|
|
|
|
|
How can I prevent the entire app directory from changing at the start of my program when someone double clicks the related file extention from windows explorer.. I'm not using the doc class. How can I prevent this b/c Its awfully ANNOYING!
-Steven
CPACodeProjectAddict
By reading this message you are held fully responsible for any of the mispelln's or grammer, issues, found on, codeproject.com.
For those who were wondering, actual (Linux) Penguins were harmed in creating this message.
|
|
|
|
|
I need to transmit the pointer of the CDialog to the parent > I am not able to set a member of the
parent because it doesnt fit with my scheme. So can I do this?
m_pParent->SendMessage(UDM_SOMETHING, this, ndummy)
?
Thanks
|
|
|
|
|
One solution is GetParent(). Another solution is AfxGetMainWnd().
Kuphryn
|
|
|
|
|
Cant do those. I am unable to include my view.h file into the cdialog.h file due to deeply entrenched circular includes...
So is SendMessage a bad idea?
|
|
|
|
|
nss wrote:
I am unable to include my view.h file into the cdialog.h file due to deeply entrenched circular includes...
But you should be able to include it in the cpp file, and just forward declare the class in the header file.
Anyway, SendMessage will work (although it is not really necessary here). You can do something like:
GetParent()->SendMessage( dlgPointerMessage, reinterpret_cast<wparam>( this ) );
And in the parent message map:
ON_MESSAGE( dlgPointerMessage, OnDlgPointerMessage )
LRESULT OnDlgPointerMessage(WPARAM wParam, LPARAM lParam)
{
CDlg* pDlg = reinterpret_cast<CDlg*>( wParam );
ASSERT_VALID( pDlg );
// Do something
return 0;
}
Dave
http://www.cloudsofheaven.org
|
|
|
|
|
Terrific! Many thanks.
I also wonder if GetParent()->RunParentFunction() would work.....I will try it. Apprecite your help greatly! I didnt know about the reinterpret_cast....
|
|
|
|
|
It won't directly because GetParent() returns a CWnd pointer. But if you know exactly what type it is, you can cast it and then call your function.
static_cast<cparentclass*>( GetParent() )->RunParentFunction();
Dave
http://www.cloudsofheaven.org
|
|
|
|
|
|
IT works!! The only thing is that I think in your earliest post with the reinterpret_cast, the <> were missing so I guessed you meant:
m_pParent->SendMessage(MSGE, ndummy, reinterporet_cast<UNIT>(this));
I did this by deducing it might be what you meant and its seems fine. Is this indeed what you intended I should do? Your post says
interpret_cast (this) but it wouldnt compile that way--- not until I put in the type to cast to.....
So is that okay or did you mean something else?
Thanks!
Appreciate your help,
ns
|
|
|
|
|
I meant to put in the angle brackets, but i forgot that CodeProject interprets them as HTML, so they got gobbled up...
Dave
http://www.cloudsofheaven.org
|
|
|
|
|
Hi all, I am trying to develop my own win32 custom button class. I was just wondering if anyone knew where there was a good article on this as I am a little stuck on handling mouse messages. I would also like to make it a bit more generic so that it did not rely on windows messaging so I could derive a class for use with DirectX to custom draw the control in the appropriate state or use GDI for windows apps. Its more the windows messaging thats the problem, unless I use TrackMouse...() I never know when to turn o the highlight state, and have other problems if I use it with WM_SETCURSOR (I can't see if the left mouse button is down). Any help or links would be invaluable,
Many Thanks,
Alan.
P.S. I'm not interested in sub-classing MFC or win32 buttons this is my own complete implementation.
|
|
|
|
|
Folks.... this is a repeat from 'General Discussion' message board, but I will not repeat in its entirety.
I asked there (and code provided) if it is possible to access using NO MFC, a dialog box with an activeX control placed on it (DataGrid)?
I have been able to access a Dialog box (nonMFC) but once a ActiveX control was placed on it, WM_INITDIALOG never gets called.
Please look in the 'General Discussions' messageboard for more details and with code provided.
Thanks to all who responded in advance!
|
|
|
|
|
Just a straightforward question: is it possible to have a virtually unlimited number of Direct3D (8) views open in an MFC/MDI application? I guess that only one drawing surface should reside in video memory at the particular time, while these of inactive views somehow get swapped to the RAM.
If you happen to know the solution, or know someone who knows - I would greatly appreciate any help with this nasty problem.
Regards,
BB
|
|
|
|
|
After closing my app the debugger reports this warning:
Warning: calling DestroyWindow in CDialog::~CDialog --
OnDestroy or PostNcDestroy in derived class will not be called.
Any ideas what can cause this? What can I be doing wrong? What should I look for to correct this? Thanks.
|
|
|
|
|
You're probably delete ing a modeless CDialog without first calling its DestroyWindow() .
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Ravi,
Thanks for the feedback. I think these are being caused from property pages of a property sheet. Does this make sence? If so how do I correctly delete pages from a sheet? Thanks!
|
|
|
|
|
Is your CPropertySheet class modeless? Or, do any of your property pages display modeless dialogs? Or both?
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Ravi,
Thanks again for a reply. It is a complicated app. It is MDI using doc/view model. The veiw of the doc/view is split (with a splitter). One pane of the splitter is a view where I create the property sheet and the property pages. So, they are modeless as I can filp thru the pages and do work in the other panes of the split view.
Craig
|
|
|
|
|
When you close the view, make sure you call the property sheet's DestroyWindow() . This should take care of the problem.
When the view gets created, do:
m_pPropSheet = new CMyPropSheet (...);
ASSERT (m_pPropSheet != NULL);
m_pPropSheet->AddPage (...);
m_pPropSheet->AddPage (...);
m_pPropSheet->AddPage (...);
When the view gets destroyed, do:
ASSERT (pPropSheet != NULL);
m_pPropSheet->DestroyWindow();
delete m_pPropSheet;
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
hi ,
Plz suggest me a book which can teach me abt Port access programming .
sukhdeep
|
|
|
|
|
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnfiles/html/msdn_serial.asp
This same article in MSDN Library contains also sample application.
|
|
|
|
|
I made an explorer bar using ATL COM. I initially made the explorer bar using the registry entries, but that doesn't meet my needs because I need to do some processing. Does anyone have advice of how I'd show an HTML page in the explorer bar? Any insight would be appreciated.
Thanks
Melinda
|
|
|
|
|
I'm replying to my own thread, heh.
I could use a HTML control and host it in the explorer bar. Then I could use IWebBrowser2::Navigate() to browse around the Internet because the HTML control has a member CComPtr<IWebBrowser2>. I read that I could use the ATL class CAxWindow<>...how do I create that as the host in the explorer bar?
Thanks.
Melinda.
|
|
|
|
|
I have an edit control which has autocomplete feature. I could activate it by calling SHAutoComplete function.
Now I would like to add an url to the history if it doesn't exist in the url history.
How can I do this ?
Orcun Colak
|
|
|
|