Don't forget about all the articles in the .NET Framework SDK besides those in the class library. There is a pretty big selection of articles about threading in .NET at http://msdn.microsoft.com/library/en-us/cpguide/html/cpconthreading.asp[^] which also includes a lot of examples. Many of the overviews should even discuss threading in general for those not familiar with threads.
I'v been converting some classes I wrote in VB.net to stick them in a C# DLL, but have come accross some wierd irregularities in the .net architecture.
Firstly, the C# compiler will not allow me to explicity pass the value of one numerical variable into an enumerated data type, whereas VB allowed it, and MSDN swears blind it should. For instance:
VB: mnFog(x, y) = Convert.ToByte(sChar) - works fine
C#: mcFog[nLocX, nLocY] = Convert.ToByte(sChar); - Cannot implicitly convert type 'byte' to 'ThisEnum'
The enum in question is derived from a byte.
Secondly, C# just doesnt "see" some methods and properties which VB can use. For instance, in Microsoft.Data.Odbc the OdbcDataReader has an Item collection which allows its user to retrieve a field by its SQL name, instead of its column number (like the .Get[Type]() functions).
See for yourself, reference the DLL, find "Microsoft.Data.Odbc.OdbcDataReader.Item" in the object browser, then try and use it.
Has anyone else experienced these sort of problems?
dalm wrote: Cannot implicitly convert type 'byte' to 'ThisEnum'
Cast your value you pass, so if you have a function sig. which has an enum as a parameter such as this:
int SomeFunc(ThisEnum e);
and you know the enum value, simply cast it when you make the method call:
int a = 2;
dalm wrote: Secondly, C# just doesnt "see" some methods and properties which VB can use. For instance, in Microsoft.Data.Odbc the OdbcDataReader has an Item collection which allows its user to retrieve a field by its SQL name, instead of its column number (like the .Get[Type]() functions).
C# doesn't syntactically reference items like VB.NET does, it uses the  syntax instead.
I have a .aspx.cs file and a group of .cs files I need to compile together. When I try this on Visual Studio .NET, there are no compile issues, but when I try to execute the file, it comes across a literal form control ("error_tags") and gives error "type or namespace cannot be found".
The class in the .aspx.cs files inherits from a base class in the .cs file. The base class contains the definition "public Literal error_tags;" Is the issue that the .cs files are not being compiled?
Previously, when I was compiling my .dlls from the command line and moving them to the bin folder I had no issues.
The <%@ Page%> should inherit from the class defined in the .aspx.cs file, as well as contain the name of the assembly in which that class is contained. If the class in that file inherits from another class defined in another .cs file, that latter class should derive from System.Web.UI.Page.
If you right-click on the files, select Properties, and examine the "Build Action" property, these should say "Compile". This is the default build action for .cs files. If the project compiles all the files set for compilation and there are no build problems, then all your Types are being resolved correctly. The only problem would be that the Inherits attribute of the <%@ Page%> declaration probably isn't referencing the right Type, and / or the CodeBehind attribute does not specify the path to the correct .aspx.cs file.
Finally, make sure that the Liberal error_tags class is declared as public, protected (recommended), internal, or protected internal. If it is declared as private no class - including subclasses - can access it without using reflection (which is expensive and not a very good design).
dalm wrote: With Microsofts XML namespaces, is it be possible to pass variables taken from a serialised object through (set) property procedures?
What exactly do you mean? If you're using the XML Serialization classes from System.Xml.Serialization, then public properties are serialized by default (you can control this with the attributes like XmlElementAttribute and XmlAttributeAttribute. When deserializing, the values are assigned to the properties again via the set accessor so any code you have in the set accessors will be run.
When I use a manifest file to enable windows xp themes the calendar control get seriously screwed up. When a range is selected the painting isn't done properly. Has anyone ran into this before? Any solutions to this?
Sorry, I didn't see that. I believe you are going to have to subclass the WndProc and watch for EN_LINK message. To receive this message you will also need to send the EM_SETEVENTMASK message as it specifies the event messages to send to the parent window. You should be able to cast the lparam to a ENLINK structure which contain helpful information such as a CHARRANGE structure that will tell you the range of characters. This should at least point you in the right direction but it will require a little work. Hope this helps.
I am developing a program in which there is dynamically generation of some fields let us take the example of label control now i dynamically generate them after taking input from user. when the user right click on any label i will show him a context menu through which he can select the font, color etc and on the selection of that a different dialog box will be selected now Actual problem is that after the selection of that color or font i want to know on which label control user has right clicked on how i will get that . sorry for poor english
Thanx in advance
If I understand you correctly, you need to know control which triggered context menu when you handle MenuItem.Click event. When you handle this event sender is a context menu so it wont't help you much. However, if you handle ContextMenu.Popup sender is the control triggering the event. What you can do is this: create a field in the class where you handle events