|
Looking through the decompiled code for SupportsIPv6 reveals that there's a configuration property ipv6[^] which must be enabled in order for this property to return true .
I'm not too sure why this is required - perhaps you should report it as a bug on the Product Feedback Center[^].
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
Hello everyone
Sorry to be asking so many questions...
I have seen a few examples around the net where people are passing bytes in to functions wanting ints, without any problems what so ever...
e.g. Color.FromArgb (0x99, 0x99, 0x99);
I have also seen this being used when an overload expects a float value;
e.g. g.DrawImage(img, (int) (rect.X + 4), (int) (rect.Y + 2), 0x10, 0x10);
All these compile fine!
Now is there a reason why someone would choose this method over just passing an int or float?
Is there any benifit to this?
Sorry, a very trivial question, but has got me very intregued!
Thanks in advance
Al
|
|
|
|
|
Those things are hexadecimal numbers. Some people use them for defining color values because they are just used to it. But I think they (the hex codes) will mostly be used for unmanaged api calls, because most constant values are public available as hex codes and not as normal integers. Ive never seen them used in conjunction with non constant float values
|
|
|
|
|
Thanks for the response.
Yes, I'm not sure why they would / could use them.
I thought it may be a method to create slightly faster / more efficient code as the compiler would not have to parse int, floats etc to the Hex equivilant...
I have not been able to find any Microsoft references even hinting that you can use hex values for int and float variables
|
|
|
|
|
Hello Everyone
I am just wondering what methods there to protect your DLL's bundled with your own application from being used by another developer / application?
I have written a few UI components that I'd like to protected. I have obfuscated them and will be purchasing Salamander soon to completly protect it from decompilation, but non of these will stop another developer just using the component.
Any thoughts / ideas / previous experiences would be greatly appreciated.
|
|
|
|
|
If you look at the properties of a control in the Visual Studio property grid then it shows the controls Name property.
If you put a PropertyGrid control on a form and set its SelectedObject property to a control then the Name property of that control is not displayed.
How does Visual Studio get the Name property of a control to display?
|
|
|
|
|
I want to implement an online chat in my web site in ASP.net.It will be a support channel type chat where clients will log in and request support from the server agents.Can some one provide me with a sample.i would really appreciate.
waiting for reply ....
Prepare yourseld for the life after death.God bless you.
|
|
|
|
|
Im trying to parse the following
"Someword, another. SD-FR1 more WORDS"
And i would like to capture the "SD-FR1" part.
I know it consists only of capital letters, numbers or "-".
I also know that it contains at least one capital letter and one number but not in what order. It should work on
"Someword, another. S1R more WORDS" capturing "S1R" aswell.
Anyone know how to do this with .NET RegEx?
I've read and googled but havn't found any examples where you dont know the order of what you're searching for.
Thanx for your time
Fredrik Högberg
|
|
|
|
|
Hi,
When I use Process.Start() to start my DX GUI application from my .NET Service I can see the process starts correctly because it shows up in the task manager, but the Form does not get shown.
If I'm not doing something obviously wrong, I think I have to do something special to achieve this.
Does anyone know how I can do this?
|
|
|
|
|
Hi,
I want to find out all the components in the system that are not shared side-by-side. For this I need to check whether the given component is side-by-side shared or not?
How I can achieve this?
Can that information be achieved thru file version info?
What are .menifest file?
|
|
|
|
|
requirement - form has apply, ok, cancel buttons. apply, ok initially greyed out. on an edit change (edit control, radio button, combo, listbox, grid etc.) set member var flag m_dirty = true, and enable apply, ok. Form may possible contain tabcontrol and tabpage children. All forms in app are derived from a base form with the apply, ok, cancel buttons on it.
my two ideas so far:
1) override wndproc in base form and trap all wm_command msgs, see if they are from an edit, radiobutton etc. and then see in EN_CHANGE or appropriate was sent, set dirty in this case.
2) recurse form and all control containers (panel, groupbox, tabpage), and hook up an event handler to every control (edit, radiobutton etc.) for appropriate event (OnTextChanged, ButtonClicked etc.) and in that event handler set form dirty.
Im hoping there is an easier way to do this. Im trying to avoid going thru a whole bunch of existing forms to setting dozens of event handlers manually. Im hoping to have some code in the base form that implements this using something like 1 or 2 above, or preferably some much easier way some .net brainiac can suggest.
tia. sg.
SGarratt
|
|
|
|
|
The second one sounds appropiate to me. You could implement that as a protected function in your base class. All you would have then to do is to call it from every form inheriting from your base form after the InitializeComponent call.
To avoid this (the recursive search) you could also handle the ControlAdded event in your base form and bind your event handler for setting the flag right when a control is added. In this case you would have to bind the ControlAdded event also for each inserted container control.
|
|
|
|
|
thnx. ive mostly implemented 2 already. Ill look into ControlAdded event, was not aware of that. this used to be pretty easy with MFC or Win32. Its a common thing to want to do on all dialogs with apply func.
|
|
|
|
|
In VC6 MFC allows you to add a function, variable, virtual function or Windows message handler (from the context menu for a class).
In VC7 (or .NET) only the first two are available. Or am I missing something ? It really would be helpful if I could find a list of message handlers, for example. So if I want to add a splitter to a program, and need OnCreateClient, I can get it loaded into the .h and .cpp files automatically, and correctly typed:
virtual BOOL OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext);
In VC7 it seems that I have to copy and paste (after object browsing). Is there a better way ?
Raymond Mercier
|
|
|
|
|
Hi all,
my problem is that I am loosing all eventlinks of an
object by designing a form when moving objects by cut and paste.
Does anybody know a way ?
Thank You in advance
fracalifa
|
|
|
|
|
Use Drag&Drop instead of Cut&Paste. This way the event bindings dont get lost.
|
|
|
|
|
Hello,
I'm writing a program where I need to populate a treeview control from a single string. An example string is "com.fishnetsoft.helloworld". I need to be able to create a generalized method that will accept the string and populate the treeview in such a way that each '.' denotes a parent->child relationship. I'm having no problems splitting the string at the '.' characters, but I'm running into problems when I try to populate the treeview. I'm using C# in VS.NET 2002. Much thanks.
Dave
|
|
|
|
|
Hi,
I have Methods which will do what u want ....Here is the code.....(VB.NET Code)
'******************************************************
private arr_Node() As String
Private strString As String = "ABC.XYZ.DKF.FF"
Private intParentNode As Integer
'******************************************************
Private Sub CreateTree()
arr_Node = strString.Split(".")
CreateTree(TreeView1) 'Name of ur tree view control
End Sub
Private Sub CreateTree(ByVal TreeView As TreeView)
Try
Dim rootNode As New TreeNode(arr_Node(0).ToString)
TreeView.BeginUpdate()
TreeView.Nodes.Add(rootNode)
intParentNode = 1
AddChild(rootNode, arr_Node)
TreeView.EndUpdate()
Catch exc As Exception
Throw exc
End Try
End Sub
Private Sub AddChild(ByVal ParentNode As TreeNode, ByVal array() As String)
Try
If array.Length > intParentNode Then
Dim ChildNode As New TreeNode(array(intParentNode))
intParentNode += 1
ParentNode.Nodes.Add(ChildNode)
AddChild(ChildNode, array)
End If
Catch exc As Exception
Throw exc
End Try
End Sub
Hope this will Help you.................:->
Regards,
Ritesh
|
|
|
|
|
Sorry but you should review your coding style. Such a helper function should not depend on class members. Its also not needed to catch an exception only to throw it without any processing. Finally I think its not doing what the poster tried to achieve. If your function processes two string like 'A.B.C' and 'A.B.D.' it would generate two totally different trees in the treeview, instead of one.
Here my code proposal:
<br />
Public Sub AddItem(ByVal text As String, ByVal tree As TreeView)<br />
Dim item As String<br />
Dim node As TreeNode<br />
Dim splitted As String() = text.Split(".")<br />
Dim currentNodes As TreeNodeCollection = tree.Nodes<br />
<br />
For Each item In splitted<br />
node = GetNodeWithText(item, currentNodes)<br />
If node Is Nothing Then<br />
node = currentNodes.Add(item)<br />
End If<br />
currentNodes = node.Nodes<br />
Next<br />
End Sub<br />
<br />
Private Function GetNodeWithText(ByVal text As String, ByVal nodes As TreeNodeCollection) As TreeNode<br />
Dim node As TreeNode<br />
<br />
For Each node In nodes<br />
If node.Text = text Then<br />
Return node<br />
End If<br />
Next<br />
<br />
Return Nothing<br />
End Function<br />
Note that this code is probably not very performant as the GetNodeWithText function will search in linear time. But as long as the treeview doesnt get filled with thousands of items it will work fine.
|
|
|
|
|
hi Robert,
Actually i was just doing R & D for given problem and i could't review it ...
Anyway ThanX for Suggestion..... I will Try to Improve my Coding Style Before posting ...........
regards,
Ritesh
|
|
|
|
|
Hi.
I guess you all know about PE files' timestamps. The are in hex, and for example
41DE6BF7 means 07/01/2005 11:01:11.
I tried many ways to 'convert' the timestamp to a DateTime object, but they all failed. (DateTime.FromFileTime(...), FromTicks(...)
My question is, how to 'convert' the hex value to a DateTime.
Thanks in advance and best regards,
Stan
|
|
|
|
|
See the SDK documentation for IMAGE_FILE_HEADER. This reveals that the field is a 32-bit integer representing the number of seconds since 1 January 1970 00:00:00. Probably the easiest way to handle it is to construct a DateTime representing that date, then use AddSeconds.
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
Hi,
we are working with microsoft technology like for windown application development is in C# and web development in asp.net so for testing the site or window application which testing tool is more reliable and giving excellent result.As there are numbers of testing tools are available on internet but which one is best and reliable.
can anybody tell me into that.?
regards.,
montu3377
|
|
|
|
|
Hi
I seem to having a number of issues when I try to compile my VC++ VC6 application of VC7.
The main error I get is:
error C2065: 'alloca' : undeclared identifier c:\Program Files\Microsoft Visual Studio .NET\Vc7\atlmfc\include\cstringt.h line 187
Any ideas??
Many thanks
Tom
|
|
|
|
|
Hello all,
I am writing a simple application which uses an XML file as a log file. It's really nothing more than a simple text editing application.
My question is this: am I better off, from a performance/memory usage standpoint, to create an XmlDocument member of my class so that I have only one document open, but always available, or, should I create a new document as needed, and let it get disposed each time it goes out of scope?
Here's some sample code of what I mean:
public class MyClass
{
XmlDocument xdoc = new XmlDocument();
xdoc.Load(pathToFile);
void fn1(XmlDocument aCopy)
{}
void fn2(XmlDocument anotherCopy)
{}
void fn3()
{}
//etc...
}
or
public class MyClass
{
void fn1()
{
XmlDocument xdoc = new XmlDocument();
xdoc.Load(pathToFile);
}
void fn2()
{
XmlDocument xdoc = new XmlDocument();
xdoc.Load(pathToFile);
}
void fn3()
//etc...
}
I read all the best practice documents I could find on MSDN, but they only addressed the plusses and minuses of using the DOM vs. SAX, and gave no guidance on the best way of implementing a class using the DOM.
Thanks all,
John Guin
|
|
|
|