|
you can to copy files dll in directory windows or directory application
|
|
|
|
|
Hello,
I was wondering if it is possible to implement MDI in a MFC based ActiveX control. I was able to implement SDI (using a sample from MSDN), but I faced some difficulties when implementing MDI. Any help would be highly appreciated.
Thanks in advance,
Dennis.
|
|
|
|
|
i ahve dialog and on there are picture box and i want to show popup menu when right click on picture box not on dialog but i have written a code as follows:
void CShow_ImageDlg::OnRButtonDown(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
CMenu popupMenu;
popupMenu.LoadMenu(IDR_MENU1);
CMenu* subMenu = popupMenu.GetSubMenu(0);
ClientToScreen(&point);
subMenu->TrackPopupMenu(0, point.x, point.y,AfxGetMainWnd(), NULL);
CDialog::OnRButtonDown(nFlags, point);
}
it showing popup dialog and also picture box but i want to show popup on only picture box
how it is possible.
Bankey Khandelwal
Software Engineer
|
|
|
|
|
Derive a class from CStatic and handle the OnRButtonDown event
Name the picbox IDC_STATIC_PIC and attach a variable to it
C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg
|
|
|
|
|
This time you beat me to the punch.
Steve
|
|
|
|
|
Stephen Hewitt wrote: This time you beat me to the punch.
whos da man
BTW i didn't know about the shift+f10 thing
C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg
|
|
|
|
|
Firstly you should use the WM_CONTEXTMENU message instead of the WM_RBUTTONDOWN message. Doing this means the SHIFT+F10 shortcut will work for example. If you want the right click to be for the picture box you should subclass it and handle the WM_CONTEXTMENU message there.
Steve
|
|
|
|
|
if you use event WM_CONTEXT_MENU in the function you can use
handle CWnd->m_hWnd with hWnd your Control
void CAnswerView::OnContextMenu(CWnd* pWnd, CPoint point)
{
if(pWnd->m_hWnd==(your m_hWnd))
{
CMenu menu;
menu.LoadMenu(IDR_MAINFRAME);
CMenu *pContextMenu=menu.GetSubMenu(0);
pContextMenu->TrackPopupMenu(TPM_LEFTALIGN|TPM_LEFTBUTTON|TPM_RIGHTBUTTON,point.x,point.y,AfxGetMainWnd());
}
}
|
|
|
|
|
i am crating picture box dynamicall through cstatic class object
suppose object is *obj
and i am trying as
if(pWnd->m_hWnd==obj->m_hWnd)
but this condition allways false
please where i am wrong.
Bankey Khandelwal
Software Engineer
|
|
|
|
|
I wrote to your mail
It's work do you use in WM_COMTEXTMENU
-- modified at 7:34 Friday 10th March, 2006
|
|
|
|
|
iam using wm_contextmenu like as
void CShow_ImageDlg::OnContextMenu(CWnd* pWnd, CPoint point)
{
// TODO: Add your message handler code here
if(pWnd->m_hWnd==cstatic->m_hWnd)
{//where cstatic is the object of cstatic class for creating //picture box
CMenu menu;
menu.LoadMenu(IDR_MENU1);
CMenu *pContextMenu=menu.GetSubMenu(0);
pContextMenu->TrackPopupMenu(TPM_LEFTALIGN|TPM_LEFTBUTTON|TPM_RIGHTBUTTON,point.x,point.y,AfxGetMainWnd());
}
}
but it does not work if u have any idea where i am wrong please reply me
Bankey Khandelwal
Software Engineer
|
|
|
|
|
Mr Bankey Khandelwal I tested exactly this code and it's work
I use a button in the form and I assigned a variable to Button
and in the context_menu i use if(pWnd->m_hWnd==m_Button1.m_hWnd)
Now if User Rclick in the button popup menu is run else nothing
void CAnswerView::OnContextMenu(CWnd* pWnd, CPoint point)
{
CMenu menu;
if(pWnd->m_hWnd==m_Button1.m_hWnd)
{
menu.LoadMenu(IDR_MAINFRAME);
CMenu *pContextMenu=menu.GetSubMenu(0);
pContextMenu->TrackPopupMenu(TPM_LEFTALIGN|TPM_LEFTBUTTON|TPM_RIGHTBUTTON,point.x,point.y,AfxGetMainWnd());
}
}
|
|
|
|
|
I have VS 6.0 (from an old project) and VS 2005 installed on my laptop. Is it possible to set up the projects (created in 6.0, but opened in 2005) to use the VS 6.0 compiler? Or doesn't that matter?
tnx!
No hurries, no worries.
-- modified at 5:45 Friday 10th March, 2006
oh, it's about the C++ compiler
|
|
|
|
|
Hi V.
You have a project in VC6 and you want to open it in 2005?yes
|
|
|
|
|
Not exactly, opening them is easy, but compiling seems to be different. I get errors in the 2005 compiler that I don't get in the 6.0 compiler. So what I want to do is use the 2005 as editor and use the compiler or compiler settings from the 6.0.
tnx!
No hurries, no worries.
|
|
|
|
|
VS 6.0 creates DSW and DSP files, VS 2005 uses SLN and VCPROJ, so workspaces of VS 6.0 and 2005 can happily coexist without interferring.
Create a workspace in VS 6.0 and a workspace in VS 2005. This way you can compile the project using both compilers.
Best regards
Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
(doesn't work on NT)
|
|
|
|
|
Tnx for your reply, but that wasn't what I meant (my apologies).
I get errors with a 2005 compiler that I don't get with the 6.0 compiler. Maybe I have to set my settings differently, but that would take a long time no? Maybe you can import those settings?
No hurries, no worries.
|
|
|
|
|
I have Project in Visuall 2003 and I compiled on the 2005 but i received
errors in 2005 But It run in 2003 and it's not error
|
|
|
|
|
exactly so, but I do want to run it 2005. I think it is possible, but how is the question
No hurries, no worries.
|
|
|
|
|
i understand you problem well i think, but what you're trying to do is not very good.
all is a matter of standard compliance. the VC6 compiler has been released few months before the standard was edited. then Visual C++ 7.1 (VS.NET 2003) came with better comformance to the new standard needs. it might be worst with VC8 (which is said to respect the standard at about 98%).
i think that it could take you some time to fix the bugs instead of compiling back your 2005 solution with VC6 compiler.
as i don't have Visual studio installed at work, i cannot tell you how to change the setting you require, but you should consider better fix those error...
|
|
|
|
|
v2.0 wrote: but you should consider better fix those error...
If it was up to me, immediately...
No hurries, no worries.
|
|
|
|
|
when you run project in 2005 you have a question that you need to convert yes?
|
|
|
|
|
opening or even using the old VS 6.0 files isn't the issue, I want to be able to compile it as it is compiled in 6.0 that's all. I could get out all the errors, but I'm not allowed, besides, I'm not starting to get the bugs out of more then 100 projects.
It isn't that important, but thanks for the effort.
No hurries, no worries.
|
|
|
|
|
|
V. wrote: I get errors with a 2005 compiler that I don't get with the 6.0 compiler.
So why not just fix the errors so that your code will compile cleanly with VS2005?
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|