Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 569371
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T13:17:17+00:00 2026-05-13T13:17:17+00:00

I need to create a class that can be accessible through the ASP Classic

  • 0

I need to create a class that can be accessible through the ASP Classic‘s Server.CreateObject method, and that exposes three properties (int Width, int Height, bool Loaded) and three methods (void Load(string locatoin), void Resize(int width, int height), and void Save(string location)).
All my attempts so far has been unsuccessful.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T13:17:17+00:00Added an answer on May 13, 2026 at 1:17 pm

    Building the object is very easy – registering it and managing the COM dependency can be quite tricky.

    Your .NET project should be a class library, and your class can be a straightfoward C# / .NET CLR object:

    namespace MyCompany.MyProject.Com {
      public class MyObject {
          public int Width { get; set; }
          public int Height { get; set; }
          public void Load(string location) { /* implementation here */ }
          public void Resize(int width, int height) { /* implementation here */ }
      }
    }
    

    Right-click your project, select Properties, Application, click Assembly Information… and ensure that “Make assembly COM-Visible” is selected at the bottom of the Assembly Information dialog.

    Build your project – you should end up with MyCompany.MyProject.Com.dll in your \bin\debug\ folder.

    Build a simple ASP webpage that looks like this:

    <% option explicit %>
    <%
    dim myObject
    set myObject = Server.CreateObject("MyCompany.MyProject.Com.MyObject")
    myObject.Width = 20
    myObject.Height = 40
    %>
    <html>
    <head>COM Interop Demo</head>
    <body>
    <p>Width + Height = <%= myObject.Width + myObject.Height %></p>
    </body>
    </html>
    

    Bring up that page on http://localhost/ and verify that you get “Server.CreateObject failed” the first time you try and run it.

    Now register your DLL as a COM object using regasm.exe, installed with the .NET framework:

    C:\>C:\Windows\Microsoft.NET\Framework\v2.0.50727\regasm.exe /tlb MyCompany.MyProject.Com.dll     /codebase
    
    Microsoft (R) .NET Framework Assembly Registration Utility 2.0.50727.4927
    Copyright (C) Microsoft Corporation 1998-2004.  All rights reserved.
    
    Types registered successfully
    Assembly exported to 'D:\WebDlls\MyCompany.MyProject.Com.tlb', and the type library w
    as registered successfully
    

    Now refresh your web page, and you should see Width + Height = 60 in your output.

    These instructions assume you’re not running anything in 64-bit; if you are, it gets more complex. (You either need to run everything as 64-bit – compile a 64-bit project and use the 64-bit version of regasm.exe to register it for 64-bit COM, accessed by IIS running a 64-bit scripting host) – or manually force everything to 32-bit.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 322k
  • Answers 322k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You are asking for the difference in speed for two… May 14, 2026 at 12:51 am
  • Editorial Team
    Editorial Team added an answer Another option is to use \dfrac instead of \frac, which… May 14, 2026 at 12:51 am
  • Editorial Team
    Editorial Team added an answer Array#permutation, Array#combination and Enumerable#group_by are defined in ruby since 1.8.7.… May 14, 2026 at 12:51 am

Related Questions

I'm developing for the iPhone, and I have a class DataManager , that is
I have a RESTful service that I am developing in WCF . I am
Is it possible to define an instance method in ruby from a string (the
I'm trying to figure out the best way to save (serialize) and later open
I created a C#.net app that uses dates from a SQL Server 2008 database

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.