PC Review


Reply
Thread Tools Rate Thread

Difference between ways of Object creation

 
 
=?Utf-8?B?VG9t?=
Guest
Posts: n/a
 
      31st Oct 2005
Hi Friends
Would like to know what's the difference between creating an object like this:
1) Dim Obj As New aspftp.ASPTFP

And this:
2) Dim Obj As aspftp.ASPFTP
Obj = CreateObject("aspftp.ASPFTP")

Reason I ask is number 1 works for me, but number 2 fails with this error:
"Cannot create activeX component'"

This issue is discussed in other forum, but there is no answer at the end.
Although my problem of "cannot create ActiveX component" is solved, seems
that there will be problem in the future if I use (1) to solve this problem...

Thanks in advance

Tom
 
Reply With Quote
 
 
 
 
Bajoo
Guest
Posts: n/a
 
      31st Oct 2005
Dear Tom,
CreateObject() creates and returns a reference of a
COM object. CreateObject can't be used for creating instances of
classes in VB unless those classes are explicitly exposed as COM
components. Make sure that "aspftp.ASPFTP" is explicitly exposed as COM
component.

Regards,
Naveed Ahmad Bajwa
Kalsoft Pvt Ltd

 
Reply With Quote
 
=?Utf-8?B?VG9t?=
Guest
Posts: n/a
 
      31st Oct 2005
Dear Bajoo

Thanks for your reply!! aspftp.ASPFTP is really class in VB and reuse in
VB.NET. May I ask how do I know that whether a component is explcitly exposed
as COM component. I have registered the aspftp.dll to component service
already.
If the problem comes from createObject, then does it means using
Dim Obj As New aspftp.ASPFTP
do not have any problem?

Many Thanks!!
"Bajoo" wrote:

> Dear Tom,
> CreateObject() creates and returns a reference of a
> COM object. CreateObject can't be used for creating instances of
> classes in VB unless those classes are explicitly exposed as COM
> components. Make sure that "aspftp.ASPFTP" is explicitly exposed as COM
> component.
>
> Regards,
> Naveed Ahmad Bajwa
> Kalsoft Pvt Ltd
>
>

 
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
Difference between two ways to set Text in a TextBox ? Moe Sisko Microsoft ASP .NET 0 31st Mar 2008 06:59 AM
2 ways to initialize, what's the difference? Zytan Microsoft VB .NET 36 21st Feb 2007 11:35 PM
What's the difference between these two ways of adding delegates to a Generic List object? Deckarep Microsoft C# .NET 1 21st Jan 2007 04:08 AM
Is there a difference of this two ways? =?Utf-8?B?Q2h1YSBXZW4gQ2hpbmc=?= Microsoft C# .NET 2 1st Jul 2004 10:57 AM
Form creation exception error; swapping delaying object creation? Fiona McBride Microsoft Dot NET 0 20th Apr 2004 09:58 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:52 PM.