|
|
||||||
|
#1
|
|
|
|
|
Hi,
I'm trying to learn the function of DirectCast and CType which are similiar. Could you explain and sample a simple code that shows what they exactly do and have differences? Thanks. |
|
|
|
#2
|
|
|
|
|
kimiraikkonen,
http://www.panopticoncentral.net/arc...07/10/149.aspx Kerry Moorman "kimiraikkonen" wrote: [..] |
|
#3
|
|
|
|
|
"kimiraikkonen" <kimiraikkonen85> schrieb
> Hi, > I'm trying to learn the function of DirectCast and CType which are > similiar. Could you explain and sample a simple code that shows what > they exactly do and have differences? DirectCast /only/ does type casting. Casting does not create a new object, it just changes the type of the reference. This implicitly means that the object must be of the destination type, derived from the destination type or implement the destination interface. CType either converts or casts. If it can not be casted, VB will try to convert the source object to a new destination object. CType will be compiled to whatever is necessary in the specific situation, depending on the type of the source object and the destination type. In addition, CType can be defined as a user defined operators. For details please have a look at "Type Conversions in Visual Basic". Too much to paste here. Armin |
|
#4
|
|
|
|
|
"kimiraikkonen" <kimiraikkonen85> schrieb
> Hi, > I'm trying to learn the function of DirectCast and CType which are > similiar. Could you explain and sample a simple code that shows what > they exactly do and have differences? DirectCast /only/ does type casting. Casting does not create a new object, it just changes the type of the reference. This implicitly means that the object must be of the destination type, derived from the destination type or implement the destination interface. CType either converts or casts. If it can not be casted, VB will try to convert the source object to a new destination object. CType will be compiled to whatever is necessary in the specific situation, depending on the type of the source object and the destination type. In addition, CType can be defined as a user defined operators. For details please have a look at "Type Conversions in Visual Basic". Too much to paste here. [sorry, no example] ;) Armin |
|
#5
|
|
|
|
|
On Jan 11, 1:41 am, Kerry Moorman
<KerryMoor> wrote: > kimiraikkonen, > > [..] > > Kerry Moorman >> > "kimiraikkonen" wrote: >> - Show quoted text - Thanks for the link. I'll take a look. and thanks Armin for the explanation. |
|
#6
|
|
|
|
|
On Jan 11, 1:47 am, kimiraikkonen <kimiraikkone> wrote:
[..] >> > Thanks for the link. I'll take a look. > > and > > thanks Armin for the explanation.- Hide quoted text - > > - Show quoted text - Meanwhile, it seems my first(main) message is not shown on Google group page for a reason related to Google servers.(interesting). Kerry's message is shown as first message :-) |
|
#7
|
|
|
|
|
Yet another good reason for NOT using a web-based 'portal' for accessing
usenet newsgroups. "kimiraikkonen" <kimiraikkonen85> wrote in message news:6ca2 On Jan 11, 1:47 am, kimiraikkonen <kimiraikkone> wrote: [..] >> > Thanks for the link. I'll take a look. > > and > > thanks Armin for the explanation.- Hide quoted text - > > - Show quoted text - Meanwhile, it seems my first(main) message is not shown on Google group page for a reason related to Google servers.(interesting). Kerry's message is shown as first message :-) |
|
#8
|
|
|
|
|
On Jan 11, 9:33 pm, "Stephany Young" <noone@localhost> wrote:
[..] >> >> > > Meanwhile, it seems my first(main) message is not shown on Google > group page for a reason related to Google servers.(interesting). > Kerry's message is shown as first message :-) Which software do you suggest? And also its settings? I took a look on classic Outlook Express 6 which reads messages fine, but the posting requires SMTP server configuration which i don't know for newsgroups. |
|
#9
|
|
|
|
|
On 2008-01-11, kimiraikkonen <kimiraikkonen85> wrote:
> On Jan 11, 9:33 pm, "Stephany Young" <noone@localhost> wrote: > > Which software do you suggest? And also its settings? > > I took a look on classic Outlook Express 6 which reads messages fine, > but the posting requires SMTP server configuration which i don't know > for newsgroups. slrn :) |
|
#10
|
|
|
|
|
On Fri, 11 Jan 2008 11:52:50 -0800 (PST), kimiraikkonen
<kimiraikkonen85> wrote: >On Jan 11, 9:33 pm, "Stephany Young" <noone@localhost> wrote: > >Which software do you suggest? And also its settings? > >I took a look on classic Outlook Express 6 which reads messages fine, >but the posting requires SMTP server configuration which i don't know >for newsgroups. I use Agent. <http://www.forteinc.com/main/homepage.php> |
|
|
| Similar Threads | |
| directcast can anyone explain the directcast code...ive tried using it and lookin it up but im lookin for an easy definition and how it works...ive tried using it before byut it throws... |
|
| DirectCast invalid Hello I have the following code: Public Groupes As New Hashtable Dim Entry As DictionaryEntry For Each Entry In Groupes Dim Gr As Groupe = DirectCast(Entry.Value,... |
|
| DirectCast in .NET 2.0 I can't find it .. what am I missing? - Sahil Malik [..] |
|
| directCast Can I use DirectCast to convert a object to it's base or should I use CType? I have a instance of a class as Object. The run-time tipe is a derived of a class, but I need to... |
|
|
All times are GMT. The time now is 07:03 PM. | Privacy Policy
|