|
thanks for the reply.
how do i catch the click on the url to call the shell execute?
what about my third question : right click on the rich edit doesn't show default pop up menu (with the items of copy paste etc....)
thanks again
Interface basics click here :
http://www.codeproject.com/com/COMBasics.asp
don't forget to vote
|
|
|
|
|
i have created a window how to add menu to my window
i have written code like this
int CNode::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CWnd::OnCreate(lpCreateStruct) == -1)
return -1;
// TODO: Add your specialized creation code here
CMenu* pNewMenu = new CMenu;
pNewMenu->LoadMenu( IDR_MENU2 );
SetMenu(pNewMenu);
return 0;
}
and my window style is
DWORD dwStyle = WS_CHILD|WS_VISIBLE|WS_OVERLAPPEDWINDOW|WS_BORDER
but i am not getting menu to my window
can any one help me
B.LakshmipathiRao
-- modified at 3:08 Saturday 8th July, 2006
|
|
|
|
|
no need of doing all this.
just right click on the dialog. Take properties from the menu.
In the general tab u can find a combobox called menu. Select "IDR_MENU2" from that one. Build and run the project.
nave
|
|
|
|
|
LakshmiPathiRao wrote: CMenu* pNewMenu = new CMenu;
pNewMenu->LoadMenu( IDR_MENU2 );
SetMenu(pNewMenu);
There is nothing wrong in your code.
It is working fine here.
Just debug the code once,keeping a breakpoint at OnCreate()
Appu..
"If you judge people, you have no time to love them."
|
|
|
|
|
hi,I have created a tabcontrol in formview, CBaseFormView:CFormView,Each tab in the tabcontrol is a formview,CTab1View:CFormView,CTab2View:CFormView..I have handled WM_CONTEXTMENU in CBaseFormView,in the context menu i have two item "Print" and "PrintPreview".I have Handled ON_COMMAND for both menu items in CBaseFormView,When i right in BaseFormView,print and printpreview are working,even the print command in printpreview is working,When i right click on tabcontrol..print is working,print in printpreview is not working ,what could be the reason..?
Thanks in before
James
|
|
|
|
|
Can u give some more details ??
To know the routing of the command,Keep message boxes in each view and run the application.
I think this must help you to know the command routing.
Appu..
"If you judge people, you have no time to love them."
|
|
|
|
|
i have overriden Onfileprint,onfileprintpreview,Onprepareprinting,OnPrint,OnEndPrinting,in all view,I am handling printing in the respective view..
|
|
|
|
|
I am building a BHO that is meant to popup a IHtmlPopup window on a mouse over image event. All the code works fine if the image is in the main Window.
However if the image is in a frame then I get the following error:
{"Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))"} System.Exception {System.UnauthorizedAccessException}
This happens when I try to create the Popup Window or access its Document
The code below is in C#, but I think it would apply to C++ too.
I have tried getting the parentWindow from the Frame's document and from teh main document.
<br />
IHTMLWindow4 parentWindow = (IHTMLWindow4)PageDocument.parentWindow;<br />
<br />
IHTMLPopup popUp = (IHTMLPopup)parentWindow.createPopup( ref argIn );<br />
IHTMLDocument2 popupDoc = (IHTMLDocument2)popUp.document;<br />
Any ideas?
-- modified at 2:31 Saturday 8th July, 2006
|
|
|
|
|
|
Thanks, but I am not sure that is my problem. My code works when there are no frames in the html. It fails when we have frames. Also, I can get it to work using simple javascript even in frames. Just cant get the C# code to work with frames.
|
|
|
|
|
Sounds like a cross frame security issue.
Steve
|
|
|
|
|
Yes it is. But how do I overcome it? Is there a way around?
|
|
|
|
|
|
|
can't brouse the page...are u sure about the link?
|
|
|
|
|
Yes..It is getting opened here.
Appu..
"If you judge people, you have no time to love them."
|
|
|
|
|
I can't....
mybe the priblem is couse use Opera?
|
|
|
|
|
Could you post article here...or emai...
|
|
|
|
|
Copying Data to the Clipboard
Having registered a Clipboard format, we can look at copying data to the Clipboard. Let's first look at the OnUpdate. . . handler for the Edit Copy command:
void CClipView::OnUpdateEditCopy(CCmdUI* pCmdUI)<br />
{<br />
int i = m_wndList.GetSelCount();<br />
pCmdUI->Enable(i > 0 ? TRUE : FALSE);<br />
}
If no items are selected, the command is disabled. This does two things: It shows the user the command won't do anything (it's grayed out), and it prevents us from getting Copy commands when there is nothing to copy. Let's look at the code for doing the actual copy operation:
void CClipView::OnEditCopy()<br />
{<br />
int iCount = m_wndList.GetSelCount();<br />
ASSERT(iCount > 0);<br />
int* pItems = new int [iCount];<br />
m_wndList.GetSelItems(iCount, pItems);<br />
CMyObList ObList;<br />
int i;<br />
CMyObj* pObj;<br />
for (i=0; i<iCount; i++) {<br />
pObj = (CMyObj*) m_wndList.GetItemData(pItems[i]);<br />
ObList.Append(pObj);<br />
}<br />
delete pItems;<br />
CSharedFile mf (GMEM_MOVEABLE|GMEM_DDESHARE|GMEM_ZEROINIT);<br />
CArchive ar(&mf, CArchive::store); <br />
ObList.Serialize(ar);<br />
ar.Close();
HGLOBAL hMem = mf.Detach();<br />
if (!hMem) return;<br />
ObList.RemoveAll();<br />
OpenClipboard();<br />
EmptyClipboard();<br />
SetClipboardData(theApp.m_uiMyListClipFormat, hMem);<br />
CloseClipboard();<br />
}
The number of selected items is used to create a temporary array of selection IDs. The IDs are set into the array by calling GetSelItems. A new CMyObList is created and the pointer to each object is added to the list. Note that we are adding a reference to an object that is in use elsewhere, so it's important that we don't delete these objects by mistake when we're done here.
Once the new CMyObList object has been built, a CSharedFile is created and an archive is created on top of the shared file. We can now serialize the list to the archive and, hence, to the shared file in memory. Once that's done, the memory of the shared file is detached, ready for sending to the Clipboard. The temporary CMyList object has all its items removed, not destroyed. The list object itself is, of course, destroyed when the function exits. The Clipboard is opened, emptied, and set with the data from the shared file. The memory block now becomes the property of the Clipboard. Finally, the Clipboard is closed.
If you use the Clipboard viewer after copying a list to the Clipboard, you'll see an item from your private format. You can't view the data, of course, because the Clipboard has no way of understanding it. You can add that capability for owner-drawn Clipboard items if you want the user to be able to see the data in the Clipboard viewer.
Appu..
"If you judge people, you have no time to love them."
|
|
|
|
|
Hello everyone!
First of all, I'm planning on using wxWidgets and not MFC... If that's not possible, I'll just do MFC.
Anyways... I need a custom control. I need it to be a grid of colorable characters... I've got no idea how to do this, I've read a couple of tutorials before (for C#) but I just didn't get it... I was planning to do a SDL program instead, but then I thought it would be a waste. Thanks!
-- modified at 1:28 Saturday 8th July, 2006
|
|
|
|
|
|
Well, at least I have an excuse to not do it in wxWidgets: There were no sites, tutorials, or forums that at all helped.
Anyways... Is there some tutorial that teaches the basics on doing controls? I don't get it, I know you inherit from an existing control's class... But, like, my control is a ListView, but with the following changes changes:
* No labels at the top.
* Fixed-size grid boxes.
* Colorable boxes. (Basic text formatting will do)
* Remove grid lines (The user can select to add it though)
I mean, how do I change it to remove the gridlines or the labels? Is it a code file, a resource, or what? Thanks!
Windows Calculator told me I will die at 28.
|
|
|
|
|
Help me!
I needing stack simulation, but I can't simulation with picture.
I want you help me, give me some source code write on Dialog with SDI.
If you can, give me: email: trinhcung_83@yahoo.com
Thanks!
-- modified at 0:01 Saturday 8th July, 2006
|
|
|
|
|
I have been having a problem with getting a CString edit box displaying the data in the CString. Note, the float variables display correctly. Only the CString will not.
Here is the problem peice of code:
int n = m_lbModelList.GetCurSel();
m_strModelFileName = g_CarInfo.Graphics.pModel[n].strFileName;
m_fModelScaleX = g_CarInfo.Graphics.pModel[n].fScaleX;
m_fModelScaleY = g_CarInfo.Graphics.pModel[n].fScaleY;
m_fModelScaleZ = g_CarInfo.Graphics.pModel[n].fScaleZ;
UpdateData(FALSE);
Now this version of the code works perfectly but defeats the purpose of a list box:
int n = m_lbModelList.GetCurSel();
m_strModelFileName = g_CarInfo.Graphics.pModel[5].strFileName;
m_fModelScaleX = g_CarInfo.Graphics.pModel[n].fScaleX;
m_fModelScaleY = g_CarInfo.Graphics.pModel[n].fScaleY;
m_fModelScaleZ = g_CarInfo.Graphics.pModel[n].fScaleZ;
UpdateData(FALSE);
|
|
|
|
|
SySt wrote: m_strModelFileName = g_CarInfo.Graphics.pModel[5].strFileName;
Shouldn't that be g_CarInfo.Graphics.pModel[n].strFileName;? Maybe the 5 is messing it up.
- S
50 cups of coffee and you know it's on!
|
|
|
|