|
Hanan888 wrote: Are you sure this applies to the latest SDK?
yep, but not in Direct3D 9(though 9 is not latest) since directdraw interfaces are outdated in direct3d9. It is used latest directshow sdk, where VMR7 is supported by this IDirectDrawSurface interfaces while VMR9 is supported by IDirect3DSurface9 interfaces. Haven't you seen this
"The IDirectDrawSurface interface is exposed on DirectDrawSurface objects that are used in the DirectShow multimedia streaming APIs" in that link. you can also refer some samples in DirectShow how custom allocator are implemented to mix various video streams much similar like your requirement.
|
|
|
|
|
Hi,
I have a CView form on which i put some text, but when i minimised the frame the text dispappear. My question is what should i do to prevent the erase of my Text. in other words, when i'll minimize the frame, i dont wanna lose the text.
Thx !!
"The Ultimate Limit Is Only Your Imagination."
|
|
|
|
|
Blood_HaZaRd wrote: but when i minimised the frame the text dispappear
assume the text disappears when you restore after a minimise, window won't remember the text you previously draw, you need to draw always in WM_PAINT handler.
|
|
|
|
|
yes i know that i have to put the code in tyh WM_Paint. But in my app the user can draw many shapes like 100 ellispe etc so i have to store the positions of all the ellipses and redraw them. So that will use a lot of time, which is a bad thing.
is there any other suggestions like saving what is drew into a CDC var or sth else ?
"The Ultimate Limit Is Only Your Imagination."
modified on Sunday, June 1, 2008 6:44 AM
|
|
|
|
|
Blood_HaZaRd wrote: yes i know that i have to put the code in tyh WM_Paint
i wonder why it then disappears
Blood_HaZaRd wrote: is there any other suggestions like saving what is drew into a CDC var or sth else ?
you can use double buffering approach, draw in in-memory dc and copy to on-screen dc, you can determine the portion of client region that is changed and selectively copy/update the window instead of complete client region.
|
|
|
|
|
"i wonder why it then disappears"
I used to put it there but i delete the code in order to try sth else.
and about the doucble buffering could u telle me how ?? coz i'am newbie in such manipulations
Thx
"The Ultimate Limit Is Only Your Imagination."
|
|
|
|
|
Anyway you have to store all the objects into your internal datastructure, but to reduce the number of drawing you can use cached bitmap (double buffering), [CMemDC class^] shows the usage within paint handler, but you need to store across paint.
PS: MFC feature pack also has CMemDC implementation
|
|
|
|
|
Well, whatever the difficulty, the content info has to be stored somewhere before it can be stored used to redraw the window. The question realy is: 'Who writes the Code for it:- Bill Gates or you.'
Actually, Bill Gates provided a framework for retaining and storing those things, it's called the underlying Document. With each screen drawing action, you should write your actions to the Document, and then render the document to the screen. There is a very good tutorial about precisely this as part of the MFC Help System, it's called 'Scribble'. I reccommend that you take a few hours out to do this tutorial, and all your questions regarding this (and more) will be answered.
Regards
Bram van Kampen
|
|
|
|
|
Hi all,
does somebody know how could i erase an ellipse from the interace??
Let's say that i have 2 buttoms the first one for drawing an ellispe and the second one for erasing the ellipse that i drew or any other shapes.
Thx
"The Ultimate Limit Is Only Your Imagination."
|
|
|
|
|
If you are drawing directly from the button a call to UpdateDiialog or UpdateWindow will do it.
But the problem is that on this way (drawing directly from the button code) if you minimize and restore the elipse will be away as well.
I would make it:
Button "Draw" -> Set a bool, bPaintEll = TRUE;
Button "Erase" -> Reset the bool, bPainEll = FALSE;
and then in your OnDraw (for Views) or your OnPaint (for dialogs)
if (bPaintEll)
{
function or direct code to draw the ellipse
}
With it, every time you call Invalidate and UpdateWindow it will be erased and repainted (if needed), and when you have it on the screen and you go to another app or minimize, it will be repainted (if needed) alone.
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
Rating helpfull answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
In VC++ 2008 I add a string "m\xb2" (square meter), it display as expected in the string talbe of resource editor. When I use s.LoadString to load and display it, it becomes m2.
Any way to solve it?
|
|
|
|
|
Try executing this code.
AfxMessageBox(_T("m\xb2"));
AfxMessageBox(_T("m\\xb2"));
Hint: '\' is used to specify escape characters.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
The former one works as expected.
I've tried to subsitute \xb2 with \\xb2 in the string table, but no help.
|
|
|
|
|
OK - I overlooked your query previously. Resource editor is appending zeros after the slash. It looks like a bug to me (or may be a feature )
Try hard-coding the string in your program.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Strange. This works for me in both VS 2005 and 2008. I tried both UNICODE and ANSI mode to make sure that wasn't an issue.
When I add it through the resource editor, it converts it immediately to m².
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
I have a custom control. Now i want to use it in another application. How to do that
Regards, Eswari
|
|
|
|
|
subramanyeswari wrote: I have a custom control. Now i want to use it in another application. How to do that
similar to how you used in your current application.
|
|
|
|
|
i placed my control on one of VC++ application and gave the class name. on debugging it came out saying failed to create empty document. What did i miss
|
|
|
|
|
may be you haven't registered the control. May be posting the code or explain what you have done can help.
|
|
|
|
|
It's MDI application.
In CMainFrame, I create a docked pane, which has a CMFCPropertyGridCtrl object in it.
And I wrote this (pseudo code):
void OnActivateView(BOOL bActivate, CView* pActivateView, CView* pDeactiveView)
{
clear all the content in the property grid;
if (bActivate) {
GetDocument()->FillThePropertyGrid;
}
}
There are two problems, first assume there two opened document,
the major problem is that when I close one child view, the property grid is cleared, though the other view is activated.
the other problem is about efficient, when I switch from other application the this one, OnActiveView is called, and the grid is refilled unnecessarily.
How to them?
Thanks.
PS: I don't understand the usage of pActivateView and pDeactiveView.
|
|
|
|
|
"The pActivateView and pDeactiveView parameters point to the same view if the application's main frame window is activated with no change in the active view — for example, if the focus is being transferred from another application to this one, rather than from one view to another within the application or when switching amongst MDI child windows." from msdn
|
|
|
|
|
followait wrote: There are two problems, first assume there two opened document,
I guess you are using one Document with more than one View, and you are running two different instances of your application.
I made something similar once, I just got a CMyDoc* pointer declared in the StdAfx, then on the InitialUpdate in the first (main) view I made:
extern CMyDoc* myCommonDoc;
myCommonDoc = GetDocument ();
Afterwards everytime I wanted to use the document in all the other views I just had to use that pointer.
Advantage... when more than one App is running, everyone will have its own myCommonDoc so you will avoid the mixing from one on the other.
followait wrote: when I switch from other application the this one, OnActiveView is called, and the grid is refilled unnecessarily.
I guess this is not going to be the best solution, but you can try to get the pDeactiveView and check into your document if it is one of the views associated with it, with the functions GetFirstViewPosition and GetNextView . If there is no match, it means that you are comming back from another application into this one and avoid the refilling.
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
Rating helpfull answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
Hi,
I've been using VS 5.00 since 2001. Works Fine, Does the job!. iow Suits me. Since last December, the Help system stopped working on XP Machines. (still works on the W98 Machines though), Since 12 OClock last night, elements of the Source Browser stopped working. The question is, has anyone else noticed this happening, or, is there a timebomb in VS5.00.
BTW I've 3 computers running VS 5.00. Two of them have this 'Sudden' Problem. The only one still performing is the one running Win98.
It may be a Fluke, My Mind is still open, but,If it turns out that this is the way that Microsoft enforces a sales policy, we will very rapidly downgrade to Windows98.
Regards
Bram van Kampen
|
|
|
|
|
I would guess that there are system components (browser bits possibly) that have changed and don't function as VS5 expects.
The other possibility are Windows Updates that have removed components in VS5 that are now thought of as unsafe.
You might be able to restore the missing functionality by re-installing VS5.
|
|
|
|
|
Hi,
No, Tried to re-install. Same Problem. Formatted HD, Re-Installed OS from Original Disks, Re-installed Compiler:- Same Problem.
I run critical VC Projects on two core computers, neither of which is networked. (Never mind being on the Internet). One runs on WIN98 SP2, the Other on XP Professional (No Service Packs) I also run VS5.00 on two XP Professional Laptops.(Up to date with Service Packs) All started behaving daft about a fortnight ago, except for the WIN98 Machine. On one of them, Formatted Disk and installed WIN98,+ VS5.00, Problem Gone!!!
Something Daft going on here
Bram van Kampen
|
|
|
|