|
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!
|
|
|
|
|
No, that 5 is usually an "n". What I mean by changing that peice of code is that this:
m_strModelFileName = g_CarInfo.Graphics.pModel[5].strFileName;
puts the filename stored in the index "5" of the pModel arrray into the editbox. 5 is just an example, any valid index of the array works just the same.
The weird thing is that if I put the code like this:
m_strModelFileName = g_CarInfo.Graphics.pModel[n].strFileName;
"n" being the integer retrieved from CListBox::GetCurSel(). No matter what number "n" comes out to be the data from the array does not display in the editbox. If "n" turns out to be "5", then are the two lines of code not identical? They appareantly do not give the same result.
|
|
|
|
|
Hi,
I'd like to use a CTabCtrl with CFormViews in it (preferably the CResizableFormView class which can be found on this site). I've been going crazy over this all day and I can't figure out whether it's possible to do that instead of using CDialogs.
Normally you would do something like this:
CDialog *m_tabPages[2];
m_tabPages[0]->Create(IDD_TAB1, this);
m_tabPages[1]->Create(IDD_TAB2, this);
Now I've tried putting:
CResizableFormView *m_tabPages[2];
m_tabPages[0]->Create(IDD_TAB1);
m_tabPages[1]->Create(IDD_TAB2);
However, the CFormView::Create() function takes other arguments and I cannot find anything about it on msdn: Create(LPCTSTR, LPCTSTR, DWORD, const RECT&, CWnd *, UINT, CCreateContext*)
I tried to overwrite the default Create function in the CResizableFormView class, but I don't exactly know what to do.
So my question is, can I get tabs to work by placing CFormViews in them and if so... how?
Thanks a lot if you could help me out!
Greetings,
Edward.
|
|
|
|
|
I am using this code to select a listview item. i specify the postion of item using (WPARAM)2 . So this one supposed to highlight and selct the postion 2 in the listview. But unfortuently it does not select but it does deselct. I mean if the item is selected by mouse click it can deselect it but can not select it. Could any one tell me what i am doing wrong here.Thanks
SendMessage(listview, LVM_SETITEMSTATE, (WPARAM)2, (LPARAM)_lvi);
void CSelectuserDlg::OnButton1() <br />
{<br />
<br />
HWND listview=NULL;
HWND parent,child; <br />
parent=NULL; <br />
child=NULL; <br />
parent = ::FindWindow("My Window Class",NULL); <br />
<br />
child =::FindWindowEx(parent,0,"WTL_SplitterWindow",NULL); <br />
child =::FindWindowEx(child,0,"WTL_SplitterWindow",NULL); <br />
child =::FindWindowEx(child,0,"WTL_SplitterWindow",NULL); <br />
child =::FindWindowEx(child,0,"ATL:0053C8D0",NULL); <br />
listview=::FindWindowEx(child,0,"SysListView32",NULL); <br />
<br />
LVITEM lvi, *_lvi; <br />
unsigned long pid; <br />
HANDLE process; <br />
<br />
GetWindowThreadProcessId(listview, &pid); <br />
process=OpenProcess(PROCESS_VM_OPERATION|PROCESS_VM_READ|PROCESS_VM_WRITE|PROCESS_QUERY_INFORMATION, FALSE, pid); <br />
<br />
<br />
_lvi=(LVITEM*)VirtualAllocEx(process, NULL, sizeof(LVITEM), MEM_COMMIT, PAGE_READWRITE); <br />
lvi.mask = LVIF_STATE; <br />
lvi.state = true; <br />
lvi.stateMask = LVIS_SELECTED; <br />
<br />
WriteProcessMemory(process, _lvi, &lvi, sizeof(LVITEM), NULL); <br />
::SendMessage(listview, LVM_SETITEMSTATE, (WPARAM)2, (LPARAM)_lvi); <br />
VirtualFreeEx(process, _lvi, 0, MEM_RELEASE);<br />
<br />
}
|
|
|
|
|
Hey, I just came across this strange prototype.
This is really weird.
void comm_perror(int error, char *format, ...)
Does anyone have a clue to what the ... parameter is suppose to mean.
This is actually a real function in one of the source codes I was reviewing
If anyone has an answer to this question please keep me posted
Cheers,
Jay
-- modified at 17:08 Friday 7th July, 2006
|
|
|
|
|
|