|
You might be able to use some of these tips: clickety[^]
--EricDV Sig---------
Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them.
- Laurence J. Peters
|
|
|
|
|
I tryed to use CopyFile to a mdf file, but because in my program I use the database i can not copy it. What should I do so I can copy it? I use CRecordSet class.
|
|
|
|
|
Can you close the file prior to copying it?
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
i write a installer program which install the program in the directory where i set .But i like my program should be available in desktop and system tray also . how can i get it . [with source code ]
janan
|
|
|
|
|
ningthemcha wrote: my program should be available in desktop and system tray also
You have to create a shortcut file to your application in the Desktop..
To have your application in SystemTray, then your application should be running.. for that use Shell_NotifyIcon(...) API
ningthemcha wrote: [with source code ]
For code you can get it from CodeProject itself..
Do your Duty and Don't expect the Result
|
|
|
|
|
hi there!
I'm in need of some program zu create 3d models. Well I know that ther'e thousands of programs but what I need is something i can integrate into my programs.
so I want to create a winapi-class wich is a simple modeller window.
features have to be:
> 4 perspectives (xy, xz, yz, iso)
> move view, zoom, turn around zero, turn around cam
> draw lines
> draw triangles
> draw points
> select items
> move selected items
> return where the mouse clicked in 3d and which button was clicked.
> return clicked points
> redraw
I'd like to write this in openGL but I'm not very experienced with it.
Did anyone ever make something like this and is able to help me or may someone give me his lib?
thx
tec
|
|
|
|
|
Hi,
I have written a modeller using OpenGL, and it works. However it is a big amount of work to get it to work, then some more to add modelling features.
I looked at my modeller and it is not cenvertible into a lib. This is mainly due to the fact that GUI/engine integration is one of the most important aspects. This means that it is a large amount of work to try and divide the two, and create an abstract interface class to separate the GUI from the engine.
If you simply wanted a "display" engine it is easy to split GUI and display engine, but modelling involves moving the mouse, clicking with it, dragging and dropping, window coordinates, world coordinates, perspective coordinates, point lists, line lists, surface lists, color lists, and many more other things that are just a big pain, and all this while providing great feedback from the engine to get everything drawn in the right places while the user interacts. Other features like undo/redo, save/load, import/export are also a big pain.
So, you see, what you ask for is more of an application rather than a lib. If you specify a little better what features you would like your modeller to have then tell me about them and I can see if I can convert my EXE into a DLL.
I hope this helps,
Rilhas
|
|
|
|
|
I see, there's much more work to do than I thought.
I need features like
- displaying points, lines and surfaces (triangles should work)
- external point-, line-, texture- and surface lists I can handle with (maybe vectors). If these are external, I can use more than one child window or create animations
- moving, turning and zooming for the cam (maybe a "set all back to zero")
- selecting and mutiselecting points, triangles and lines.
- moving selected items
- a function to tell the main window the last clicked 3d coordinates (for creating points at this position.
- texuring
Well, I think that's "all". I hope it's not too much
|
|
|
|
|
I think I am starting to get a better idea of what you want. However, I still have some questions before determining if I can help you with it.
Q1) How do you specify objects to the lib? Where do they come from? Do you want to specify them as lists of 3 points (for triangle vertices) 2 points (for lines) and 1 point (for points)? Also I assume you want to have colour (although you can implement color through texturing).
Q2) How do you want to get them drawn? Do you provide an HDC for the LIB to draw in or should it have its own window?
Q3) Do you wish that the lib contains 4 areas (front, top, side, perspective) or only 1 area (perspective)? The easiest way for implementation is for you to have 4 diferent areas in your window (or 4 different windows) and tell the engine which one you want to get drawn and to which one the mouse events apply.
Q4) Does the lib have to delivered in source form? Must it be free?
Q5) I assume you would like a client/server architecture where you (the client) supply object information to the lib (server) and issue draw commands. This architecture does not mean that the server is an EXE on its own, since I assume you wouldn't want that. If you want that (maybe even a distributed TCP/IP architecture) please specify so.
About the information you provided:
I1) I assume only filled triangles are displayed in the perspective view, and that wireframe triangles are used in the orthogonal views (this is connected with Q3) above).
I2) Does this mean you want objects of 3 types? The point, line, and surface? I don't understand the use of the word "external"... what do you mean by it?
I3) In the client/server architecture Q5) you should provide the server the visible area dimensions and also the mouse coordinates inside that visible area for the server to compute the movement. Do you wish to handle the mouse button states? I assume so, in which case you would have to inform the server what handling type (move, rotate, scale, ...) you are associating with the movement.
I4) Selecting items can be made in much the same way as with the movements. However, you should specify if you want to select things like points in a line or points or lines in a triangle. These would complicate matters significantly (because it leads to type promotion), but usually a decent modeller would implement them.
I5) This is connected with I3) above, in the sense that it would be implemented in the same way but you would associate only a subset of the world to the movement, rotation, and scale.
I6) In a more general sense, you would have functions to convert from world to window, and from window to world. Note, however, that in the most general sense clicking the window produces 2D information, thus resulting in a corresponding infinite line within the 3D world. A selection rectangle in a window, for example, in general produces an infinite cube in the world.
I7) Texturing would be no problem to display, but, again, the problem is the way in which you provide information. Technically you can have any triangle vertex mapped to any point in the texture, but this usually leads to a fairly large amount of manual work in the texture mapping process (the user has to work all the points manually) and interface features to allow the user to do this are very complex. So, typically, the easiest way to associate the texture to an object is to specify how you want the texture to be wrapped around the object (spherical projection, cylindrical projection, planar projection, ..., and projecting through what axis) and let the engine do it automatically. Incremental manual changes from there on are much easier for the user, but the interface for manual changes is still very complex.
Rilhas
|
|
|
|
|
Hello again.
It took some time to read your post (my English isn't the best at all)
Ookay, let's have a look at your questions:
Q1) I'd like to use vectors of structures point, surface, line.
something like
struct point {
float pos[3];
int s, t; // for texturing
bool textured;
bool visible;
bool active;
};
struct line {
long pointa, pointb; // index of two points
bool visible;
bool active;
};
struct surface {
long pointa, pointb, pointc;
bool active;
};
Q2) to privde a HDC to the lib seems to be fine.
Q3) if the lib gets a HDC I should be able to create four or more windows on my own, or not? each window would only have one perspective (front^top^side^perspective)
Q4) I think source may stay yours but it should be free to use in any way.
Q5) if you mean server-client architecture as opengl, I'd say yes.
I1) I think that'll be okay. Maybe it would be useful to set a switch for drawing the points and lines to the perspective view (as well as the texture?)
I2) external means that I want to manage these lists in my progam so the library only has to draw them. The lists will be given to the lib as parameter to the create function. That way i'll be able to use more than one window for creating my objects and I can use lines for bone animations
I3) my program could send a function call "setAction(int action_type)" to the lib
I4) The only thing that's needed is to select points. If I move a point, the trangles or lines will follow.
I5) I don't really understand what this question means, but think you're right
I6) if you mean the multiselect, a single point select combined with CTRL may be a siple way to handle this?
I7) my idea was to use a window which shows the texture where I can move a pointer which is automatically transferred to a selected point. Render a spherical projection to the object would be a nice init for the texturing process. Btw: Blender has a funny feature: you can spray your texture directly to your object but I don't believe that one can get useful results.
Well I hope my suggestions aren't too difficult
|
|
|
|
|
Sorry for the delay in my answer, my home computer died on me so I'm using the computer at work.
Q1) Seems fine.
Q2) Ok. There is a performance penalty in using HDC's external to OpenGL, but not very significant. The alternative would be for the lib to own the window, which I don't think you would find interesting.
Q3) Yes, could be one way or the other. The lib could draw only one of the windows to the HDC you specify. This means that you could use the same window or use a diferent one. The important point to note is that the lib would need 4 calls to draw the 4 views, instead of one call to draw them all (which would be less efficient, generally speaking).
Q4) Well, in the spirit of my participation at this forum I would not impose any constraints on usage and distribution. The cost issue is pertinent only to any amount of work I would have to do (and this still has to be estimated for me to see if I could do it for free or not). If there was a cost and you decided to pay then the usage and distribution would be free.
Q5) Yes, that was what I meant, but I assume a local architecture (not using TCP/IP or any similar form of distribution).
I1) Ok.
I2) Ok.
I3) Ok.
I4) Ok, that's great!
I5) Ok. This became clear to my with your struct example. Moving selected points results in changing whatever objects are associated with them (either partially or fully).
I6) Ok. Also clear now.
I7) Ok.
Well, I think your sugestions actually ended up simplifying the whole thing. I also assume that all load/save functionality is provided by you, including textures. This means that some requirements may be imposed on them, like:
I8) Do you wish to provide any RGB/RGBA texture map and the lib automatically transform it to match OpenGL's requirements? This typically requires rescaling.
I9) You do not provide a struct example for textures... I assume you don't want to use a single global texture, in which case we should define the concept of object so that each object can have an associated texture. Can I assume that each object can only have one texture? I think this could be simple, like:
struct object {
struct point* point_table;
long point_table_count;
struct line* line_table;
long line_table_count;
struct surface* surface_table;
long surface_table_count;
struct rgba* texture_rgba;
}
I10) I have not tested the usage of untextured points in the middle of textured surfaces. I don't think it works as one might think. So I propose that the object contains information of if it's points are textured or not, and not the points individually. Anyway, each point would still have its s and t. The same applies to the visibility of points (what is a triangle if one of its points is not visible?). Or would a surface drawing consist of its fill, its edge lines, and its individual points?
So, to sumarize, only the newly added I8), I9), and I10) are open issues, all the rest I think are well understood.
Rilhas
|
|
|
|
|
hi,
I8) keep it as simple as possible. I think I can create and handle textures on my own
I9) To my mind a GLUInt for the texture id should be enough? Maybe s and t could be a float value between 0.0 and 1.0. Texture handling can be my task..
I10) I would try to check if any point of a surface is visible. if a point is invisible, the surface shouldn't be drawn.
I again didn't really know what you mean (at least in I8) but I hope your questions have been answered..
|
|
|
|
|
Hello,
I wrote a simple programm using Visual C++ where I want to move a cirle
in a window via drag&drop. I used the pDC->Ellipse() and the
InavlidateRect() functions for drawing the circle.
So far it works. But I have two problems:
1. When I move the mouse quickly during a drag&drop, not the entire
"old" cicle disappears so that I get a trace of the way I moved the
cicrle around
2. How can I implement that with a flicker-free window? (perhaps the
InvalidateRect() and pDC->Ellipse() functions aren't very useful for my
intentions and I should use other functions)
Uday kiran
|
|
|
|
|
hi,
the winapi gdi is - as far as i know - not the fastest. An ellipse is rendered by using pDC->Ellipse(). this needs time, so it flickers..
Perhaps you should use directx?
another way may be to use double buffering.
|
|
|
|
|
no need to re ask... you did it 1hour ago. now wait
|
|
|
|
|
The answer to both of your questions is to use a double-buffering scheme. Basically, you will create a device context that isn't displayed to the monitor, draw to it, then copy all the bits to the screen at once. Do a search on this site for CMemDC and you will hit a couple articles that do exactly that.
When dealing with graphics that change regularly, do not draw them to the screen directly or you will have the flicker problem.
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
Hello,
Is it possible to somehow access Web Services using Microsoft eMbedded Visual C++ 4.0?
If so - Is there any example that does that?
Thank you & regards,
-Andrej
|
|
|
|
|
Hi All,
I have been toiling around with using XMLRPC.Searching on Google didn't provide with any good links or articles. I want to know how to use XML RPC with VC++, where do I get the libraries from, and some samples from which I can gain knowledge about XML RPC.
Can anyone make me point to some article/source sample?
Thanks in advance.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
hi
can we add tooltip to a static text control in win32 Application??
If yes, then how??
Manjunath S
Bangalore
|
|
|
|
|
hi Manjunath,
It is possible to add tooltips for the Static Text, In the Resource Editor for every StaticText ID give a meaning String value.
in the Coding part call CString.LoadString(IDC_ResourceSringID);
Then use CToolTipCtrl ctr;
Ctr.Create(this);
and Try....
//==================
uday.
|
|
|
|
|
HI all,
I have created a ellipse using
CDC::Ellipse(...). but once i have created that ellipse i want to move the ellipse what i have created.
//======================================================================
if((insidepoint == true ) && (nFlags & MK_LBUTTON))
{
CRect rect;
GetClientRect(&rect);
ClientToScreen(&rect);
SetCapture();
nOldMode = dc.GetROP2();
dc.SetROP2(R2_NOT);
one.CreatePen(PS_DASHDOT,1,RGB(200,200,0));
old = dc.SelectObject(&one);
dc.SelectStockObject(NULL_BRUSH);
double dia = sqrt((array[2]-array[0])*(array[2]-array[0]) + (array[3]-array[1])*(array[3]-array[1]))/2;
//dc.Ellipse(OldPoint.x,OldPoint.y,(point.x + dia),(point.y + dia));
dc.Ellipse(point.x,point.y,(point.x + dia),(point.y + dia));
OldPoint = point;
dc.SetROP2(nOldMode);
dc.SelectObject(old);
showCordinates(point);
}
//======================================================================
please let me know any solution.
uday.
-- modified at 6:44 Tuesday 1st August, 2006
|
|
|
|
|
|
hi whitesky,
i have created an ellipse using cdc::ellipse(...).
but once it is created, and the mouse is entered into the ellipse what i have created, if i press the Left button and dragged the ellipse what i have drawn, it should move accordingly with the current position of the mouse.
please help me out. It is really a challenging task.
//===========================================================
if((insidepoint == true ) && (nFlags & MK_LBUTTON))
{
CRect rect;
GetClientRect(&rect);
ClientToScreen(&rect);
SetCapture();
// nOldMode = dc.GetROP2();
dc.SetROP2(R2_NOT);
one.CreatePen(PS_DASHDOT,1,RGB(200,200,0));
old = dc.SelectObject(&one);
dc.SelectStockObject(NULL_BRUSH);
double dia = sqrt((array[2]-array[0])*(array[2]-array[0]) + (array[3]-array[1])*(array[3]-array[1]))/2;
dc.Ellipse(OldPoint.x,OldPoint.y,(point.x + dia),(point.y + dia));
dc.Ellipse(point.x,point.y,(point.x + dia),(point.y + dia));
OldPoint = point;
// dc.SetROP2(nOldMode);
dc.SelectObject(old);
showCordinates(point);
}
//===========================================================
please help me out.
uday.
-- modified at 6:54 Tuesday 1st August, 2006
|
|
|
|
|
if i understand you need to WM_LBUTTONMouse and WM_MOVEMOUSE
for your purpose and you can use from point for position x,y in these messages
-------
i think you can use also from a control (button or...) with a shape like ellipse instead this way
|
|
|
|
|
Hello,
I wrote a simple programm using Visual C++ where I want to move a cirle
in a window via drag&drop. I used the pDC->Ellipse() and the
InavlidateRect() functions for drawing the circle.
So far it works. But I have two problems:
1. When I move the mouse quickly during a drag&drop, not the entire
"old" cicle disappears so that I get a trace of the way I moved the
cicrle around
2. How can I implement that with a flicker-free window? (perhaps the
InvalidateRect() and pDC->Ellipse() functions aren't very useful for my
intentions and I should use other functions)
Uday kiran
Uday kiran
|
|
|
|
|