|
Vicks wrote:
Which is best among C#, VB.Net and VC++ 7
That's a difficuly question without more information.
Since you've got a C++ background, I'd drop VB.NET from the list and concentrate on examining C# Vs. Managed C++ (I'm assuming you actually meant Managed C++ and not "normal" VC++)
If you are going to do a lot of interop work the MC++ is probably better. If not then I'd go with C#. C# is fairly close to C++ syntax. There are some differences (like the struct keyword has different meanings)
Vicks wrote:
Which books should I refer for C#?
Looks like you've already chosen C# anyway. There are lots of good books on the subject. I bought mine 2+ years ago so there are probably better introductory books by now. However I found "Applied Microsoft .NET Framework programming" by Jeffrey Richter to be a good source of information.
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
Not getting the response you want from a question asked in an online forum: How to Ask Questions the Smart Way!
|
|
|
|
|
There is not a declared ‘best’ and people tend to rate them based on their own likings. In .net code written in any language ultimately gets executed in an IL on the CLR. So one should choose ‘his’ language of choice in .Net based on
a. The past experience
b. The nature of applications to be developed
I come with a similar tech background as yours and I found C# to be a more natural progression of my skill set. C++.net was also an alternative, but it will be best suited if I'm into lot of unmanaged code and/or want a quicker port of the older code. For fresh projects, C# is recommended.
|
|
|
|
|
hi,
Professional C# 2 nd Edition by Wrox is good.
**************************
S r e e j i t h N a i r
**************************
|
|
|
|
|
|
I was in your boat a couple of years back. If you have 5 solid years of C++ (meaning using it everyday), then C# is going to be a piece of cake. Like you, I'm a book learner and immediately thought about getting several books. I did pick up a few here and there, but most were specialized in areas that I wanted to learn (remoting, GUI, etc). I think someone with your skill set should start with the help files & Intellisense, you'll get bored with the books. What I did was come up with a project to write (in my case, it was a code snippet manager) and went for it. Just like any project, you'll come up against problems to solve and this will solidify your knowledge and allow you to begin building a code base/libraries for yourself. You really know more about C# than you think because it is so similar to C++ and you know most of the framework because of your MFC knowledge. It's just like MFC, only better and easier.
Just my opinion.
Custom Software, Custom Solutions. Yye Software.
http://www.yyesoftware.com
|
|
|
|
|
|
Hi,
can any one please help me how to update the VC++ Directories in the Options Dialog->Projects Using the EnvDTE namespace or by anyother method...using the programming interface exposed by Studio.NET
thankx in advance
waiting!
|
|
|
|
|
|
Thanks but i couldnt find this information (i.e include paths) in the vcproj or sln files, by the way i need to have it done through C# and i want it to be globally set that is the directories i add should be permenantly added to the Visual Studio.NET IDE.......
anyone please help.....
thankx in advance
|
|
|
|
|
As with most things, this is actually stored in the registry. Take a look at the HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\Version\VC\VC_OBJECTS_PLATFORM_INFO\Win32\Directories key. You may need to restart the environment (the IDE) after changing that, however.
To access this programmatically, if you look in the MSDN Online Library[^] you will find the VCPlatform object, which exposes those directories as properties. This is not in the EnvDTE.dll assembly, however. You must reference Microsoft.VisualStudio.VCProjectEngine.dll. IIRC, you should be able to cast (performs a QueryInterface on the COM component) from a Project object defined in the EnvDTE.dll assembly.
Software Design Engineer
Developer Division Sustained Engineering, Microsoft
My Articles
|
|
|
|
|
For Tools->Options->Projects it's actually stored in the registry.
Software Design Engineer
Developer Division Sustained Engineering, Microsoft
My Articles
|
|
|
|
|
If you've seen programs like "Ad Aware," or even many other programs, do you know how they make buttons that are not the typical boring box-type button. I have heard this is done using skins. But I'm not really sure how to do this, as I'm kind of a newbie to programming with c sharp. Any help or suggestions as to how I can create a more eye-pleasing button. Any help would be great. Thanks.
Stephen
|
|
|
|
|
For starting, check
http://www.nemhauser.com/presentation.aspx?id=nmi322
Sanjay Sansanwal
www.sansanwal.com
|
|
|
|
|
I've searched all my books and the Internet and cannot find a good example to read a text file into a hashtable. My text file is tab delimited as such below)and I need to load them into a hashtable as a DNS cashe...... Help.........
123.123.123.123 www.mywebsite.com
111.222.333.444 www.nowebsite.com
|
|
|
|
|
kvnsdr wrote:
I've searched all my books and the Internet and cannot find a good example to read a text file into a hashtable.
Books typically cover how to use particular mechanisms, you simply need to put the pieces together. This is a quick example method I wrote to read your file and insert the data into the Hashtable . Hope this helps.
private Hashtable GetHashtableFromFile(string file)
{
Hashtable ht = new Hashtable();
string line = string.Empty;
using(StreamReader reader = new StreamReader(file))
{
while((line = reader.ReadLine()) != null)
{
string[] args = line.Split(new char[]{' '});
ht.Add(args[0], args[1]);
Console.WriteLine("IP:{0}, Site:{1}", args[0], args[1]);
}
}
return ht;
}
- Nick Parker My Blog | My Articles
|
|
|
|
|
I like the coding. I have an error in my code that says:
"Index was outside the bounds of the array"
All I changed was using(StreamReader reader = new StreamReader(MyFile.txt"));
????????????????
|
|
|
|
|
I think you have incorrect format of input file. Somewhere there are empty strings or parts of string are not delimited with tab symbol
modify the code like this
private Hashtable GetHashtableFromFile(string file)
{
Hashtable ht = new Hashtable();
string line = string.Empty;
using(StreamReader reader = new StreamReader(file))
{
int i = 0;
while((line = reader.ReadLine()) != null)
{
i++;
string[] args = line.Split(new char[]{' '});
if (args.Length != 2)
{
Console.WriteLine("Invalid input string: " + i.ToString());
continue;
}
ht.Add(args[0], args[1]);
Console.WriteLine("IP:{0}, Site:{1}", args[0], args[1]);
}
}
return ht;
}
Invalid string will be skiped and appropriate message displayed
|
|
|
|
|
Hi,
I have 2 questions regarding property grid:
1) I am using the property grid to show properties of class. For some of these properties I need to show drop down list .For static values i can use converter but how abt for those whose values I do not know until run time ?
2) How can I implement undo/redo in the property Grid.
Please help me out
Thank you
|
|
|
|
|
1. Write your own convertor and populate the SupportedValuesCollection.
2. Im not too sure, but maybe DesignerTransactions means something
top secret xacc-ide 0.0.1
|
|
|
|
|
Read Enhancing Design-Time Support[^] in the .NET Framework SDK. TypeConverter s (as leppie was vaguely referring to), UITypeEditor s, and more are at your disposal for implementing effective design-time support, such as drop downs, modal dialogs (like collection editors, for example), andmore.
The DesignerTransaction that leppie mentioned won't actually let you under and redo. It will - like transactions in SQL - let you rollback (in this case, not commit, though) changes or commit them depending on conditions that you implement (for example, the user didn't set a property so rollback all property changes).
There is no undo and redo provided in .NET, but there are many articles here on CodeProject that discuss different alternatives (and more on the Internet, though few regarding .NET). It's really not a simple problem at all and is very specific to an application (there's really no way to provide a universal undo/redo engine).
If you are designing a design-time component for use in other applications, then undo/redo functionality is already provided to you: VS.NET does it. You have to switch to code view, but you can undo changes there. Keep in mind that designers - for the most part - use the CodeDom to modify your source code (VS.NET does most of the work unless designers implement their own code serializer). They may, however, write to other files (like a ResX file) so this won't always work.
Software Design Engineer
Developer Division Sustained Engineering, Microsoft
My Articles
|
|
|
|
|
Hi,
I'm just wondering whether it is possible to force a class, which implements my Interface, to provide a specific ctor (say with an int parameter). If yes, how do write the interface then?
Is this possible or do I have to fall back on a baseclass model?
Thanks in advance.
Matthias
If eell I ,nust draw to your atenttion to het fakt that I can splel perfrectly well - i;ts my typeying that sukcs.
(Lounge/David Wulff)
www.emvoid.de
|
|
|
|
|
No, you can't force specific constructor, but you can force to have a method that returns an instance and create factory for it.
<br />
interface IFoo<br />
{<br />
... methods here...<br />
}<br />
<br />
interface IFooFactory<br />
{<br />
IFoo CreateIFoo(string a, int b);<br />
}<br />
<br />
public class MyFoo : IFoo<br />
{<br />
... methods from IFoo...<br />
public static IFooFactory factory = new MyFooFactory();<br />
<br />
}<br />
<br />
class MyFooFactory : IFooFactory<br />
{<br />
public IFoo CreateIFoo(string a, int b)<br />
{<br />
return new MyFoo(a, b);<br />
}<br />
}<br />
<br />
then to use it:<br />
IFoo foo = IFoo.factory.CreateIFoo("hello", 1);<br />
<br />
|
|
|
|
|
Thanks Werdna,
this is just what I needed.
Matthias
If eell I ,nust draw to your atenttion to het fakt that I can splel perfrectly well - i;ts my typeying that sukcs.
(Lounge/David Wulff)
www.emvoid.de
|
|
|
|
|
Interfaces cannot contain instance constructors. It seems to be a useful feature at first glance, but how would you implement separate interfaces which require a constructor with the same signature?
You could fake it by including an Init method declaration on your interface or use an abstract base class to force the matter.
Charlie
if(!curlies){ return; }
|
|
|
|
|
I am trying to read a file off a CD, I use this code:
FileStream oFileStream;
oFileStream = new FileStream( this.filename, FileMode.Open);
and the exception is that access is denied. My CD drive has no security settings, this is happening on all the files I try to read from CD. What could be wrong ?
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|