473,387 Members | 1,541 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,387 software developers and data experts.

CreateObject( )... :(

Dear friends,
I have developed a module in VB6 and now I want to redevelop it into
..NET .

VB6
Dim cat as Object
Set cat =GetObject("","ABC.Application")
Dot NET
Dim cat as Object
Set cat =GetObject("","ABC.Application")
I don't have deep knowledge of Dot NET so I use this code and its
working.

It runs smoothly when the application is running. But in VB6 if the
application is not working then it shows an error "ActiveX component
can not create object". But in Dot NET I don't get this error
message?. But I need the error message so that I can find out whether
the application is working or not? Or how can I know that ABC
application is running or not.

Thanks in Advance.

Jan 6 '06 #1
3 1699
"Pauras Desani" <Pa***********@gmail.com> schrieb:
VB6
Dim cat as Object
Set cat =GetObject("","ABC.Application")
Dot NET
Dim cat as Object
Set cat =GetObject("","ABC.Application")
I don't have deep knowledge of Dot NET so I use this code and its
working.

It runs smoothly when the application is running. But in VB6 if the
application is not working then it shows an error "ActiveX component
can not create object". But in Dot NET I don't get this error
message?. But I need the error message so that I can find out whether
the application is working or not?


Untested:

\\\
Dim cat As Object = GetObject(...)
If cat Is Nothing Then
MsgBox("Application not working!")
Else
...
End If
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
Jan 6 '06 #2
u can use "System.Diagnostics" namespace to get all the processes
running on your machine and thus u can find out whether your app is
running or not.

by the way what u got in your object when you call the GetObject()
function and the abc application is not running?

Jan 7 '06 #3
when i did some testing with our VB6 activex app ( a verry long time ago
:-) )
i was told to do it like this
'Import Reflection Namspace which supports COM interoperability

Imports System.Reflection

private HBSObject as object

in the method to start the component

Dim HBSCOM As Type

'Get the object

HBSCOM = Type.GetTypeFromProgID("Hbase.clsHbase")

'Create instance of HBSCOM

Addtekst("Creating instance ")

HBSObject = Activator.CreateInstance(HBSCOM)

If Not (HBSObject Is Nothing) Then

do your stuff here

End If

in the close / cleanup method

System.Runtime.InteropServices.Marshal.ReleaseComO bject(HBSObject)

HBSObject = Nothing

regards

Michel Posseth [MCP]

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:eB**************@tk2msftngp13.phx.gbl...
"Pauras Desani" <Pa***********@gmail.com> schrieb:
VB6
Dim cat as Object
Set cat =GetObject("","ABC.Application")
Dot NET
Dim cat as Object
Set cat =GetObject("","ABC.Application")
I don't have deep knowledge of Dot NET so I use this code and its
working.

It runs smoothly when the application is running. But in VB6 if the
application is not working then it shows an error "ActiveX component
can not create object". But in Dot NET I don't get this error
message?. But I need the error message so that I can find out whether
the application is working or not?


Untested:

\\\
Dim cat As Object = GetObject(...)
If cat Is Nothing Then
MsgBox("Application not working!")
Else
...
End If
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Jan 7 '06 #4

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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...

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.