Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 9th, 2006, 07:20 AM
Registered User
 
Join Date: Jun 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to Salma Hanif Shaikh
Default Calling com component from Asp.net 1.1

My requirment :: I need a COM Component that can interact with Client's PC , read specified file and send File ,that can be of any size and any type ,from client to the file server.the File will be uploaded in the chunks.


Problem :

As far as i know ..COM component can be built in .net 2003 .. in which Micrososft provides 'COM Class Template'


I have build a COM Component through COM class Template in .net 2003.Now i m facing problem in initialization of that componenet via VBScript. I m unable to call that component at client side also.
is the anyone who is brillient enough to tell me the steps to call a COM component(built either in Vb 6.0 or Vb.net or C#.net) via VBScript a client side.

Please let u know if have any solution and suggestion

************************************************** *******************
Code of my COM component
************************************************** *******************

Imports System.IO
Namespace InfiniFileUploader

    <ComClass(FileUploader.ClassId, FileUploader.InterfaceId, FileUploader.EventsId)> _
Public Class FileUploader

#Region "COM GUIDs"
        ' These GUIDs provide the COM identity for this class
        ' and its COM interfaces. If you change them, existing
        ' clients will no longer be able to access the class.
        Public Const ClassId As String = "EBA61BD9-D19C-4A9D-9153-7E227C931A35"
        Public Const InterfaceId As String = "DD66706B-FA9B-434C-BC2A-5D2251951365"
        Public Const EventsId As String = "2A06E5AA-7DB6-44F4-BD0E-96787E9C5022"
#End Region

        Private FPath As String = ""
        Private fname As String = ""

        Public Property FilePath() As String
            Get
                Return FPath
            End Get
            Set(ByVal Value As String)
                FPath = Value
            End Set
        End Property
        Public Property FileName() As String
            Get
                Return fname
            End Get
            Set(ByVal Value As String)
                fname = Value
            End Set
        End Property

        ' A creatable COM class must have a Public Sub New()
        ' with no parameters, otherwise, the class will not be
        ' registered in the COM registry and cannot be created
        ' via CreateObject.
        Public Sub New()
            MyBase.New()
        End Sub


        Public Function UploadFile() As String

            Dim File As FileInfo = New FileInfo(FilePath)
            Dim fs As FileStream = New FileStream(FilePath, FileMode.Open, FileAccess.Read)

            Return File.Length.ToString

        End Function

    End Class

End Namespace




Salma Hanif Shaikh





Similar Threads
Thread Thread Starter Forum Replies Last Post
Cannot create ActiveX component in asp.net 2.0 Thorgal ASP.NET 2.0 Professional 1 December 14th, 2007 12:17 AM
Calling a C# component from C++ mbc280 Visual C++ 0 July 25th, 2007 02:09 PM
Looking for ASP.NET component.. subhasps8 ASP.NET 2.0 Professional 1 June 22nd, 2007 08:45 AM
call window dialog component with asp.net/vb.net s3ng ASP.NET 1.x and 2.0 Application Design 0 June 21st, 2005 04:54 AM
Calling COM+ component from webservice yossarian .NET Web Services 0 January 17th, 2005 02:29 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.