|
How do I convert a double value to an byte array (byte[8]) and the reverse from byte array till a double value?
In C++ we may take a memcpy to an char array and cast the array to a float!
|
|
|
|
|
Take a look at Convert class, especially ChangeType method.
43 68 65 65 72 73 2c
4d 69 63 68 61 65 6c
|
|
|
|
|
Look at the BitCOnverter class rather
<a TITLE="See my user info" href=http:
|
|
|
|
|
Hello Gurus,
I've been searching for the common icons such as CLOSE, CANCEL, SAVE, CLEAR, NEW, DELETE, Etc... But no luck. Do you know where I can find them?
Thanks again
Khang Nguyen

|
|
|
|
|
They are not stored as icons, but are stored as bitmaps.
You can create a simple single or multiple document project using the wizard and then copy them from the toolbar resouce.
OR TRY
C:\Program Files\Microsoft Visual Studio\Common\Graphics\Bitmaps
Where there are bitmaps for the items you listed in more than 1 directory.
Trust in the code Luke. Yea right!
|
|
|
|
|
That's very helpful! Thank you very much, John.
Khang
|
|
|
|
|
I am looking for a simple alert box to simply display an error message. I was wondering if there was a C# equivlent to AfxMessageBox Thanks if you have any advice.
Matt Newman
Post best viewed with lynx
|
|
|
|
|
Matt Newman wrote:
C# equivlent to AfxMessageBox
MessageBox.Show (message, title, buttons, icon);
- monrobot13
|
|
|
|
|
Too easy
Matt Newman
Post best viewed with lynx
|
|
|
|
|
|
Kant wrote:
Just remove the Afx.
Too easy, I would have never thought of that
Matt Newman
Post best viewed with lynx
|
|
|
|
|
Hi All,
Question: Is it possible to get the size of the main application? Here's my problem, I have a class that needs to know the size of the main form, but it's buried deep in a class heirarchy so it doesn't have direct access to the forms properties. Is there a function to get the main form?
Thanks!
- monrobot13
|
|
|
|
|
monrobot13 wrote:
it's buried deep in a class heirarchy so it doesn't have direct access to the forms properties
That is nonsense! The root is most buried, all specializations are leafs.
There is the ParentForm property, you can call that continuously.
<a TITLE="See my user info" href=http:
|
|
|
|
|
Fisrt thanks,
Second, my class is derived from Panel which doesn't appear to inherit from ContainerControl which is where the ParentForm propery is. Any other way that you know of to solve the problem?
- monrobot13
|
|
|
|
|
Control.TopLevelControl Property
Gets the parent control that is not parented by another Windows Forms control. Typically, this is the outermost Form that the control is contained in.
<a TITLE="See my user info" href=http:
|
|
|
|
|
That worked beautifully. Thanks!
- monrobot13
|
|
|
|
|
I think I found a bug in C#'s Rectangle. At least, it seems like an
inconsistency.
A Rectangle is defined as a combination of a Point (the top-left corner)
and a Size.
Let's say I have a Rectangle at (0,0) with a Size of 100x100.
If I call Rectangle.Top, it returns the Y-coordinate of the top of
the rectangle. Likewise, for Rectangle.Bottom, Rectangle.Left, and
Rectangle.Right. So, for this Rectangle, Top = 0, Left = 0, Bottom = 100,
and Right = 100. At least, according to the Rectangle class. But
if I call Rectangle.Contains(new Point(100,100)), this returns false.
Technically, it seems that Rectangle.Contains() is behaving correctly.
Logically, the rectangle's true bounds are (0,0) to (99,99). So
(100,100) isn't really in that rectangle. But I would argue that
Rectangle.Bottom and Rectangle.Right shouldn't be returning 100, either,
if they are returning the coordinate of the corresponding edge.
Either Rectangle.Contains() needs to be fixed, or Bottom and Right need to be fixed. I think the latter is more appropriate. Until then, I guess we need to deduct 1 from those properties.
|
|
|
|
|
Think Zero based Array (vector)!
<a TITLE="See my user info" href=http:
|
|
|
|
|
What about it? If you're suggesting that I have an off-by-one error in my head, I don't think so -- it would appear that Microsoft does. In fact, someone at Microsoft agrees:
Arun-
Thanks for your feedback!
You are right, the Rectangle version of these descriptions and the
Control version are both a little bit off in different ways.
I have passed your message on to a member of the test team for further
inquiry; he is investigating the behavior and will open a bug (or bugs)
based on what he finds.
Thanks again reporting this, and please continue to send us mail, should
you encounter behavior that seems curious (or other problems).
Seth Grossman
Microsoft Corp.
|
|
|
|
|
Note:
A rectangle under windows does not draw at the right or bottom of the rectangle. Therefore the bottom and right are not with in the rectangle (Bottom and Right are limits).
This is by design on the part of Microsoft and it does not matter if you are programing in C, C++, C#, VB, etc...
Trust in the code Luke. Yea right!
|
|
|
|
|
Okay... But also note that I'm not concerned with how a rectangle is drawn, just whether, in hyptothetical space, a point is in a rectangle or not.
If Bottom and Right are open limits by design, when are they actually used as such? I'd expect there would be a lot more code that does (this.Bottom - 1), but perhaps it's for lazy programmers who want to do (Bottom - Top), rather than (Bottom - Top + 1).
Either way, I'd argue that "Gets the y-coordinate of the bottom edge of this Rectangle structure" is inconsistent, especially since Top is described as "Gets the y-coordinate of the top edge of this Rectangle structure."
|
|
|
|
|
I can see why you might consider it to be inconsistent, but from a GDI point of view it is very consistant. The end point is a limit no matter what you are drawing using GDI, that even includes lines. I know from personal experence that this can be a pain when you want the end point included in the drawing area.
I do agree that the end point should be valid (/drawn). When I designed my own graphics library some years ago the end point was valid [it seemed the natural way to do it].
A bug is some thing that you did not intended to happen.
|
|
|
|
|
Check out "PocketPrep" from handango.com.
It has 90 questions based on the test spec. (070-316 and 070-306)
|
|
|
|
|
I am trying to run an access report in c#. The report runs ok but I cannot seem to stop the dialog box asking for the report parameter.
appAccess.DoCmd.OpenReport( reportName, Access.AcView.acViewPreview, "",
whereCondition, Access.AcWindowMode.acHidden, "");
The filtername and openargs (the "" fields) and the whereCondition parameters of the above method do not seem to set the report parameter.
How can I set a parameter value for this report?
It ain't what you know that matters.
Uncle Monkey
|
|
|
|
|
Hi,
I have a Form in which I want to capture input events (MouseMove , KeyDown ), before they propagate to the Controls of the Form. I tried overriding OnMouseMove , and not calling base.OnMouseMove , but this method seems to be bypassed when my mouse is over one of the controls of the Form. Do i have to set a flag somewhere to not automatically propagate the events to the child controls?
|
|
|
|