|
Hi guys.
I want to draw in layers, so if anybody could give me a hint about that, I would really appreciate it. I want to be able to draw in multiple layers, so for instance if I am to erase a rectangle or any other more complex object, I would only discard a layer and repaint that object as altered, not having to redraw the background or anything else. It is something like in Photoshop when you draw on the layer and you bring it to the front, then you can delete the whole layer at any moment later.
I only need a general guidance, not the actual code.
Thanks.
|
|
|
|
|
Hi,
I think this is possible. Why don't you decrease the background color when erasing. Like Red when erased become light red. Then you will have a layout and user can redraw or repaint according to layout.
Thanks & Regards,
Salman
Live and Let live
|
|
|
|
|
This is not possible, cause the background drawing will be complex and I can not go pixel by pixel redrawing it so to appear as erased. There has to be a solution for this.
Thanks
.
|
|
|
|
|
Hi guys.
I want to draw in layers, so if anybody could give me a hint about that, I wopuld really appreciate it. I want to be able to draw in multiple layers, so for instance if I am to erase a rectangle or any other more complex object, I would only discard a layer and repaint that object altered, not having to redraw the background and everything else. It is something like in Photoshop when you draw on the layer and you bring it to the front, then zou can delete the whole layer at any stage later.
I only need a general guidance, not the actual code.
Thanks.
|
|
|
|
|
u would keep each layer in a separate memdc and composite them together when u draw the image
then u have controls to select the current layer etc etc
draw from back to front when u composite
"there is no spoon" biz stuff about me
|
|
|
|
|
Hi,
I'm using ODBC to connect to a MS Access database.
Here is what I would like to do:
Load a CComboBox with one of the fields in a table from the database (no problem).
Then, when selecting items in the CComboBox, have a bunch of CEdit boxes loaded with the corresponding row in the table.
Can I use a SQL statment similar to this, as in VB6???:
CString sSQL;<br />
sSQL = "SELECT * FROM tablename WHERE fieldname = selectedcoboboxitem";
I just can't figure out how to do it.
Hope someone can help me out!
Also is it possible to compact and repair a MS Access database through the ODBC???
Thanks in advance.
|
|
|
|
|
no u cant do that in raw sql from any language
u would have to do something like:
"select fieldname1,fieldname2,fieldname3 from table where blah = blee"
then i would suggest u use a clistcontrol to display them and allow in-place editing of the reqd columns (u might need a custom clistcontrol from here to do the editing)
"there is no spoon" biz stuff about me
|
|
|
|
|
Thanks for your reply but could you please give me an example on how to select fields in a database based on the selection of a combobox.
The SQL statment won't accept CStrings.
I would really appreciate it.
Thanks again!
|
|
|
|
|
Please disregard my previous message!
I have found out how to do it myself.
|
|
|
|
|
Lets say I have a Play() function that starts playing a media file when you press the P key on the keyboard.
My situation is as follows. I am recieving commands from an IR receiver. When you press a key on the remote control that is associated with play I want to send a "message" or event that tells my application that it should execute the Play() function.
So, my question is how can I simulate pressing the P key without physically pressing the key. I guess this would be similar to those programms like Girder and uIce that send keystroke messages to a given window.
Thanks,
Steve
|
|
|
|
|
You can simulate keypresses by sending WM_KEYDOWN and WM_KEYUP messages, if your application is a windowed app. An alternate approach would be to have both the keyboard handler and the IR receiver handler call a common Play() function.
Software Zen: delete this;
|
|
|
|
|
My application is dialog based. I just tripped across the SendInput() function which will help me do as you have suggested. I think in my circumstance your suggestion of the keyboard handler and the IR receiver handler calling a common Play() function is a good fit for how my project is setup.
Thanks for your input.
Steve
|
|
|
|
|
background info:
i currently have an MDI app (created with Visual Studio .NET 2003) that can properly create new child windows. each of these windows contains a rendered scene via OpenGL. all of my OpenGL calls are invoked from within an overloaded OnPaint() method. i enabled double-buffering so animations are smooth. i also overloaded the OnEraseBkgnd() method so the background will not be repainted when the child window is resized.
the problem:
when i make a selection from the main menu bar i noticed the menu dropshadow flickers when it occludes/overlays a portion of the child window.
my first assumption was that my scenes were too complex; the flickering exposes the slow "repaints" of the scene. as such, i made the necessary changes so that each child window only displays a blank grey background. the problem, however, persists for even this most simple of scenes.
i next looked up the online documentation regarding the CWnd::OnPaint() method. the docs state the framework calls OnPaint() only once by default. to verify this i set a breakpoint in my OnPaint() method only to discover it gets called dozens of times!
i suspect the flickering is due to the framework calling the OnPaint() over and over and over again. an artifact from the time-consuming "repaints" is this flickering of the menu dropshadows.
does anyone have any suggestions on how to ensure that OnPaint() is only called when necessary? any help would be greatly appreicated. thanks.
|
|
|
|
|
Hi,guys.I have a question to ask,anyone could help?
In VC++ 6 ,I build a SDI program,and add a dialog class used ClassWizard.
In the dialog class CPP file,I include the file of the view.
/#include "hotel_misview.h"
then complied this project ,the complier gave me the message follow:
<br />
i:\microsoft visual studio\myprojects\database\hotel_mis\hotel_misview.h(21) : error C2143: syntax error : missing ';' before '*'<br />
i:\microsoft visual studio\myprojects\database\hotel_mis\hotel_misview.h(21) : error C2501: 'CHotel_MISDoc' : missing storage-class or type specifiers<br />
i:\microsoft visual studio\myprojects\database\hotel_mis\hotel_misview.h(21) : error C2501: 'GetDocument' : missing storage-class or type specifiers<br />
could anyone tell me why?Thanks a lot.
===============
YES, I am here.
===============
|
|
|
|
|
/#include "hotel_misview.h"
If this is how you wrote it in your code too, you better remove the "/" before the #define preprocessor.
|
|
|
|
|
sorry , I made the mistake in here but right in my code.
===============
YES, I am here.
===============
|
|
|
|
|
You need to #include the .h file that declares your document class in hotel_misview.h , prior to the first reference to CHotel_MISDoc .
Software Zen: delete this;
|
|
|
|
|
Somehow .Net 2003 wants to rebuild my solution even on a simple 'build' command. This has never happened before, and I really don't know what to do.
Could someone please helpe me?
AmmA
|
|
|
|
|
|
That worked! thank you very much
|
|
|
|
|
Hail everyone,
I started a new project recently and now, in a design stage, I've got some points where I'd like to have as many opinions as possible.
First of all, the data handling. Let's say I have tons of small object which are referenced by some other object and those are referenced by others. We can see it as a forest with trees and leaves on those trees. So, it's logical to make an array of leaves, trees and forests(cuz I will have more than one forest). But on leaves I might have insects and those insects will be created by other coders. So I need another array of some general insect objects on each leaf. Those insects can be very different, but they should have the only one in common, they should have a possibility to be on a very sectain leaf in my forest. Looks like pretty trivial, though I expressed it in a bizarre form. But there are some disputable points. As such, where to store insect objects, inside an array on the leaf or inside some other global array? Logicaly an insect object must be inside the leaf object (cuz an insect can't be on more than one leaf in a time, so it's not wise to use any kind of refereces), but in the same time we don't know what kind of insect we have, so we can make an array of a generalized insect object and use conversion, but what will happen to data of derived class then? Another question is how to make a copy of a tree, and make it fast, if we want to modify it without modifying an original instance of the forest? Or maybe this idea about arrays is wrong in general and there some better ways to do that?
Sorry for such a long post.
I will be happy with any kind of remarks and ideas.
Small remark though. I will have LOTS of leaves cuz number of trees in one forest can be about 500k. And another things, I am not allowed to use any kind of language extensions but STL.
Thanks in advance.
|
|
|
|
|
ummmmmm i dont think the technicalities of the storage mechanism is where u want to be looking here ... how its stored is not that important
why dont u make some classes for each of the main components in ur design, ie:
forest
tree
leaf
etc
then worry about the internal storage of each class as u get there
personally i would use cobjlist's or some such but ur requirements may be diff
"there is no spoon" biz stuff about me
|
|
|
|
|
Doea CPU ID is something unique for each computer/processor? I need something unique in hardware that does not change with changing OS and unique for EACH machine?
Mazy
No sig. available now.
|
|
|
|
|
CPU ID is not universally available, some manufacturers disable the instruction.
What I've done is a compound key comprised of a variety of hardware ID's/serial numbers, but even that can't be guaranteed unique, you'd be surprised at the major HW vendors that put out motherboards and such with the same serial numbers in all their machines.
MAC address is good, but it all depends on your target audience. A lot of cards can have their MAC addresses changed by someone with the manufacturer's utilities, so if you're dealing with someone savy.
This is a thorny problem...
|
|
|
|
|
Thanks for your reply.
Mark Tutt wrote:
CPU ID is not universally available, some manufacturers disable the instruction
Well,I don't need 100%,Could we said it is unique in Intel and AMD cpu's?
Mazy
No sig. available now.
|
|
|
|