PC Review


Reply
Thread Tools Rate Thread

C# to VB.Net conversion problem?

 
 
Özden Irmak
Guest
Posts: n/a
 
      12th Dec 2003
Hello,

This code line works on C# :

MainComponent.gettype()

where Maincomponent is a type of IComponent but I couldn't convert it to
VB.Net. This way generates a warning in the designer as "Type
'MainComponent' is not defined." :

GetType(MainComponent)

Any Suggestion?

Also, does anybody know a guide (website,etc.) which will help me on my work
to convert some code from C# to VB.Net?

Thanks in advance...

Özden


 
Reply With Quote
 
 
 
 
Jan Tielens
Guest
Posts: n/a
 
      12th Dec 2003
1) you can use typeof(MainComponent) instead of GetType(MainComponent)

2) Automatic conversion from C# to VB.NET
http://www.kamalpatel.net/ConvertCSharp2VB.aspx

--
Greetz,
Jan
__________________________________
Read my weblog: http://weblogs.asp.net/jan
"Özden Irmak" <(E-Mail Removed)> schreef in bericht
news:%(E-Mail Removed)...
> Hello,
>
> This code line works on C# :
>
> MainComponent.gettype()
>
> where Maincomponent is a type of IComponent but I couldn't convert it to
> VB.Net. This way generates a warning in the designer as "Type
> 'MainComponent' is not defined." :
>
> GetType(MainComponent)
>
> Any Suggestion?
>
> Also, does anybody know a guide (website,etc.) which will help me on my

work
> to convert some code from C# to VB.Net?
>
> Thanks in advance...
>
> Özden
>
>



 
Reply With Quote
 
Özden Irmak
Guest
Posts: n/a
 
      12th Dec 2003
Hello Jan,

Thanks for your interest firstly...

1) As I don't do a comparison on types this won't work.

2) Automatic converters converts this line as it is but .gettype is not
exposed in VB.Net although it's so in C#.

Any other suggestion?

Özden

"Jan Tielens" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 1) you can use typeof(MainComponent) instead of GetType(MainComponent)
>
> 2) Automatic conversion from C# to VB.NET
> http://www.kamalpatel.net/ConvertCSharp2VB.aspx
>
> --
> Greetz,
> Jan
> __________________________________
> Read my weblog: http://weblogs.asp.net/jan
> "Özden Irmak" <(E-Mail Removed)> schreef in bericht
> news:%(E-Mail Removed)...
> > Hello,
> >
> > This code line works on C# :
> >
> > MainComponent.gettype()
> >
> > where Maincomponent is a type of IComponent but I couldn't convert it

to
> > VB.Net. This way generates a warning in the designer as "Type
> > 'MainComponent' is not defined." :
> >
> > GetType(MainComponent)
> >
> > Any Suggestion?
> >
> > Also, does anybody know a guide (website,etc.) which will help me on my

> work
> > to convert some code from C# to VB.Net?
> >
> > Thanks in advance...
> >
> > Özden
> >
> >

>
>



 
Reply With Quote
 
Jan Tielens
Guest
Posts: n/a
 
      12th Dec 2003
Ic, my fault!

Can't you use MainComponent.GetType ? That should work in VB.NET? Maybe you
can post a little bit more code you want to translate...

--
Greetz,
Jan
__________________________________
Read my weblog: http://weblogs.asp.net/jan
"Özden Irmak" <(E-Mail Removed)> schreef in bericht
news:(E-Mail Removed)...
> Hello Jan,
>
> Thanks for your interest firstly...
>
> 1) As I don't do a comparison on types this won't work.
>
> 2) Automatic converters converts this line as it is but .gettype is not
> exposed in VB.Net although it's so in C#.
>
> Any other suggestion?
>
> Özden
>
> "Jan Tielens" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > 1) you can use typeof(MainComponent) instead of GetType(MainComponent)
> >
> > 2) Automatic conversion from C# to VB.NET
> > http://www.kamalpatel.net/ConvertCSharp2VB.aspx
> >
> > --
> > Greetz,
> > Jan
> > __________________________________
> > Read my weblog: http://weblogs.asp.net/jan
> > "Özden Irmak" <(E-Mail Removed)> schreef in bericht
> > news:%(E-Mail Removed)...
> > > Hello,
> > >
> > > This code line works on C# :
> > >
> > > MainComponent.gettype()
> > >
> > > where Maincomponent is a type of IComponent but I couldn't convert it

> to
> > > VB.Net. This way generates a warning in the designer as "Type
> > > 'MainComponent' is not defined." :
> > >
> > > GetType(MainComponent)
> > >
> > > Any Suggestion?
> > >
> > > Also, does anybody know a guide (website,etc.) which will help me on

my
> > work
> > > to convert some code from C# to VB.Net?
> > >
> > > Thanks in advance...
> > >
> > > Özden
> > >
> > >

> >
> >

>
>



 
Reply With Quote
 
Ken Tucker [MVP]
Guest
Posts: n/a
 
      12th Dec 2003
Hi,

There is a C# to VB converter addin in the vb.net resource kit. On
the additional resources tab under useful utilites.

Ken
-------------
"Jan Tielens" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 1) you can use typeof(MainComponent) instead of GetType(MainComponent)
>
> 2) Automatic conversion from C# to VB.NET
> http://www.kamalpatel.net/ConvertCSharp2VB.aspx
>
> --
> Greetz,
> Jan
> __________________________________
> Read my weblog: http://weblogs.asp.net/jan
> "Özden Irmak" <(E-Mail Removed)> schreef in bericht
> news:%(E-Mail Removed)...
> > Hello,
> >
> > This code line works on C# :
> >
> > MainComponent.gettype()
> >
> > where Maincomponent is a type of IComponent but I couldn't convert it

to
> > VB.Net. This way generates a warning in the designer as "Type
> > 'MainComponent' is not defined." :
> >
> > GetType(MainComponent)
> >
> > Any Suggestion?
> >
> > Also, does anybody know a guide (website,etc.) which will help me on my

> work
> > to convert some code from C# to VB.Net?
> >
> > Thanks in advance...
> >
> > Özden
> >
> >

>
>



 
Reply With Quote
 
Joe Fallon
Guest
Posts: n/a
 
      13th Dec 2003
I use this site to translate C# to VB:

http://authors.aspalliance.com/aldot...translate.aspx

--
Joe Fallon




"Özden Irmak" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> Hello,
>
> This code line works on C# :
>
> MainComponent.gettype()
>
> where Maincomponent is a type of IComponent but I couldn't convert it to
> VB.Net. This way generates a warning in the designer as "Type
> 'MainComponent' is not defined." :
>
> GetType(MainComponent)
>
> Any Suggestion?
>
> Also, does anybody know a guide (website,etc.) which will help me on my

work
> to convert some code from C# to VB.Net?
>
> Thanks in advance...
>
> Özden
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Conversion Problem Roger Microsoft C# .NET 6 17th May 2007 07:10 PM
Conversion Problem =?Utf-8?B?aG9ydGxhZHkx?= Microsoft Word Document Management 1 3rd Dec 2006 06:44 PM
mdb Conversion problem? =?Utf-8?B?R0hM?= Microsoft Access 1 16th Nov 2004 11:49 AM
Conversion Problem Del Nash Microsoft Access VBA Modules 3 27th May 2004 01:12 PM
MM2: AVI Conversion Problem Brian Windows XP MovieMaker 3 10th Mar 2004 01:21 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:34 PM.