|
Thank you........it's somewhere to start anyway. I'm trying to animate the level rising in a spherical tank. I have a file containing the values of level against time that I need. I can't think of any way to do this though! I wish my tank was rectangular and then it would be easy!
|
|
|
|
|
I am not an expert in animation, but one thing you could do is draw one
frame in memory and then paint it to the DC. Then draw the next frame in
memory, delete the current picture and then draw the frame from memory
to the DC. This may not be the most efficient way.
http://mathworld.wolfram.com/Circle-LineIntersection.html[^]
should give you a good outline of line-circle intersection.
You could use the lowest point on your circle as the coordinate origin.
|
|
|
|
|
Hi
I have aproblem using SQL Command in VC++.
example:
I have an int variable and I Want to say
_T("select * from table where n= ? ")
what should I say infront of n .
for string variable I should say say something like this
'"+x+"' but for int variable I cann't do this
Please help me
|
|
|
|
|
CString strSQL;
strSQL.Format("select * from table where %d = ?", intvalue);
This should be enough.
BD
|
|
|
|
|
I am trying to figure out how to get the version number of Access that was used to create an MDB file.
I have a need to detect if a specified MDB file was created with Access 97, or Access 2000.
I know there must be a way of detecting this, since Access can tell when it opens the file.
Just so you know, I am using ADO. I am not sure if I even use ADO to get this version number.
: Dean 'Karnatos' Michaud
|
|
|
|
|
Hy everybody!
I have a question :P
I have an object of class A, and an object of class B.
I'm tryng to declare an object (pointer) of A in B, and a object (pointer) of B in A. In my includes I have:
class A header:
#include "B.h"
class B header:
#include "A.h"
But this causes serious errors in compilation, and I need global variables.
Can anybody help me how can I do this without errors?
thanks All!
cheers!
Ricky
|
|
|
|
|
In the header of class B, place
class A;
and in the header of class A, place
class B;
for example....
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
class B;
class A
{
public:
|
|
|
|
|
Hy John!
man, this doens't work
I put:
class A;
class B : public CDialog
{
...
A objA;//just for test
}
and give's me the error:
'objA' uses undefined class 'A'
thanks!
Ricky
|
|
|
|
|
Are you still including the .h file for the class?
|
|
|
|
|
|
You will need to retain the .h includes as well as the
declaration of the class.
Or, you can see Rage's post below. Both methods should work.
|
|
|
|
|
when you say "...as well as the
declaration of the class.", you're saying all the code
(functions and variables)?
thanks for the patience John, I'll try the two methods.
Ricky
|
|
|
|
|
No no. Just include the header file for class A in the .cpp file of
class B. Then in Class B's header file place "Class A;" as indicated
previously.
ie:
in B's .cpp fild, #include<classA.h>
in B's .h file, class A;
Do the same for class A.
In A's .cpp file, #include<classB.h>
in A's .h file, class B;
This should work.
|
|
|
|
|
Yeah!
This works great!
Thanks all of you for your help!
Thanks John!
cheers!;)
Ricky
|
|
|
|
|
Ricky_TheBard wrote:
I put:
class A;
class B : public CDialog
{
...
A objA;//just for test
}
If you forward declare class A in the header file for class B, then you don't need the header for class A in the header for class B as long as you use a pointer to class A. In your example you are using an object.
class A;
class B : public CDialog
{
...
A* ptrA;//just for test
}
|
|
|
|
|
Declare your global variables in one of the .h, and declare them also in the other one where you need them, but put extern before all declaration.
~RaGE();
|
|
|
|
|
Ok, Rage, I'll try your suggestion after John's
thanks!
Ricky
|
|
|
|
|
Ricky_TheBard wrote:
I need global variables.
If you need using global variables, then you may consider redesinging your application... Global variables are not your friend in an OO environment.
Best regards,
Alexandru Savescu
P.S. Interested in art? Visit this!
|
|
|
|
|
I've used IPicture to provide a resizable imagepanel in my application. It only took me 10 minutes to implement it. It's very straightforward.
When I resize my app, the picture resizes along.
But I don't want the picture to be just resized. It's fast, but there's a great loss off quality.
So, is there some sort of way to "resample" an IPicture? Using various resample-filters?
There's no function to do that inside IPicture, I think. But during a search on google, an IPicture2 turned up, with a Resample(x,y) function in it. Is there someone who knows more about it?
tnx
using: [VISUAL STUDIO 6.0 sp5] [WIN98/2]
|
|
|
|
|
i have a CFrameWnd inside of a CSplitterWnd pane. when it first appears, it has size of, say 500x300. then assume i resize the frame manually, to 600x500. simple enough so far.
the OnPaint handler of the CFrameWnd looks like this:
void cDataExpressInternalFrameWnd::OnPaint()
{
CPaintDC dc(this);
CRect client_rect;
GetClientRect(&client_rect);
afxDump << "fv " << client_rect << "\n";
}
all i do is trace out the client rect of the frame wnd.
but... if i invalidate a part of the frame, by resizing or by dragging another window on top of it, the CFrameWnd's client area redraws like this:
fv (0, 0, 500, 300)
fv (0, 0, 600, 500)
fv (0, 0, 500, 300)
fv (0, 0, 600, 500)
fv (0, 0, 500, 300)
fv (0, 0, 600, 500)
...
in other words, each time the CFrameWnd is invalidated, it draws twice: once at the initial size (500x300, in this example) and then once at the new size (600x500).
i can't figure out why the client rect keeps reverting back to the original size. i'm not resizing the frame wnd back to that size anywhere.
has anyone ever seen this?
-c
To vote with no response is to follow the way of the coward.
|
|
|
|
|
That's interesting. I've never noticed this behaviour before.
I am wondering if it needs the initial values to retain the aspect
ratio??
Let me know if you figure it out.
|
|
|
|
|
I have the following bit of code:
vector<double>::iterator itr;
for (itr = dmStack.begin(); itr != dmStack.end(); ++itr)
{
TRACE("Node Number: %d ", i);
TRACE("Node Energy: %d \n", *itr);
i++;
}
Node energy values are usually in the range of 1x10^(-16). If I send
the value of i and *itr to stdout (console) they are displayed properly,
however, if I send them to the Debug window of the vc++ IDE (using TRACE()), I get:
Node Number: 0 Node Energy: -1684540248
Node Number: 1 Node Energy: -1684540248
Node Number: 2 Node Energy: 0
Node Number: 3 Node Energy: 0
Node Number: 4 Node Energy: 391017576
(Energies should never be negative or excessively large.)
I suspect that I am not formatting the output properly. I could have
sworn it was %d that I wanted - is that not correct?
|
|
|
|
|
If I remember correctly, I've read somewhere here on CP that it is not possible to output STL things with the TRACE command using an iterator.
~RaGE();
|
|
|
|
|
Oh no, really?
Do you know where that post/article would be by any chance?
|
|
|
|
|
I found that this works:
vector<double>::iterator itr;
for (itr = dmStack.begin(); itr != dmStack.end(); ++itr)
{
TRACE("Node Number: %d ", i);
TRACE("Node Energy: %e\n", *itr);
i++;
}
|
|
|
|