473,568 Members | 2,898 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Cannot instantiate COM+ application component

H

We have ported our VB 6 application into VB .NET but are still integrating with a few COM + applications written in VB6 running on our application server (Win 2000 Server). We have the proxies to link to the application server installed but we every now and then get a error when we try to make a call to a component running on the app server. The error message is something like

Object reference not set to an instance of an objec

at Microsoft.Visua lBasic.Compiler Services.LateBi nding.LateGet(O bject o, Type objType, String name, Object[] args, String[] paramnames, Boolen[] CopyBack

We instantiate the component in the .NET code by using the following line of code

objOMS680 = CreateObject("r ppOMS.clsOMS680 "

The error message is immediately displayed in the client application, but if you look at the component running within the COM+ application it just sits there spinning.

What can be the cause of this problem?

Regard
Carel Lotz
Nov 22 '05 #1
7 5053
Hello Carel,

Thanks for posting in the group.

Based on my understanding, now the issue is: You ported VB6 application to
VB.NET. But VB.NET application is still communicating with a few COM+
applications writtenin VB6 runnong on Win2000 Server. The error message is:

Object reference not set to an instance of an object
at Microsoft.Visua lBasic.Compiler Services.LateBi nding.LateGet(O bject o,
Type objType, String name, Object[] args, String[] paramnames, Boolen[]
CopyBack)

The code that caused error is:
objOMS680 = CreateObject("r ppOMS.clsOMS680 ")

Please correct me if I have anything misunderstood.

Currently I am finding somebody who could help you on it. We will follow up
here with more information. At the same time, could you please provide the
following information:

1) Which version of .NET framework are you running in that VB.NET
application machine?

2) Which version of VS.NET are you using? VS.NET 2002 or VS.NET 2003?

3) Which OS are you running on for that VB.NET application? Service Pack
version?

Thanks very much.

Best regards,
Yanhong Huang
Microsoft Community Support

Get Secure! ¨C www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 22 '05 #2
HI, Carel

I've created an escallation for this issue and routed it to the COM+ team.
The site where most of the COM+ team works is closed today due to icy
conditions, so there may be a delay in getting you a response. If you wish
to contact me directly, just remove "online." from my alias and it should
get to me.

Thank you for choosing the MSDN Managed Newsgroups,

John Eikanger
Microsoft Developer Support

This posting is provided “AS IS” with no warranties, and confers no rights.
--------------------
| Thread-Topic: Cannot instantiate COM+ application component
| thread-index: AcPkDo48c+MAgfY ER/mNl83BT5sblg==
| X-Tomcat-NG: microsoft.publi c.dotnet.genera l
| From: "=?Utf-8?B?Q2FyZWwgTG9 0eg==?=" <cj****@hotmail .com>
| Subject: Cannot instantiate COM+ application component
| Date: Mon, 26 Jan 2004 05:16:06 -0800
| Lines: 18
| X-Tomcat-NG: microsoft.publi c.dotnet.genera l
|
| Hi

We have ported our VB 6 application into VB .NET but are still integrating
with a few COM + applications written in VB6 running on our application
server (Win 2000 Server). We have the proxies to link to the application
server installed but we every now and then get a error when we try to make
a call to a component running on the app server. The error message is
something like:

Object reference not set to an instance of an object

at Microsoft.Visua lBasic.Compiler Services.LateBi nding.LateGet(O bject o,
Type objType, String name, Object[] args, String[] paramnames, Boolen[]
CopyBack)

We instantiate the component in the .NET code by using the following line
of code:

objOMS680 = CreateObject("r ppOMS.clsOMS680 ")

The error message is immediately displayed in the client application, but
if you look at the component running within the COM+ application it just
sits there spinning.

What can be the cause of this problem??

Regards
Carel Lotz
|

Nov 22 '05 #3
H

1) .NET v1.
2) VS 200
3) Client machines we get the problem on all platforms i.e. Win98 SE, WinME, Win NT4.0 SP 6a, Win 2000, Win XP Home, Win XP Prof SP 1. Server is running Win 2000 Server SP

Care

----- Yan-Hong Huang[MSFT] wrote: ----

Hello Carel

Thanks for posting in the group

Based on my understanding, now the issue is: You ported VB6 application to
VB.NET. But VB.NET application is still communicating with a few COM+
applications writtenin VB6 runnong on Win2000 Server. The error message is

Object reference not set to an instance of an objec
at Microsoft.Visua lBasic.Compiler Services.LateBi nding.LateGet(O bject o,
Type objType, String name, Object[] args, String[] paramnames, Boolen[]
CopyBack

The code that caused error is
objOMS680 = CreateObject("r ppOMS.clsOMS680 "

Please correct me if I have anything misunderstood

Currently I am finding somebody who could help you on it. We will follow up
here with more information. At the same time, could you please provide the
following information

1) Which version of .NET framework are you running in that VB.NET
application machine

2) Which version of VS.NET are you using? VS.NET 2002 or VS.NET 2003

3) Which OS are you running on for that VB.NET application? Service Pack
version

Thanks very much

Best regards
Yanhong Huan
Microsoft Community Suppor

Get Secure! ¨C www.microsoft.com/securit
This posting is provided "AS IS" with no warranties, and confers no rights
Nov 22 '05 #4
Hi Matt

The server installation is brand new. I'll try re-installing and re-creating the proxies, but I doubt whether this will solve the problem. Remember, we get calls through to the component running on the server successfully. It is only after a few calls that the component stops responding and the client application receives the error message mentioned. I then need to shut down the COM+ application on the server whereafter everything works again ... only for a while though.

As to adding a reference to it from VS .NET - we do not want to do this as we want to use late binding to call the proxy. The component that calls the proxy is shared between different user roles in our application and not every role is allowed to call the proxy. By using late binding, we can therefore distribute the component to the unauthorized users without having to distribute the proxy as well - worked fine in the VB6 only solution. Authorized users get the proxy via a Role Manager application that is installed afterwards.

Carel

----- Matt Ozdemir wrote: -----

First of all, delete rppOMS COM+ package and unregister all rppOMS DLLs from the server if there are any. I recommend rebooting your server to clear the memory. Then create a new proxy installation package. Afterwards install the proxy using the proxy installation package. Add reference to it from VS.NET. Rebuild your application.
Nov 22 '05 #5
Hi Carel,

I read the posts on this thread. I understand that you have a VB6 COM+
Component called from a VB.NET client EXE located on a different machine.
At times, you receive an error message stating that an object reference is
not set to an instance of the object.

Unfortunately, this error message is somewhat generic, but from one of your
posts, it seems that you recover from the failing state by restarting the
COM+ Server Application. If that is correct, then you would need to
troubleshoot the COM+ Server Application. It may be hanging. If you are
familiar with using the Debugging Tools for Windows, you can attach the
debugger and investigate the cause of the error. If you are not familiar
with using the debuggers, you can create a process dump and open a case
with Microsoft PSS for dump analysis.

Before doing that, let's confirm a few things.

When the problem happens, does it affect all clients at once, or just one
(or a few)? If it happens to affect all users, then the COM+ Server App
has a problem. If it affects just one person at a time, then we may need
to look into networking issues.

You stated that when the client receives the error, the COM+ App just
spins. Is this a high CPU situation, or is this DLLHost.EXE process idle?
You can check the CPU utilization in TaskManager, but you may have several
DLLHost.EXE processes running. To identify the particular one, you can use
the Component Services MMC, select the COM+ Applications folder on the
left-hand side, and select View menu / Status View. This will display the
PID (Process ID) for each Server App on the right-hand side. You can then
cross-reference the PID to those in TaskMgr. If PID is not displayed in
TaskMgr, you can select View menu / Select columns... and tick the box for
PID.

When the client receives the error message, can you do a CreateObject from
a VBScript on the COM+ Server? You can test this with code like this:
Dim o
Set o = CreateObject("r ppOMS.clsOMS680 ")

(just paste into Notepad, and save as C:\Test.VBS, then run that from a
CMD.EXE prompt)

Can you also post the exact Exception, including all inner exceptions (if
any), and the stack trace from the client? That may help identify other
potential causes for this error.
Cheers,
Rob
Rob Maushardt
Microsoft Distributed Services
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
| Thread-Topic: Cannot instantiate COM+ application component
| thread-index: AcPlbTObGUKptnz lTKqE9o8/oADPMQ==
| X-Tomcat-NG: microsoft.publi c.dotnet.genera l
| From: "=?Utf-8?B?Q2FyZWwgTG9 0eg==?=" <cj****@hotmail .com>
| References: <CC************ *************** *******@microso ft.com>
<0#************ **@cpmsftngxa07 .phx.gbl>
| Subject: RE: Cannot instantiate COM+ application component
| Date: Tue, 27 Jan 2004 23:06:07 -0800
| Lines: 50
| Message-ID: <D6************ *************** *******@microso ft.com>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 8bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.publi c.dotnet.genera l
| Path: cpmsftngxa07.ph x.gbl
| Xref: cpmsftngxa07.ph x.gbl microsoft.publi c.dotnet.genera l:122874
| NNTP-Posting-Host: tk2msftcmty1.ph x.gbl 10.40.1.180
| X-Tomcat-NG: microsoft.publi c.dotnet.genera l
|
| Hi

1) .NET v1.1
2) VS 2003
3) Client machines we get the problem on all platforms i.e. Win98 SE,
WinME, Win NT4.0 SP 6a, Win 2000, Win XP Home, Win XP Prof SP 1. Server
is running Win 2000 Server SP 4

Carel

----- Yan-Hong Huang[MSFT] wrote: -----

Hello Carel,

Thanks for posting in the group.

Based on my understanding, now the issue is: You ported VB6
application to
VB.NET. But VB.NET application is still communicating with a few COM+
applications writtenin VB6 runnong on Win2000 Server. The error
message is:

Object reference not set to an instance of an object
at Microsoft.Visua lBasic.Compiler Services.LateBi nding.LateGet(O bject
o,
Type objType, String name, Object[] args, String[] paramnames,
Boolen[]
CopyBack)

The code that caused error is:
objOMS680 = CreateObject("r ppOMS.clsOMS680 ")

Please correct me if I have anything misunderstood.

Currently I am finding somebody who could help you on it. We will
follow up
here with more information. At the same time, could you please provide
the
following information:

1) Which version of .NET framework are you running in that VB.NET
application machine?

2) Which version of VS.NET are you using? VS.NET 2002 or VS.NET 2003?

3) Which OS are you running on for that VB.NET application? Service
Pack
version?

Thanks very much.

Best regards,
Yanhong Huang
Microsoft Community Support

Get Secure! ¨C www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no
rights.
|

Nov 22 '05 #6
Hi Ro

1) Yes, when the problem occurs, it affects all clients at once
2) No, it is not a CPU utilization issue as the process is not using any CPU tim
3) Yes, I can successfully run the VB script file as you mentioned. I can do a CreateObject within the vbs file, but as soon as I try to call a method of the object I get the erro
4) Complete .NET exception details [there is no inner exception set]

?ex.ToStrin
"System.NullRef erenceException : Object reference not set to an instance of an object
at Microsoft.Visua lBasic.Compiler Services.LateBi nding.LateGet(O bject o, Type objType, String name, Object[] args, String[] paramnames, Boolean[] CopyBack
at ConsoleOMS.Test OMS.CallOMS() in C:\Development\ VS .NET\VB\Console OMS\TestOMS.vb: line 46

I got the above mentioned error by writing a simple .NET app (ConsoleOMS) that instantiates the object and tries to call a method on the object

One or two other observations
When using the test app, I saw that the component sat spinning in the COM+ explorer until I physically closed the app (thus ending the client process). I would have thought that this would happen as soon as the instance variable goes out of scope. Because these are still VB6 components, there is no Dispose available for me to call on the instance variable. The result is that if I run 5 instances of the test app concurrently, I get 5 activated instances within the COM+ explorer. This does not seem to be a problem though as they activated instances eventually timeout on the server. Should I be concerned about this

Another thing that I've noticed is the problem sometimes occurs more regularly if the client application receives an exception in between calls to the component running on the App server, i.e. the user would make a successful call to the component, receive an exception which it successfully dealt with by the app and on the next call to the application server you get the exception I've mentioned

Hope this help

Carel
Nov 22 '05 #7
Thanks for the clarifications, Carel.

The behaviour you see where the COM+ Components remain activated in COM+
until the client process ends suggests that the managed heap still holds
the reference to the RCW (Runtime Callable Wrapper) for the COM component.
This in turn means that the COM Component's ref count has not decreased to
zero, so COM+ keeps it around. When the client process ends, these
left-over components will be cleaned up.

If this is indeed what is happening, you should call the static (or shared
in VB.NET) Marshal.Release ComObject() method before the client-side
variable goes out of scope. Failing to call ReleaseComObjec t can result in
exceptions when the CLR tries to GC the managed reference to the unmanaged
object, and other errors. Here's an example of the call:

Dim simpleCOMPlusCo mponent As New SimpleCOMDLL.Si mpleCOMClass
Console.WriteLi ne(simpleCOMPlu sComponent.What TimeIsIt())
Marshal.Release ComObject(simpl eCOMPlusCompone nt)
simpleCOMPlusCo mponent = Nothing

You will need to import the System.Runtime. InteropServices namespace if you
don't have it already, or prefix that to the Marshal type name.

Here's a link to the MSDN documentation on this call (the URL may wrap in
the news readers):
http://msdn.microsoft.com/library/de...us/cpref/html/
frlrfSystemRunt imeInteropServi cesMarshalClass ReleaseComObjec tTopic.asp
Rob Maushardt
Microsoft Distributed Services
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 22 '05 #8

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

Similar topics

8
775
by: Carel Lotz | last post by:
H We have ported our VB 6 application into VB .NET but are still integrating with a few COM + applications written in VB6 running on our application server (Win 2000 Server). We have the proxies to link to the application server installed but we every now and then get a error when we try to make a call to a component running on the app server....
4
1949
by: Bobby C. Jones | last post by:
I'm trying to use some classes defined in a COM component that I did not create. I have successfully created the RCW via Tlbimp.exe and referenced it in my project. All is well until I run the project and it chokes with an "Invalid access to memory location." error when I try to instantiate an object like so: ...
1
3104
by: shel | last post by:
Hi All, Probably a silly question to those who know, but i'm a noob with C# :D I have a COM component written in VB6 I'm trying to interop to from C# (using the IDE 'Add Reference' capability to register the component). Some functions work ok, but I have one function that takes a class from the component and passes it to another function in...
7
10549
by: Simon Bond | last post by:
In C# we can go: <foo.cs> // Create a serializable class public class Foo : ISerializable { public void GetObjectData(SerializationInfo info, StreamingContext context) {};
1
7675
by: Zhou Jingxiong | last post by:
Hi I am using third party COM component which come with an installation program (.exe file included). The program will be register to registry automatically upon installation. There is no problem calling the COM component from VB.net Module from DOS Command Prompt : Imports System
2
5541
by: W. Broersen | last post by:
I want to use Outlook.Application, but I donot get further. Dim objOLApp As Outlook.Application objOLApp = CreateObject("Outlook.Application") Everytime I'll get the following error: Cannot create ActiveX component I set in the reference the COM from Outlook... Does someone know how to solve this problem????
3
6429
by: Paul | last post by:
Hi, I'm new to .NET and I'm trying to run through the tutorial "Creating a Web Application Using VB" As I follow the directions, It seems to work just fine. I can preview the data from the SQLDataAdapter but when I try to view the data in the browser I get the error:
1
15548
by: Rocio | last post by:
I have a windows app. written in VB6, now we need to expose some of its classes through a web service. I am only able to expose the classes using late binding becasue that's the way the original VB6 was written. I ahve already exposed some of the original classes, and they work fine. Now, I added a new ActiveX component to the windows app...
0
1840
by: jan.loucka | last post by:
We're running Windows Forms application written in .NET 2.0 (c#). The application is single threaded app - it starts without any form (Application.run()). After that we start another application (MapInfo professional) from our app using interop services and do some reparenting etc to make it look like our app. We also register our own...
1
4548
by: HiSam | last post by:
Hi I am using CreateObject("Application.Excel") in my class which is deployed as an exe on server which basically reads the excel file and creates the xml of it. Few days back it was working perfectly fine without any changes but suddenly it is giving Cannot create ActiveX component error. I checked the server and there were no recent...
0
7604
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7916
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7962
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5498
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5217
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3651
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3631
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1207
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
932
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.