|
Sending a WM_LBUTTONDBLCLK like that won't do anything. This is because you haven't specified the position where the mouse is double clicked (look at the documentation for the WM_LBUTTONDBLCLK message). It appears to work for a list box, because a list box never removes the selection. If a click doesn't hit anything, it doesn't change the selection. However, for a list-view control, if a click doesn't hit anything, then the selection is removed, hence GetNextItem(-1,LVNI_SELECTED) returns -1.
Hope this helps,
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"
|
|
|
|
|
Thanks Ryan!
I've implemented the following and it is working great!
// Setup a post message with mouse x&y pointed to the selected item
pListCtrl =
(CListCtrl *)pThis->GetDlgItem(IDC_LIST_OPTION_SOURCES_REPORT);
pListCtrl->GetItemRect(pThis->m_OptionSourcesIdx,&rect,LVIR_BOUNDS);
lParam = MAKELPARAM(rect.left,rect.top);
pListCtrl->PostMessage(WM_LBUTTONDBLCLK,0,lParam);
I see you also were most helpful to others that night answering posts all night long! Great job - you efforts are most appreciated!
-K
|
|
|
|
|
You're welcome
kyndestad wrote:
I see you also were most helpful to others that night answering posts all night long! Great job - you efforts are most appreciated!
I enjoy helping people . I will point out, though, that I'm 12 hours ahead of the CP servers, so night time is actually my day time
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
At the moment I'm trying to write an Office XP (specifically PowerPoint) add-in based on the excellent article by Amit Dey http://www.codeproject.com/com/outlookaddin.asp[^]
When I try to use the import directive to add MSO.DLL to the project I get the following linker error.
StdAfx.obj : fatal error LNK1179: invalid or corrupt file: duplicate comdat "_IID_CanvasShapes"
The build environment is VC6 SP5, with Office XP, SP1.
Any Ideas?
If you can keep you head when all about you
Are losing theirs and blaming it on you;
If you can dream - and not make dreams your master;
If you can think - and not make thoughts you aim;
Yours is the Earth and everything that's in it.
Rudyard Kipling
|
|
|
|
|
Solved the problem, was missing an .olb file,
I think I'm just having one of those days after working out what I'd done I realised that I'd made a spelling mistake in the .rgs file
If you can keep you head when all about you
Are losing theirs and blaming it on you;
If you can dream - and not make dreams your master;
If you can think - and not make thoughts you aim;
Yours is the Earth and everything that's in it.
Rudyard Kipling
|
|
|
|
|
I would like to create a COM object with all my ADO methods. I then would like to have Visual Basic pass a recordset pointer to my COM DLL. Is this possible? If so how would I go about it?
Thanks
|
|
|
|
|
I would like to create a COM object with all my ADO methods. I then would like to have Visual Basic pass a recordset pointer to my COM DLL. Is this possible? If so how would I go about it?
Thanks
|
|
|
|
|
Hi,
I am developing an application with Visual C++ 6.0.
In the Visual C++ IDE, I can run my application in debug mode.
However, I can't run it in release mode.
How can I correct this behavior ?
Thanks,
Claude
|
|
|
|
|
|
Hi,.
I have a Visual C++ 6.0 application. I have saved numerous files with this
application with the Doc/View architecture of MFC.
I want to add variables to save and retreive. I know that we can have
version number in the context of serialization with IMPLEMENT_SERIAL(CMyDoc,
CDocument, version).
Does it creates a problem to change DECLARE_DYNCREATE to DECLARE_SERIAL in
the CMyDoc ?
Thanks,
Claude
|
|
|
|
|
Gagnon Claude wrote:
Does it creates a problem to change DECLARE_DYNCREATE to DECLARE_SERIAL in
the CMyDoc ?
No, it should work just fine. DECLARE_SERIAL() incorporates DECLARE_DYNCREATE() plus serialisation.
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"
|
|
|
|
|
Hi,
I wish to have two different views of the document (in a MDI app) but with different menus for each view.
I basically want to use a class A and use it for different methods. Each method
would require a different view and different options - hence a new menu system.
I have two class extensions of the view and do AddDocTemplate for each new template.
However it only brings up the dialog to choose the view if the IDR menu resource is the
same.
When I use the same menu for each call to new CMultiDocTemplate it works as wanted
except that the menu is the same. I don't want to dynamically carve the menu at runtime
so there must be any easier way.
Does anyone know what I am doing wrong?
Regards,
flip
|
|
|
|
|
I've used a solution from an article on this site: http://www.codeproject.com/docview/replacingview.asp[^]. To change the menu as well, just call AfxGetMainWnd()->SetMenu(pMenu) .
Hope this helps,
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"
|
|
|
|
|
Thanks Ryan.
That worked. I just put
HMENU hMenu = ::LoadMenu(NULL,MAKEINTRESOURCE(IDR_MYNEWMENU));
::SetMenu(AfxGetMainWnd()->GetSafeHwnd(),hMenu);
::DrawMenuBar(AfxGetMainWnd()->GetSafeHwnd());
in OnInitialUpdate() in the (second) doc.
I just mistakenly thought that specifiying a unique view and a unique menu resource in an MDI app with document templates should work the way I intended.
|
|
|
|
|
flip wrote:
That worked
Good
flip wrote:
I just mistakenly thought that specifiying a unique view and a unique menu resource in an MDI app with document templates should work the way I intended
Unfortunately, it doesn't
Well I've never got it to work, anyway
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"
|
|
|
|
|
Hello
I'm writing an application which needs to be run in Systray. This systray icon has a popup menu attached with it. The problem after activating that menu if I click on any other application or any other part of desktop the menu is not deactivated. It's only deactivated if I choose one of the menu elements. I'm using MFC dialogs and my class is subclassing CDialog. I'm creating invisible window in this class. I'm not able to solve this problem.
If anyone knows how to solve this problem please help me with an example.
anxiously waiting for reply
Thanks in advance
Hari.
|
|
|
|
|
|
This is documented in the MSDN docs. The solution is to set your hidden window to be the foreground window before calling TrackPopupMenu() and send a dummy message to your window afterwards:
SetForegroundWindow();
menu.TrackPopupMenu(TPM_LEFTBUTTON | TPM_RIGHTBUTTON, point.x, point.y, this, NULL);
PostMessage(WM_NULL); Hope this helps,
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"
|
|
|
|
|
My Program is trying to open a file, I it comes back with a CFileException::sharingViolation, Is there any way i can find our the process that has the file open/locked?
|
|
|
|
|
|
Thank you, I Used this to work out what was holding the file open, But what i was hoping for was to be able to report from my program the PID of the Naughty Process.
|
|
|
|
|
|
IHTMLWindow3::get_screenLeft(),IHTMLWindow3::get_screenTop() and IHTMLElement2::getBoundingClientRect() seem promising, but i had difficulties to make them work with iframe elemens TIA
|
|
|
|
|
While creating my owner-drawn button class I encountered such a mmm... problem.
E.g. when you launch your app in Visual Studio you can press a button on the toolbar or Ctrl+F5. In the first case standard Windows buttons doesn't draw the focus rectangle untill you press the Tab button, but in second case they draw that damn rect.
How can I do the same.
|
|
|
|
|
I would like to be able to create a CFrameWnd derived class that doesn't need a toolbar. Right now I have a single doc/view architecture and if I remove IDR_MAINFRAME (default menu item), I get an error about not being able to create an empty document. How does one get rid of the toolbar?
Cheers,
Clint
|
|
|
|