-
converting to csharp from vb questions
Hi all. I am converting some test code from VB to C#. I am looking for the
c# equivalents of ByVal/ByRef and DoEvents. I am not sure that DoEvents
still makes sense with WinForms, but I thought I would at least ask.
Wally
-
Re: converting to csharp from vb questions
Wally,
>I am looking for the c# equivalents of ByVal/ByRef
The default behaviour is to pass parameters by value, so you don't
have to do anything for that. To pass by reference, use the ref
keyword, both in the parameter declaration and in the calling code.
int foo(ref int bar) { ... }
foo(ref myInt);
>and DoEvents. I am not sure that DoEvents
>still makes sense with WinForms, but I thought I would at least ask.
System.WinForms.Application.DoEvents();
Matt
====================================
Mattias Sjögren - mattias @ mvps.org
http://www.msjogren.net/dotnet/
CodeHound - The Software Developer's Search Engine
http://www.codehound.com
-
Re: converting to csharp from vb questions
Thanks,
Wally
"Mattias Sjögren" <mattias.dont.want.spam@mvps.org> wrote in message
news:3a993d0f.204512914@news.devx.com...
> Wally,
>
> >I am looking for the c# equivalents of ByVal/ByRef
>
> The default behaviour is to pass parameters by value, so you don't
> have to do anything for that. To pass by reference, use the ref
> keyword, both in the parameter declaration and in the calling code.
>
> int foo(ref int bar) { ... }
>
> foo(ref myInt);
>
>
> >and DoEvents. I am not sure that DoEvents
> >still makes sense with WinForms, but I thought I would at least ask.
>
> System.WinForms.Application.DoEvents();
>
>
> Matt
>
> ====================================
> Mattias Sjögren - mattias @ mvps.org
> http://www.msjogren.net/dotnet/
>
> CodeHound - The Software Developer's Search Engine
> http://www.codehound.com
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks