|
menu.AppendMenu(MF_ENABLED | MF_STRING , ID_NEWITEM1, _T("NewItem1"));
menu.AppendMenu(MF_ENABLED | MF_STRING , ID_NEWITEM2, _T("NewItem2"));
just keep on adding as many items u want,..u can add separator,u can appened to existing menu also..
if(pWnd->m_hWnd == m_button.m_hWnd)..when u click on a button on dialog ,contextmenu appear,if u want it for whole just remove that line..that`s all...
-- modified at 7:38 Monday 10th July, 2006
|
|
|
|
|
thanks a lot
but can i do this coding foe dialog in OnRButtonDown function
Ashish Dogra
MCA
Noida
|
|
|
|
|
RButtondown..is not required if u handle WM_CONTEXTMENU...
|
|
|
|
|
sir thanks but it does not work for dialog box
Ashish Dogra
MCA
Noida
|
|
|
|
|
i have taken sample dialog based application,named it sample..i have overriden WM_CONTEXTMENU in CSampleDlg class..and wrote following code in OnContextMenu function..
CMenu menu;
menu.CreatePopupMenu();
menu.AppendMenu(MF_ENABLED | MF_STRING , 1000, _T("Hello"));
menu.AppendMenu(MF_ENABLED | MF_STRING , 1001, _T("Hello1"));
menu.AppendMenu(MF_ENABLED | MF_STRING , 1002, _T("Hello2"));
menu.TrackPopupMenu(TPM_LEFTALIGN | TPM_RIGHTBUTTON, point.x, point.y, this);
its working fine...
|
|
|
|
|
sir thanks but this code works for button very efficiently
and when i right click on dialog i small menu appear but nothing is appeared on it.
Ashish Dogra
MCA
Noida
|
|
|
|
|
if(pWnd->m_hWnd == m_button.m_hWnd)..remove this line from u r code..then it works..
|
|
|
|
|
no sir when i remove this line then it works for all buttons except the one button that is m_button.
and it does not work for dialog box
thanks
Ashish Dogra
MCA
Noida
|
|
|
|
|
thanks a lot sir now everything is ok
thanks for ur cooperation
u r geneious
Ashish Dogra
MCA
Noida
|
|
|
|
|
hi all
i want to know how i can enable the progress control
on dialog box in dialog based application when i click on a button
and i want to display data on edit box from right side as it display from left side by default
Thanks.
Ashish Dogra
MCA
Noida
|
|
|
|
|
I think you need to read the post before you post your message .this will help others in helping you in a better way .
Regards,
FarPointer
Blog:FARPOINTER
|
|
|
|
|
sorry i repeat my question
i made a dialog based application
on which i made a progress control and a button
now i want that when i click on button the progress control enables it means that the progress controls line statrs moving from left to right
i think now it is ok
thanks
Ashish Dogra
MCA
Noida
|
|
|
|
|
Well using the below mentioned way u can move the progress ctrl:-
myCtrl.GetRange( nLower, nUpper );<br />
myCtrl.SetStep( (nUpper-nLower)/10 );<br />
myCtrl.SetPos( int nPos );
But according to your defn it feels that you want a busy control rather than a progress control .
Regards,
FarPointer
Blog:FARPOINTER
|
|
|
|
|
thanks for your reply
but as i use this code in button and when i click that button,
the progress bar does not respond
Ashish Dogra
MCA
Noida
|
|
|
|
|
Well use the SetPos code in a for loop .
Regards,
FarPointer
Blog:FARPOINTER
|
|
|
|
|
sir i use this code but not woking
plz modify this
void CDIALERDlg::OnButton16()
{
// TODO: Add your control notification handler code here
int nLower,nUpper;
int nPos;
m_myCtrl.GetRange( nLower, nUpper);
m_myCtrl.SetStep((nUpper-nLower)/10);
for(int i=0;i<100;i++)
{
m_myCtrl.SetPos(nPos);
}
}
Ashish Dogra
MCA
Noida
|
|
|
|
|
Try This:-
m_progressctrl.SetRange (1,100);<br />
m_progressctrl.SetStep(1);<br />
for(int i=0;i<100;i++)<br />
m_progressctrl.SetPos(i);
Regards,
FarPointer
Blog:FARPOINTER
|
|
|
|
|
thanks sir
but it is not working
Ashish Dogra
MCA
Noida
|
|
|
|
|
sir thanks it works now
but it reaches at the end very quickly
can this reach slowly thanks again .........
Ashish Dogra
MCA
Noida
|
|
|
|
|
Hi,
I have a basic Visual C++/MFC program written with VS .Net 2005 but that doesn't use .NET Framework. I tried to run it on another PC, and it didn't work although I had all the required DLLs in the same directory. It said something like "application could not initialize properly...". I tried to fix this by installing .Net Framework 2.0 (which did not solve the problem) and then using the setup wizard. This eventually worked but I don't know why.
I want to be able to run my program from a USB key, without any installation or download. This should be possible since I'm not using the .NET Framework (at least not intentionnally...). I've never had this kind of problem with VS 6.0. Any idea of what I need to do with VS 2005 to make my program standalone ?
Thanks
|
|
|
|
|
maybe you used from services that are only in your system or dlls files
whitesky
|
|
|
|
|
WhiteSky wrote: maybe you used from services that are only in your system or dlls files
I checked every single DLL loaded by my program (using "attach to process..." in visual studio) and copied them to the program directory.
|
|
|
|
|
even, you hadn't use any CLR APIs, you might have linked with those DLL.
change the project settings accrodingly.
SaRath.
"Where I am from, there is no plan B. So, take advantage of today becuase tomorrow is not promised. - 50 Cent"
<blink>My Blog | Understanding State Patte
|
|
|
|
|
Sarath.<fon wrote:<="" div="">even, you hadn't use any CLR APIs, you might have linked with those DLL.
I'm not using the "/clr" option in the compile command line... Is there anything else that can make me link with unused DLLs ?
|
|
|
|
|
are you linking with MFC DLLs? I dont know more about executable created by VC++ 2005
Check with Dependency walker
SaRath.
"Where I am from, there is no plan B. So, take advantage of today becuase tomorrow is not promised. - 50 Cent"
<blink>My Blog | Understanding State Patte
|
|
|
|