|
There is a very small number of things C# can do that VB cannot, and a couple of nice things that VB does and C# does not ( but the VB stuff is syntactic sugar, C# can do anything VB can do ). But, as has been said, they both compile to MSIL. The reason people assume C# is better is because VB6 was crap and C++ is still the best performance language, as C# looks like C++ and has C in the title, people assume the same is true in .NET. It is not.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
There are a few cases where VB generates less efficient code, e.g. casts from object to int (C# will only unbox the int, but VB does an additional check if the object is a boxed short/long/etc., unboxes that and then does a conversion). Also, VB has some features like late-binding that result in sub-optimal performance if you use them accidentally (e.g. if forget the "As DataType" part in a Dim statement).
However, in most cases you won't notice any performance difference between VB and C#.
|
|
|
|
|
i have a managed c++ dll, now i need to call a c# method(not in dll) from the managed c++ dll.
how would i go about it?
i cannot find anything on this topic, everywhere people call from unmanaged c++.
rather have something you don't need, than need something you don't have
|
|
|
|
|
Hi again,
you can mix all managed languages in one app, provided you use dll's.
Each dll/exe can contain only one language.
Calling C# from managed C++ is identical to calling managed C++ from C#.
|
|
|
|
|
thanks again for your reply.
only problem is that the c# code is not a dll, can i add a reference to a c# exe in a managed c++ dll?
rather have something you don't need, than need something you don't have
|
|
|
|
|
thanks for the help, i added a reference to the c# exe and it works!
rather have something you don't need, than need something you don't have
|
|
|
|
|
Hi,
if your app is basically a C# program that calls a C++ dll, and that dll needs to
call back some method in the C# exe, then AFAIK you need to pass a delegate and use it
as a function pointer (or whatever it is called nowadays) in the C++ part.
Since the delegate type must be known to both the exe and the dll, it seems it must be
defined in the dll (again I dont know the details).
A more general approach would be to create an additional dll that holds the C# code
that is needed by both the C# main part and the C++ dll. Doing so allows the
C++ project (and the main C# part) to add a reference to the new C# dll.
|
|
|
|
|
How do I write the code to control a panel's scrollbar using the 9-way navigation button in pocket pc???
|
|
|
|
|
I have a web service listener. Once the exposed routine is called from outside it executes some code. The code tracks these responses in memory.
However, a subsequent call to my web service seems to reset the memory.
So for example,
1st call to my erb service
I log some data in memory
return success.
Next call to my web service
The stuff that i logged in memory, is gone.
Is this because by the second time around, the memory is fresh?
How would i get around this if i did not want to use writing to files instead?
|
|
|
|
|
Greetings,
I am a test automation engineer tasked to create automated regression tests for our product lines
Our application under test is a C# application that has 2 embedded IE controls. Due to limitations in our test automation tool(Mercury's Quick Test Pro 9.2), we are unable to extract any text from these controls. We need to extract this text in order to perform various verifications.
What I would like to do is create an external C# .DLL that our testing tool can utilize that will return the text from these embedded controls.
My total experience with C# consists of a 5-day training class, so I am very ineperienced with this. I honestly don't know where to begin with this.
Thanks in advance for any help!
Ed
|
|
|
|
|
hi.
please tell me how to access the control on mdi parent through control on child form. in C# 2.0 application.
|
|
|
|
|
|
I have a complex arraylist containing N types of objects.
public class cls1
{
property string p1;
property bool p2;
property string p3;
property string p4;
}
public class cls2
{
property int p1;
property string p2;
property bool p3;
property string p4;
}
Class cls3
{
property string p1;
property bool p2;
property int p3;
property string p4;
property string p5;
property string p6;
}
I want to bind the grid ROWS (NOT COLUMNS) with the arraylist containing rows of type cls1, cls2, cls3...clsN.
Like one row can contian data of object of cls1 .
Like other row can contian data of object of cls2 .
HARMINDER SINGH, R&D, WinShuttle Inc,
|
|
|
|
|
Hi
I would like write the function that does the same behavior of following C++ code. I tried to use the Process but I am sure I'm using it in worng way. Would you please guid me to the correct way to run the simple cmdLine?
This is the way I use the Process and it opens the winzip application and does nothing.
//progName = "c:\program files\winzip\winzip.exe"
System.Diagnostics.Process.Start(progName, cmdLine);
CString cmdLine;
cmdLine.Format("wzunzip -d -o \"%s\" \"%s\"",fileName,folder);// setting command line
System(cmdLine); //where cmdLine = "unzip "c:\a.zip" "c:\extractedfiles"
Thank you.
|
|
|
|
|
Specify arguments by setting Arguments property of ProcessStartInfo object and pass it to Process class object
|
|
|
|
|
Thank you for your answer Giorgi.
I tried this way but got error...
pStartInfo.CreateNoWindow = true;
pStartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
pStartInfo.UseShellExecute = false; //and also tried with Yes
pStartInfo.Arguments = cmdLine;
pStartInfo.FileName = progName;
pStartInfo.RedirectStandardError = true;
System.Diagnostics.Process.Start(pStartInfo);
|
|
|
|
|
What is the actual value of cmdline that you passed?
|
|
|
|
|
The actual command line that I'm passing is:
wzunzip -d -o "c:\sample.zip" "c:\outputfolder"
in C++ I simple has to pass the string to system(cmdLine ) function,
void ExtractZip(CStirng fileName,CString folder)
{
CString cmdLine;
cmdLine.Format("wzunzip -d -o \"%s\" \"%s\"",fileName,folder);// setting command line
System(cmdLine);
}
|
|
|
|
|
Are all the arguments and parameters correct? What error are you getting? What happen if you run the program which you want to start from cmd with those arguments?
|
|
|
|
|
You are right, Giorgi..
My argument isn't correct.
I found my error and now is working great.
Thanks for your advises and help.
^_^
|
|
|
|
|
You are welcome, glad that I helped you
|
|
|
|
|
Hey,
anyone know the equivalent of VB's MOD, in C#?
Cant find it
|
|
|
|
|
it's the percent symbol:
int n = 10 % 3; n == 1
|
|
|
|
|
|