473,396 Members | 1,712 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

CreateObject vs New

Ok, so I am a bit new with asp.net. I have done everything to import
the com object correctly in ASP.NET and the following line works like
a charm.

Dim MeSrvCtrl As New MeSrvCtrlClass
Why does the following line not work?
MeSrvCtrl = CreateObject("MeSrvCtrlClass", Myserver_name)
As far as I can read these two are supposed to be basicaly the same.
Any help would be appriciated.

Eric
Nov 18 '05 #1
2 1210
well there is difference between create object and new method for creating
objects
create object cannot be used if instancing property of class is set private
or public not creatable.
Check that
"Eric Brooksby" wrote:
Ok, so I am a bit new with asp.net. I have done everything to import
the com object correctly in ASP.NET and the following line works like
a charm.

Dim MeSrvCtrl As New MeSrvCtrlClass
Why does the following line not work?
MeSrvCtrl = CreateObject("MeSrvCtrlClass", Myserver_name)
As far as I can read these two are supposed to be basicaly the same.
Any help would be appriciated.

Eric

Nov 18 '05 #2
Hi Eric,

Those two are far from the same. The Visual Basic CreateObject function is
for the purpose of instantiating COM objects, not .Net classes.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living

"Eric Brooksby" <er**********@hotmail.com> wrote in message
news:55**************************@posting.google.c om...
Ok, so I am a bit new with asp.net. I have done everything to import
the com object correctly in ASP.NET and the following line works like
a charm.

Dim MeSrvCtrl As New MeSrvCtrlClass
Why does the following line not work?
MeSrvCtrl = CreateObject("MeSrvCtrlClass", Myserver_name)
As far as I can read these two are supposed to be basicaly the same.
Any help would be appriciated.

Eric

Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Roland Johann | last post by:
On my Windows Server 2003 Web Edition I have installed an application which offers some OLE Automation Objects. On my local system (W2k Prof) it works fine but on my server 2003 I have a big...
14
by: wk6pack | last post by:
Hi, I'm getting this error on my asp page intermittently. One day it is fine, another day, it crashes a lot. I have searched the web and microsoft on this and they say it is a recordset...
6
by: MacKenzie | last post by:
The statement in an asp page: dim objShell Set objShell = WScript.CreateObject("WScript.Shell") now gives this error: VB err= 424,Object required If I use...
1
by: Raúl Martín | last post by:
I´ve a function in asp that run correctly but If I tried to change it forasp.net in asp: xmlHTTP = CreateObject("Microsoft.XMLHTTP") And I thought to use this sentence for asp.net but the...
12
by: karen | last post by:
Hi all : this is going to be a long post. So i apologize in advance :) i am converting a java program in VB right now. I am a java programmer by trade. so i am no expert in this department. I...
2
by: C Williams | last post by:
Hi, I am having some problems with CreateObject and Powerpoint. I'm working from VB.NET with Powerpoint 2003. The code below is only ever called when powerpoint is already open. It's called...
7
by: dlasusa | last post by:
Sorry if this is the wrong group...I THINK I got to the right place...(oh...and I'm a newbie programmer...so please be gentle) Anyway I have a program that works fine when I run it from within...
0
by: quintesv | last post by:
hi all, Running VS.2003 , framework 1.1. I have a COM object written in Delphi which im trying to call through ASP.NET. The COM object connects to a folder on another machine and opens a...
1
by: Lynn Zou | last post by:
In our system , we use an ASP page to upload files but sometimes it doesnot work as it suppose to do and we found error log in Application Error as: Event Type: Error Event Source: Active...
3
by: Sagar | last post by:
I am working on a project where Server.CreateObject is replaced with CreateObject all over the project. Though I know that this will improve performance in terms of Memory overlhead because of how...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.