.NETGURU
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




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification