|
no that doesn't work either way they both compile, but neither method changes the structure in the my document class.
I may have to rethink things, just off the top of my head could it be (*(ptp->tkGO->direction)).direction?
I'll just try that way and get back, thanx for your help, get back to you soon
|
|
|
|
|
Take a look at this line :-
thr->tkGO=&take; // take is a TAKEGO declared in CDocument defined above
Where have you declared take?
Is it a temporary stack variable that goes out of scope?
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
If you don't find me on CP, I'll be at Bob's HungOut
|
|
|
|
|
it's declared in the class & no it shouldn't have gone out of scope.
|
|
|
|
|
indeed when i want to change the color of the background ,i must call the FillRect like method,
is there another method will fulfill it with SetBkColor?
thanks
one is the other who absorbs the thoughts of others
|
|
|
|
|
Hello ooze,
SetBkColor() is generally used in GDI operations where the use of a Pen is involved (e.g. TextOut(), DrawText(), etc).
If you want to programmatically control the background color of a window, set the "hbrBackground" member of your window's WNDCLASS structure to NULL, and then process the window's WM_ERASEBKGND message. See the Win32 API documentation on WM_ERASEBKGND for more details.
However, to actually perform the coloring operation, you'll still have to use functions like FillRect() etc.
Hope the above info will be helpful to you, ooze.
Regards,
Bio.
|
|
|
|
|
need to set the hbrBackGround memeber of WNDCLASS to null?
of coz , we hope the color display on the background actually.
so it seems the API isn' t really useful when not using CreatePen.
one is the other who absorbs the thoughts of others
|
|
|
|
|
GDI.DMBITBLT
GDI.DMCOLORINFO
GDI.DMENUMDFONTS
GDI.DMENUMOBJ
GDI.DMOUTPUT
GDI.DMPIXEL
GDI.DMREALIZEOBJECT
GDI.DMSCANLR
GDI.DMSTRBLT
GDI.ENGINEDELETEFONT
GDI.ENGINEENUMERATEFONT
GDI.ENGINEEXTTEXTOUT
GDI.ENGINEGETCHARWIDTH
GDI.ENGINEGETGLYPHBMP
GDI.ENGINEREALIZEFONT
GDI.ENGINESETFONTCONTEXT
|
|
|
|
|
Where did you find them ? Visual Assist and Visual C++ do not recognise them.
Christian
I have come to clean zee pooollll. - Michael Martin Dec 30, 2001
Sonork ID 100.10002:MeanManOzI live in Bob's HungOut now
|
|
|
|
|
I run the following code fragment to produce some graphics. The problem is it produces different results at different times.
Could this be a rounding error? And how can i fix ot
for (int col=0; col
|
|
|
|
|
Code Fragement:
for (int col=0; col
|
|
|
|
|
I presume you have a > as well as the <, which is causing your for loop to disappear. Use & and lt or gt to put a < or > if they are paired like an HTML tag.
What are you doing with iXVal ? You're using all whole numbers, so there's not going to be any rounding errors.
Christian
I have come to clean zee pooollll. - Michael Martin Dec 30, 2001
Sonork ID 100.10002:MeanManOzI live in Bob's HungOut now
|
|
|
|
|
I'm not sure about evaluation order in C++, but probably, the expression:
x + (a * b / c)
will be evaluated as:
x + (a * (b / c))
if a, b and c are big enough, or multiple, or floating point, no problem, but in your case, if m_cols > 1, in the first loop pass, (col+1)/m_cols will evaluate as int(1/2). That's 0. So, iXVal == m_rectLocation.left, what's wrong.
If you do this:
int iXVal = m_rectLocation.left + (m_rectLocation.Width() * (col+1)) / m_cols;
That rewrite will force m_rectLocation.Width() * (col+1) to be evaluated before the division. There still will be rounding, but MUCH less problematic.
Crivo
Automated Credit Assessment
|
|
|
|
|
Damn - I did not spot the divide. But I think divide and multiply have the same order of operation and evaluate left to right.
Christian
I have come to clean zee pooollll. - Michael Martin Dec 30, 2001
Sonork ID 100.10002:MeanManOzI live in Bob's HungOut now
|
|
|
|
|
Yes, they do. Multiplication and divide evaluate left to right.
(a * (b / c)) != (a * b / c)
Tim Smith
Descartes Systems Sciences, Inc.
|
|
|
|
|
How do i read and write to files in MFC?
thanks
|
|
|
|
|
If your using MFC with the Doc\View architecture then check out the CArchive class used in the Serialize function in the CDocument derived class for which the wizard should generrate some code that looks like:
void CMyDoc::Serialize(CArchive& ar)
{
if (ar.IsStoring())
{
}
else
{
}
}
Hope this helps. Check out CArchive on MSDN here.
Giles
|
|
|
|
|
|
Exist some message which is sent after a time when dialog and control are repainted ?? If I put the code in WM_PAINT and code draw where is the control i dont see anything.
|
|
|
|
|
do you mean "what messages cause the repaint of the controls on a dialog" or do you mean "is there an automatic redraw message sent every xx seconds"
??
---
"every year we invent better idiot proof systems and every year they invent better idiots ... and the linux zealots still aren't being sterilized"
|
|
|
|
|
I need draw resizeing box using CRectTracker and I dont know where i must put the code.
|
|
|
|
|
If you draw in WM_PAINT and you don't see anything, it means your drawing code is broken. You can also draw in WM_ERASEBKGND if you're drawing the background of the dialog, to avoid flicker.
If you're doing something whereby you want the dialog repainted, you need to call Invalidate(), or Invalidate(FALSE) if you don't want to erase the dialog ( again to avoid flicker ).
Christian
I have come to clean zee pooollll. - Michael Martin Dec 30, 2001
Sonork ID 100.10002:MeanManOzI live in Bob's HungOut now
|
|
|
|
|
I'm a little confused regarding InternetGetConnectedState().
If I run this function without a connection, dwFlags returns RAS, LAN and CONFIGURED
If I run this function with a connection, dwFlags returns RAS, MODEM and CONFIGURED
... so in truth, it doesn't appear that InternetGetConnectedState() is a very reliable test of whether or not you have an open connection. It seems to think that just because I have a LAN, that i must also be connected to the internet. Perhaps, it is merely testing for active ip traffic, sees the LAN, and hopes that it may be an internet source. I think this function simply returns true if it sees that you have a connectoid configured, regardless of whether you are connected
My only concern is that if it returns true, i assume a connection and then use other inernet sdk functions. If in fact there is not a connection, then a dialup is thrown. I don't want to throw up a dialup without first asking the user if they are ok for me to throw a dialup. Sure, i can inform them that running the functionality requires an internet connection and then they'll not be too surprised to see the dialup if i throw one. But as a developer, i'm obviously looking for the perfect solution.
I've also tried InternetAttemptConnect(0), and it always tell me that i am connected
I've also tried InternetCheckConnection(), and it always tells me that i am not connected
Whats a developer to do ? Is there any method that i can rely on ?
Jase
-------------------------------------------------------------------------------------------------------------------------------------------------------------------
View your digital photos and images with ease using the ultimate desktop image manager for Microsoft Windows
Download your free copy of SlideShow Desktop today from http://www.slideshowdesktop.com
|
|
|
|
|
you don't want to try pinging a known ip address outside of your local network and seeing if you get a response?
---
"every year we invent better idiot proof systems and every year they invent better idiots ... and the linux zealots still aren't being sterilized"
|
|
|
|
|
not really ... if your not connected it can take too long to timeout
Jase
-------------------------------------------------------------------------------------------------------------------------------------------------------------------
View your digital photos and images with ease using the ultimate desktop image manager for Microsoft Windows
Download your free copy of SlideShow Desktop today from http://www.slideshowdesktop.com
|
|
|
|
|
Try using InetIsOffline
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
If you don't find me on CP, I'll be at Bob's HungOut
|
|
|
|