|
|
Hi there,
I have an mdi app, child window containing a cscrollview. Obviously the user can create new child windows using the window>New Window menu item. When they have created more than one view, I would like the multiple child windows to scroll synchronously. I mean that when an active child window's view is scrolled, all the other child window's views scroll along at the same time.
I can't think of a way to do this! I tried maintaining a CPoint in the document class, updated by the view whenever it is scrolled, and adding a ScrollToPosition command in the update function of the view. But it was very messy and didn't quite work correctly.
Does anybody know if there's a neat clean way I can do this, perhaps sending windows messages directly between child windows or something?
Thanks for any help,
Mick
|
|
|
|
|
mickelliot wrote:
When they have created more than one view, I would like the multiple child windows to scroll synchronously.
Any reason why? The whole point of the New Window menu item is so that users can see different parts of the same document at once. Having them all automatically scroll to the same point sort of defeats the purpose.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Hi Ryan,
Thanks for replying.
The idea is that each view will contain the same view of the same data, but with different parameters so that the view "looks" different. I can best explain myself by asking you to imagine an MDI bitmap editor. You load in a bitmap, which appears in a new child frame, and set its magnification to 100%. You then open a new window and set the magnification of the new view to 200%. Now, when you scroll around the 100% view, you want the 200% view to move along with it appropriately (i.e. in the same direction and twice as fast), so that each view contains the same area of the bitmap but just at different magnifications.
The idea would be to make this an option for the user - i.e. they can either open two child windows and use them to view different parts of the document, or they can adjust the parameters of each view and synchronize the two windows.
Mick
|
|
|
|
|
One way would be to handle WM_HSCROLL and WM_VSCROLL in each view. Whenever the view is scrolled, get the current scroll position. Each document (GetDocument() ) has a list of all the views attached to it (GetFirstViewPosition() , GetNextView() ). Just loop through for each view and call SetScrollPosition() .
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
I'm writing a dialog based application.
I'd like to know how to show an animation on the dialog!!
Please Help Me!!!
Thanks in advance!!!!
|
|
|
|
|
An mpeg using DirectX or MediaPlayer is the obvious choice, I guess.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
if you looking for Image Animation,then go for any good image library
that will solve your problem.
One Good Image Library IS 'CXImage',search for it IN CP
-----------------------------
"I Think It Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
hi
if you wanna play some AVI file on your dialog then you can do it via CAnimateCtrl class provided with MFC
cheers
Azam
|
|
|
|
|
Thanks to all of you on yours suggestions!!!!!!
|
|
|
|
|
Hello,I have the following project and I have tried and tried but can't seem to get it. Can anyone help?
I have to write a program to campare the secant method with newton's method for finding the roots of each function:
x^3 - 3x + 1 with starting point Xo=2
x^3 - 2 sin x with starting point Xo=.5
The instructions also state to use the X1 value from Newton's method as the second starting point for the secant method and to print out each iteration for both methods. I appreciate any help.
|
|
|
|
|
hi,
first you must know how to create a simple application and include graphics in it. I can't learn that, if u don't know buy a book like "C++ for the dummies"
I will assume that you have at least basics skills in developing apps and will just describe the method you must use to make your project ; especially i will not discuss implementation solutions you use, nor the old-fashioned question of object oriented versus linear
For the numerical :
first : write on paper both newton and secant mehod, analytical (ie on paper) write the expresion of both methods' algorithm in function of Xo and the function i name F. Dont developpe F, use it as a general function.
second : write a unit that can trace graphically any functions : trace the axis, check with usual functions you knox (log , cos...) then test your two asked functions, name them f1 and f2.
make your grid and your mesh depending of variables and use these to create a zomm(in and out) that you can use while the app is running.
third : in another unit write a method that give a solution for each algo(secant/newton) in function of Xo, F, the maximal error requested (MER) and the number of steps(N).
if N=0 say N = maxInt and if n=maxInt-1 exit with an error (maybe yours
check it with the simplest functions whose roots are trivial
fourth : put everything together and answer what you are ssked.
critic the different methods, i guess that's where your professor want to lead you.
for personal purpose can u tell me where/major/university/level of your studies. just for curuiosity
free exchanging : france, maajored in physics, PhD in computer science applied to physics in paris
if you are a great C++ developper you can add some stuff :
- possibility using keyboard naturally to enter any usual function and compare each method for it, auto-mesh, auto-Xo and auto-grid
- add others root finding methods (polynoms solving, multiples roots, properties of F and its derivative...)
- point at problematic cases
good job and if you want details ask
PS : if you are very rich, being jobless, i could help you more and more....
styx
|
|
|
|
|
I am trying to Overlap an image (bitmap, jpg, whatever) onto a live video stream. The idea is that a user is supposed to line up the camera with known lines to make future calculations eaiser.
What the intent is that the user will see a transparent (ghost) image of what the camera SHOULD be pointing at and line up the camera to match this ghost image. I find this idea better than simply displaying this image on the side. An overlay would be ideal.
Has anyone done something like this or have any clue how I would do this? Would I need Direct X? VFW?
Thank you in advance!
|
|
|
|
|
tlerner wrote:
I am trying to Overlap an image (bitmap, jpg, whatever) onto a live video stream.
DirectShow is perfect for this. It supports mixing video streams (or videos streams and a static bitmap) natively. Look up the Video Mixing Renderer (VMR).
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
I'm running Visual Studio C++ .Net 2003, on a Win XP machine.
I'm wanting to put together an application that has access to the USB 2.0 ports on my computer, so I can connect up some devices my team is working on.
Any ideas how to do this?
Thanks for the help.
|
|
|
|
|
This resource might help [^]
and another [^]
Steve
|
|
|
|
|
I'm making a small utility app that uses ReadDirectoryChangesW(). Everything works fine while the directory I'm watching is on my local machine. But when I try to monitor a network folder, I get the error "An unexpected network error occurred." everytime a file is added (or any other type of file operation in that folder). Does anyone know what's going on? I have complete rights to the folder, so I would guess my app does too, but I may be wrong about that.
[insert witty comment here]
bdiamond
|
|
|
|
|
Check GetLastError() after ReadDirectoryChangesW(). That should tell you what's wrong.
I'm not sure that you can use ReadDirectoryChanges on drives other than a local drive. Check the docs. I certainly can't see it working on non-Windows drives.
Neville Franks, Author of ED for Windows www.getsoft.com and coming soon: Surfulater www.surfulater.com
|
|
|
|
|
GetLastError() returns "An unexpected network error occurred.". I've gotten it to work on network drives, but I suspect that it's because the folder is not actually a windows directory that something is crashing. It's actually a Unix machine mapped into our network to look like a regular windows folder.
[insert witty comment here]
bdiamond
|
|
|
|
|
bdiamond wrote:
but I suspect that it's because the folder is not actually a windows directory that something is crashing. It's actually a Unix machine mapped into our network
I would be surprised if it worked on Unix drives so this makes sense.
Neville Franks, Author of ED for Windows www.getsoft.com and coming soon: Surfulater www.surfulater.com
|
|
|
|
|
bdiamond wrote:
but I suspect that it's because the folder is not actually a windows directory that something is crashing. It's actually a Unix machine mapped into our network
I would be surprised if it worked on Unix drives so this makes sense.
Neville Franks, Author of ED for Windows www.getsoft.com and coming soon: Surfulater www.surfulater.com
|
|
|
|
|
It works fine when I compile under VC 6.0 but when I convert the project to a VC .NET "solution", the following line will return a NULL pointer:
Code:
CWnd* pWnd = GetParent()->GetDlgItem(edt1);
Any helps?
mIchAel Liu
__________________________________________________________
The secret of business is to know something that nobody else knows.
|
|
|
|
|
Please advise MFC libraries for drawing diagrams/charts. As tried I couldn't find anything suitable for me.
|
|
|
|
|
There are none, just the wrappers on the core GDI stuff that lets you draw lines, etc. There is no fully fledged chart drawing code in MFC. You have to write it.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
Hi,
If You Want Charts, Why Don't You Use office Web Components(OWC)?
by
baijumax
|
|
|
|