What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » Quick "translation": VB to C#

Quick "translation": VB to C#
Author: Message:
Chancer
Senior Member
****

Avatar

Posts: 648
Reputation: 7
35 / Male / Flag
Joined: May 2005
Status: Away
O.P. Quick "translation": VB to C#
I have this piece of code:
VB code:
Dim moniker As IMoniker() = New IMoniker(0) {}

Is this an array initlialized with length 0?
Is it right to "translate" it as:
C# code:
IMoniker[] moniker = new IMoniker[0];
?

I'm translating a program, and there's an error happening when using that moniker. It works fine with VB, but not with C#, and I guess the error is in the declaration.

Edit: I tried to change to:
C# code:
IMoniker[] moniker = new IMoniker[1];
I'm not sure about that 0 in the VB code. Is that the length or just an index? I'd appreciate a little info about that.

This post was edited on 07-21-2011 at 04:24 AM by Chancer.
07-21-2011 04:10 AM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Quick "translation": VB to C# - by Chancer on 07-21-2011 at 04:10 AM
RE: Quick "translation": VB to C# - by Alexandre.Lefebvre on 07-21-2011 at 01:13 PM
RE: Quick "translation": VB to C# - by Mnjul on 07-21-2011 at 02:03 PM
RE: Quick "translation": VB to C# - by Chancer on 07-21-2011 at 02:55 PM
RE: Quick "translation": VB to C# - by Alexandre.Lefebvre on 07-21-2011 at 03:01 PM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On