|
I'm trying to program a dialog which has a "canvas" for me to draw lines and text.
The general idea is to have a dialog with editboxes etc for inputing line coordinates and text to display on a canvas.
Any help appreciated.
|
|
|
|
|
What part are you having problems with?
|
|
|
|
|
what exactly u seeking for ? u can draw lines on WM_PAINT messages comes. u can also draw text using TextOut or DrawText . But why you need to enter position for line ? or is it any 3d coordinates etc ?
If u can Dream... U can do it
|
|
|
|
|
i have to develop an application which displays TIFF images n allows the user to make it larger or smaller by using the mouse pointer. i have read how to read/write tiff files(code in c) but it really doesnt help much.
please let me know what to refer. presently am reading mastering VC++.
just a bit of push in the right direstion will be enough.
THX
k sunita
|
|
|
|
|
Loading and saving TIFFs is probably the biggest challenge. If you've read the TIFF specification
then you probably have an idea how big a task writing a TIFF loader/saver can be.
Windows provides GDI+[^] which will handle that for you, along with scaling, drawing, and many
other things you may need to do with bitmap images. There's lots of articles here on CP to help
get you started...search for "GDI+".
Also, a solid understanding of Windows messaging will help immensely for developing the UI
related code.
|
|
|
|
|
K Sunita wrote: i have read how to read/write tiff files(code in c) but it really doesnt help much
Why? Doesn't that code make the job for you?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
Hi.
I would like to know what if it's possible to build an application that relies on external GUI plugins with a fixed interface ? What i mean is something like a property sheet, only that the sheet pages are loaded from external DLL's and not from the main executable.
I've tried some things, begining with invoking a modal dialog from an external DLL, and that worked fine. However, this is not what i need.
I then moved on to trying to add pages to a property sheet dialog. this action gave me some strange behavior, such as ASSERTION errors on multiple locations (wrong resource handle for example).
I would like to know if this is possible. I'm not fixated on the property sheet idea, although it is the prefered way at the moment.
I would appreciate any information you can share.
best regards,
Chen Ganir
|
|
|
|
|
Do you want just the dialog resources in a dll or an MFC extension DLL with the code and the
resource in the DLL? Both are possible.
|
|
|
|
|
Hi Mark.
Thanks for your quick reply.
I would prefer the entire code in the DLL, probably an MFC Extension DLL.
thanks for your help !
Chen Ganir.
|
|
|
|
|
This document Extension DLLs[^] explains what needs to be done better
than I ever could If you need to explicitly link to the DLL at runtime (using LoadLibrary)
then using exported C-style stub functions and GetProcAddress() is a simple way to go.
|
|
|
|
|
Thanks again for your help. i'll take a look at it and hopefully it will provide the required answers i'm looking for
br
Chen Ganir.
|
|
|
|
|
No problem. If you run into any problems just post again!
Mark
|
|
|
|
|
Hi Mark.
I've ran into the same problems as before. i can't seem to make it work for some reason. Can i email you the code so you could take a look at it ?
thanks,
Chen Ganir.
|
|
|
|
|
Context: In a multithreaded app, two threads share access to an object. The members of the objects class are private and are accessed through mutators and accessors that use critical sections to syncronize.
Problem: Where to put the volatile access modifier go in regards to the object and/or it's class?
Question: Should the object, the members of the objects class, or the object and it's class members be declared using the volatile access modifier?
|
|
|
|
|
What is correct way to update custom dialogbars in document/view MDI architecture when the current document is deactivated or a new document is activated.
I am currently trying to send messages to the CMainFrame:public CMDIFrameWnd when a CView is selected and sets a different active document. This does not take into account other ways in which the Active document might be set (I don't know hat these might be). CMainFrame can see all the dialog bars and should be the one to update them based on the active document when the active document is changed. I was looking for a simple OnActivateDocument() event, or something like it, in CMainFrame couldn't seem to find it.
There has to be a simple way and I am just missing it.
|
|
|
|
|
By design, this is usually done in a CView::OnInitialUpdate() override. If you really must handle
window initialization from another window class then you can define your own WM_ messages or add
methods to your window classes. At that point you're really not tied to the Doc/View architecture
so you may find yourself fighting it.
If you handle scrollbar initialization in a CView::OnInitialUpdate() override then your view
classes will stay within the doc/view framework.
Just call it when you change the view's associated document.
|
|
|
|
|
gor wrote: CMainFrame can see all the dialog bars and should be the one to update them based on the active document when the active document is changed.
I agree. I update dialog bars from CMainFrame in much the same way as you descibe, except that I make the functions public and call them directly from my view/doc classes instead of sending messages. I override CView::OnActivateView() to get the correct action when the current view is deactivated or a new view is activated. The only problem I had with this was coping with the counter-intuitive way the system sets the pActiveView and pDeactiveView parameters (I'm not sure if this is relevant to your enquiry, but I can provide a code sample if you are interested).
I don't know if this is the best approach, but I can vouch for the fact that it works, and that it deals with activation of views by conventional mouse clicks and custom code. It seems strange to me too that there is no function in the CMDIFrameWnd class that can be overridden to achieve this - if you ever discover a better way I would be very interested to hear.
Best Regards
Cliff
|
|
|
|
|
Dear all
I have one project in which I should play data from computer sound card and
record voice from it (By microphone).
I need a class that do above options in real time.
Also I need to receive voice data from network and transmit voice data to it.
Thus I need following classes:
1. Real time classes to send and receive data to and from network.
2. Real time classes to play voice on sound card and receive voice from microphone of system.
May you please give my information in this regards
No My program does not work in real time and after a while I find that some delay exists in playing data and recording it when working with network.
Cheers
Monhi
|
|
|
|
|
Voice/sound communication between PCs is big-business these days so it's unlikely you are going
to have the code given to you, especially if it's good code.
There are some things you need to deal with:
1) Latency. Your sallest buffer size will determine your minimum latency. If you're capturing
or playing audio with 500ms buffer chunks then you have a minimum latency of 500ms (1000ms if
using 500ms buffers for both capture and playback). Solution - keep buffer granularity as small
as possible.
2) Clock drift. Clocks are different on every machine. Generally you'll capture and playback
audio at the same sample rate. If the clock used for timing on the capture side varies from the
one used for playback then your audio drifts over time - the latency increases or decreases.
I have a machine that the latency increases 1s every 10 minutes or so capturing from one device
and playing back on a different device on the same machine. Unnaceptable for real-time
Solution - you'll think of something. It's a main part of my business so I'm not giving my
solution away - Google search on "clock drift" may yields some hints.
3) Network jitter. With full bandwidth available at all times it's no problem. When this is not
the case (often) it's a problem, causing jitter in the playback (crackles/pops/noise caused by
gaps in the audio stream. You'll probably need to account for this by using some kind of jitter
buffer on at least the playback side. A jitter buffer will add latency so consider that in the
overall design.
|
|
|
|
|
To create a safest release executable, what options we should set when compile vc++ project in vc .Net 2003?
Thanks & Regards,
Suman
|
|
|
|
|
What do you mean by 'safest' ? If you statically link to everything, like MFC, you get a bigger EXE with no external dependancies, is that what you mean ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
By 'safest' I meant, compiler should warn if there is any possibility of using uninitialized variable, or something else which will cause runtime error, and whatever the compiler can detect.
Thanks & Regards,
Suman
|
|
|
|
|
During a compilation of C/C++ file, how can i know that the caller project(project which contains that cpp file) is using MFC or not.
Warm Regards,
Mushq
|
|
|
|
|
Check the _MFC_VER macro, if it's an MFC project, that macro is defined as the MFC version.
|
|
|
|
|
Thanks for quick reply, and it is woking fine.
Regards,
Mushq
|
|
|
|