|
I'm not sure whether you will get precise timing of 1 ms because as per the windows concept, each process will get 20ms of time for it's execution, it's depends on the scheuduler that your process will get scheduled.So a in the user mode, we could not ensure the correctness of the timer.
We can use waitable timer for the same, since it is a kernel object, it will signal at the specified time. But I doubt whether your application can handle do the required processing thsi small amount of time. Anyway check this.
Using waitable timer[^]
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
|
|
|
|
|
The Windows multimedia timers are supposed to offer the programmer the ability to get timer resolutions better than what is typically available (around 10ms on Windows XP).
I have not tested these functionalities extensivelly, but I did notice a subjective improvement in a 3D animation I was building.
Check timeBeginPeriod function and the related multimedia timer functions. The minimum resolution that can be set is 1ms.
Rilhas
|
|
|
|
|
i've made my derived CRichEditCtrl class able to receive url addresses that appear with underline, but the problem is that when i click this link, nothing happens.
also, right click on the rich edit doesn't open a pop up menu
and also, how do i catch copy & paste methods
thanks in advanced
Yaron Nir
Interface basics click here :
http://www.codeproject.com/com/COMBasics.asp
don't forget to vote
|
|
|
|
|
YaronNir wrote: but the problem is that when i click this link, nothing happens.
u can u use ShellExecute function to open a internet explorer for the specified url when the user clicks in the url.
YaronNir wrote: and also, how do i catch copy & paste methods
handle WM_COPY and WM_PASTE messages for this.
nave
|
|
|
|
|
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
|
|
|
|
|
You can use //::ShellExecute(NULL, "open", "iexplore.exe", "your_url.htm", NULL, NULL, SW_SHOWNORMAL); or see CHtmlView maybe it is some helpful to you
whitesky
|
|
|
|
|
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."
|
|
|
|