Robert,

The TypeName function will still work, but the ".NET way" to do this is to
use GetType(), as Serdar suggested.  Actually, you should use
<object>.GetType().ToString(), since GetType() returns a Type object.

I don't know whether either TypeName or GetType will work with ATL
objects.  My guess is that both will, but try them and tell us, please.

Bill

On Mon, 20 May 2002 15:22:47 +1000, Rolls, Robert
<[EMAIL PROTECTED]> wrote:

>Will this work if I'm passing the object out as a COM object - what we do
is
>
>
>a ATL component calls
>
>CreateObject(enum thing) as Object
>
>assigns some values then calls the AddObject will the GetType still do its
>magic - also do you know how/what vb does to determine the type from an
>IDispatch interface.
>
>Thanks
>Robert Rolls.
>
>-----Original Message-----
>From: Serdar Kilic [mailto:[EMAIL PROTECTED]]
>Sent: Monday, 20 May 2002 15:19
>To: [EMAIL PROTECTED]
>Subject: Re: [DOTNET] VB TypeName and .Net?
>
>
>Hi Robert,
> I believe <object>.GetType() is what you need.
>
><ms-
help://MS.NETFrameworkSDK/cpref/html/frlrfSystemObjectClassGetTypeTopic.
>htm>
>Robert, said:
>
>Robert> In our existing VB 6 application we have a component that has the
>following
>Robert> signature
>
>Robert> Public Sub AddObject(ByVal Object As Object)
>
>Robert> within this we do the following to determine what type of object
>were
>Robert> actually dealing with - the object is a normal vb class module
>(within the
>Robert> same project)
>
>Robert> Select Case TypeName(Object)
>Robert>         Case "ExtractFile"
>Robert>                 Call XYZ ....
>Robert> End Select
>
>
>Robert> will this work in .Net? and what's the equivalent.
>
>Robert> Regards,
>Robert> Robert Rolls
>
>You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
>subscribe to other DevelopMentor lists at http://discuss.develop.com.
>
>
>**********************************************************************"
>This correspondence is for the named person's use only. It may
>contain confidential or legally privileged information or both. "
>No confidentiality or privilege is waived or lost by any "
>mistransmission.  If you receive this correspondence in error, please
>immediately delete it from your system and notify the sender.  You
>must not disclose, copy or rely on any part of this correspondence
>if you are not the intended recipient.
>
>Any views expressed in this message are those of the individual sender,
>except where the sender expressly, and with authority, states them to
>be the views of Vodafone.
>
>This email has been checked for viruses.
>***************************************************************************
*******************
>
>You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
>subscribe to other DevelopMentor lists at http://discuss.develop.com.

You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to