COM+ Moniker
Messages   Related Types
This message was discovered on ASPFriends.com 'aspngmigrate' list.


Jeff
-- Moved from [aspngvs] to [aspngmigrate] by Charles M. Carroll <Click here to reveal e-mail address> --

Hello list,

I have a COM+ Component that I want to use on my ASP.NET page. so I call:

"
MyComponent.IQComponent iQC =
(MyComponent.IQComponent)Marshal.BindToMoniker("queue:/new:MyComponent.MyCla
ss");
iQC.NewMethod("Hello");
"

This works great on a windows application. I can see it come through fully.
But on my ASP.NET Page, It doesn't work. I know the code is correct because
it works in my windows forms. It gives me this error:

Specified cast is not valid.

Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.InvalidCastException: Specified cast is not valid.

Thanks a lot!
Jeff King

Reply to this message...
 
    
Jeff
-- Moved from [aspngwebservices] to [aspngmigrate] by Michiel van Otegem <Click here to reveal e-mail address> --

Hello list,

I have a COM+ Component that I want to use on my ASP.NET page. so I call:

"
MyComponent.IQComponent iQC =
(MyComponent.IQComponent)Marshal.BindToMoniker("queue:/new:MyComponent.MyCla
ss");
iQC.NewMethod("Hello");
"

This works great on a windows application. I can see it come through fully.
But on my ASP.NET Page, It doesn't work. I know the code is correct because
it works in my windows forms. It gives me this error:

Specified cast is not valid.

Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.InvalidCastException: Specified cast is not valid.

Sincerely,
Jeff King

Reply to this message...
 
    
Michiel van Otegem
First up, I'm curious as to why you're creating an instance the way you are
doing. IMHO It's much easier to create a COM+ wrapper and place that in the
/bin directory. You can then call the component through the wrapper, which
takes care of all the plumbing for you. AFAIK using the Marshal class is
mainly intended for explicitly managing the unmanaged code yourself, but I
could be wrong...

---
Michiel van Otegem
ASPFriends.com Moderation Team

ASPNL.com - ASP/ASP.NET/XML Teacher
http://www.aspnl.com
http://www.aspalliance.com/michiel
---
Teach Yourself XSLT in 21 Days
http://www.amazon.com/exec/obidos/ASIN/0672323184/aspnlcom-20

----- Original Message -----
From: "Jeff" <Click here to reveal e-mail address>
To: "aspngmigrate" <Click here to reveal e-mail address>
Sent: Friday, April 12, 2002 1:21 AM
Subject: [aspngmigrate] COM+ Moniker

> -- Moved from [aspngwebservices] to [aspngmigrate] by Michiel van Otegem
<Click here to reveal e-mail address> --
[Original message clipped]

Reply to this message...
 
    
Jeff
Michiel van Otegem,

You are correct, however I need to access the queued components part of
COM+, so in doing so, I need to not access the component directly but
through the COM Services. The only way to create the object through COM+
Services in .NET that I know of is the way I refered to below. I actually
solved the problem. It seems to be a problem in Windows XP Pro. In Windows
2000 Advanced server, the below statement works fine. I hope microsoft
fixes this in XP as a patch so I can continue working locally and not on the
server.

Sincerely,
Jeff King
Lead Developer
Stargate Communications, Inc.
2805 Butterfield Rd.
Oakbrook, IL 60172
Tel: (630) 572-2242 Ext. 28
Email: Click here to reveal e-mail address

-----Original Message-----
From: Michiel van Otegem [mailto:Click here to reveal e-mail address]
Sent: Tuesday, April 23, 2002 10:40 AM
To: aspngmigrate
Subject: [aspngmigrate] Re: COM+ Moniker

First up, I'm curious as to why you're creating an instance the way you are
doing. IMHO It's much easier to create a COM+ wrapper and place that in the
/bin directory. You can then call the component through the wrapper, which
takes care of all the plumbing for you. AFAIK using the Marshal class is
mainly intended for explicitly managing the unmanaged code yourself, but I
could be wrong...

---
Michiel van Otegem
ASPFriends.com Moderation Team

ASPNL.com - ASP/ASP.NET/XML Teacher
http://www.aspnl.com
http://www.aspalliance.com/michiel
---
Teach Yourself XSLT in 21 Days
http://www.amazon.com/exec/obidos/ASIN/0672323184/aspnlcom-20

----- Original Message -----
From: "Jeff" <Click here to reveal e-mail address>
To: "aspngmigrate" <Click here to reveal e-mail address>
Sent: Friday, April 12, 2002 1:21 AM
Subject: [aspngmigrate] COM+ Moniker

> -- Moved from [aspngwebservices] to [aspngmigrate] by Michiel van Otegem
<Click here to reveal e-mail address> --
[Original message clipped]

| [aspngmigrate] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngmigrate.asp = JOIN/QUIT

Reply to this message...
 
 
System.InvalidCastException
System.Runtime.InteropServices.Marshal




Ad
MBR BootFX
Best-of-breed application framework for .NET projects, developed by Matthew Baxter-Reynolds and MBR IT
 
 Copyright © Matthew Baxter-Reynolds 2001-2008. '.NET 247 Software Development Services' is a trading style of MBR IT Solutions Ltd.
Contact Us - Terms of Use - Privacy Policy - www.dotnet247.com