|
C++ is faster since it does not rely heavily on the .NET framework which takes up more memory which would resultingly slow your program.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my homepage Oracle Studios[ ^]
|
|
|
|
|
Of course C++ is much much much faster!
(But if you are using C++.NET -by using .NET FCL- C++.NET actually is as slow as C#.NET!)
|
|
|
|
|
MohammadAmiry wrote: (But if you are using C++.NET -by using .NET FCL- C++.NET actually is as slow as C#.NET!)
Really? Not according to this article[^] written by someone on the C++ team, but you probably know better than him.
Another common misconception is that the same kind of superior performance on the .NET Framework can be attained regardless of the language you use—that the generated Microsoft intermediate language (MSIL) from various compilers is inherently equal. Even in Visual Studio .NET 2003 this was not true, but in Visual Studio 2005, the C++ compiler team went to great lengths to make sure that all of the expertise gained from years of optimizing native code was applied to managed code optimization. C++ gives you the flexibility to do fine tuning such as high-performance marshaling that is not possible with other languages. Moreover, the Visual C++ compiler generates the best optimized MSIL of any of the .NET languages. The result is that the best optimized code in .NET comes from the Visual C++ compiler.
|
|
|
|
|
I am new to C#. I have written a class library in C# that has a form. I want this form to return some value when it terminates. This form is called from some other project.
Lets assume I have a text box [text1] and a button [button1] on the form. When the form loads, user will provide some text in text1 and on clicking button1 the form will terminate and text will be returned.
I want to pass a variable ref to its [form's] constructor, then assign the this reference to some static ref variable so that it could be changed in button1's click event.
In short, I want to modify a constructor's ref parameter in an event procedure.
Thanks in advance,
Vipin.
|
|
|
|
|
Wel..you don't necessarily need to pass a ref variable to the constructor of the form. You can create properties to that form, say:
public string TextValue
{
get{return textBox1.Text}
set{textBox1.Text = value;}
}
All you have to do after that is to show the form with Show() or ShowDialog() and after that you read the value of the TextValue property.
Hope it helps.
There are 10 kinds of people: those who understand binary and those who don't
|
|
|
|
|
Passing an argument by reference is not the same thing as passing a reference as an argument. Passing by reference only specifies how the argument is handled in the call to the method, you can't take this behaviour and store it in a variable.
If you want a variable that the methods in the form can change, put the variable in the form class, and make it accessible as a property.
---
"Anything that is in the world when you're born is normal and ordinary and is just a natural part of the way the world works. Anything that's invented between when you're fifteen and thirty-five is new and exciting and revolutionary and you can probably get a career in it. Anything invented after you're thirty-five is against the natural order of things."
-- Douglas Adams
|
|
|
|
|
It really worked. Thanks a lot.
So I think passing an argument by reference simply creates an alias of passed variable and no memory allocation is done while when a reference is passed as an argument, a reference type of variable is created [so the memory is allocated for it] and it is initialized with the same value [address] as the passing reference variable has. Right?
Thanks again,
Vipin.
|
|
|
|
|
Hi all,
I have little problem, I have a 2 Web applications (C#) and I'm Adding Firts One into Second's Referancecs and I can see First's NameSpaces and Methods without any problem but I have problem accessing Methods, VS can not see them.
Classes and methods are public.
when I press F12 I can see list of methods.
Thanks alot.
|
|
|
|
|
Add a new project with (Class Library) and add all shared functions in that project.
|
|
|
|
|
Try using this in a page within the second project.
<%@ Reference Page="project1_page.aspx" %>
Hope it helps.
There are 10 kinds of people: those who understand binary and those who don't
|
|
|
|
|
Hello,
I recently saw the following lines of code in the Page_Load block of a Web application and I'm wandering what exactly it does:
Response.AddHeader("pragma","no-cache")
Response.AddHeader("cache-control","private")
Response.CacheControl = "no-cache";
Thanks in advance!
Obi.
//obinnaaj Eof
|
|
|
|
|
|
led mike wrote: They hide that information in the documentation[^]
Curse them and their evil ways.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Hey all.
First of all, please keep in mind that i am far from a proffesionel programmer, so dont go to hardcore on me.
The actual Q:
I have made a C# windows form, that connect to a remote mssql database, receives data, and plots it into a gridview. U can also add new data to the sql database. I made it update everytime u focus it, or change values. This however causes the program to hang all the time. Is there anyway to make it update in the background, perhaps every 10 secs, and then just pick of the most reason local version, everytime u focus it? I use tableadapter and dataset to store and edit the data in. Perhaps u could make it update the dataset in the background?
Anyways, i hope u guys understood just a little bit of what my problem is.
1000 x thx in advance
//ev00l
|
|
|
|
|
When you edit the data it is stored locally in the dataset. You then fetch the changes from the dataset and send them to the database as a bulk update. Simply move the database update part to a background worker and you should get much smoother operation. Just watch out though, if you fetch the updates and start sending them to the database you must make sure that you handle new local updates while sending the current ones.
|
|
|
|
|
thx alot for the answer. Perhaps u could explain a little more about backgroundworker (multithreading i guess?) And perhaps some good suggestions to avoid the catch of remote and local updates in the same time.
|
|
|
|
|
ev00l wrote: i am far from a proffesionel programmer
What are you going to try your hand at next? Perhaps build a bridge or dabble at brain surgery?
ev00l wrote: Perhaps u could make it update the dataset in the background?
Yes you can using a thread. Most professional novice programmers are not capable of such endeavors but I'm sure you will be fine... well at least your software can't kill anyone... umm... errr... can it?
|
|
|
|
|
Are you in a bit of a bad mood today Mike?
Regards,
Rob Philpott.
|
|
|
|
|
Rob Philpott wrote: Are you in a bit of a bad mood today Mike?
No way! If you had heard me laughing when I read the OP you would've gotten a different read on my mood.
Now look what happened with ev001... "oh can you explain multi threading to me" ROTFLMA.... yeah, never saw that coming!
|
|
|
|
|
sry for asking questions dude, perhaps the guy had a link to some nice backgroundworker guide. In the future, just ignore my posts, and continue ur sad life as usual.
|
|
|
|
|
ev00l wrote: perhaps the guy had a link to some nice backgroundworker guide.
You mean like this[^]
ev00l wrote: In the future, just ignore my posts, and continue ur sad life as usual.
Thank you! Finally someone realizes that I come to CodeProject so dabbling developers can tell me what to do!
|
|
|
|
|
I actually got it to work with the backgroundworker component and a timer
|
|
|
|
|
ev00l wrote: I actually got it to work
so it probably works and might work again so ship it!
|
|
|
|
|
I wrote a program using an article from Code project as a reference in order to communicate with PIC16F877A using RS232.
I cannot receive any data from the PIC. I tried by sending many data types as, decimal, hex, ASCII eyc... but nothing worked. Plz help me with this, any help would be really appreciated.
THANK YOU
|
|
|
|
|
You want to post this at the bottom of the article- the author should respond.
Also, Hello is not a good subject title.
"More functions should disregard input values and just return 12. It would make life easier." - comment posted on WTF
"This time yesterday, I still had 24 hours to meet the deadline I've just missed today."
|
|
|
|