Click here to Skip to main content
15,916,945 members
Home / Discussions / C#
   

C#

 
Generaltranslator design using c# Pin
saivenkat19-Aug-05 18:53
saivenkat19-Aug-05 18:53 
Generalhelp wit c++ codes pls Pin
neodeaths19-Aug-05 18:26
neodeaths19-Aug-05 18:26 
GeneralRe: help wit c++ codes pls Pin
leppie20-Aug-05 0:20
leppie20-Aug-05 0:20 
Generalmanaged code and unmanaged code Pin
amitmohanty19-Aug-05 16:34
amitmohanty19-Aug-05 16:34 
GeneralRe: managed code and unmanaged code Pin
Guffa19-Aug-05 22:11
Guffa19-Aug-05 22:11 
GeneralRe: managed code and unmanaged code Pin
amitmohanty21-Aug-05 6:12
amitmohanty21-Aug-05 6:12 
GeneralRe: managed code and unmanaged code Pin
Guffa23-Aug-05 21:33
Guffa23-Aug-05 21:33 
GeneralCOM+ in .NET Pin
Member 212799219-Aug-05 14:04
Member 212799219-Aug-05 14:04 
can anyone help to point the issue? I have struggled this for a day and cannot get any where.
I want to create a COM+ object remotely. The code is really simple as below.
I also did "gacutil -i "and "regsvcs" for both interface dll and COM+ object. also double check the existance in GAC and regedit.
When executing the test client at the line, NewPDFNoQueNew myPDF = new NewPDFNoQueNew();,i did see a DLLHOST.exe kicked off, then at this time, i am able to attach DLLHOST.exe from the Visual Studio COM+.

But some how, it throws "unable to cast object of type PDFNoQueNew.PDFConvNoQueNew to NewPDFNoQueNew".

Thank you so much in advance.

1 Interface DLL.
using System;
using System.Diagnostics;
using System.EnterpriseServices;
using System.Runtime.InteropServices;
using System.Reflection;

namespace IPDFPrintTestNew
{
[Guid("050355EC-83C9-4723-9E2D-AAAAD3CA3BAF")]
public interface IPDFPrint
{
string PDFPrintMethod();
}
}

2. COM+ object //add a reference to IPDFPrintTestNew
using System;
using System.Runtime.InteropServices;
using System.EnterpriseServices;

[assembly: ApplicationName("PDFNoQueNewApp")]
[assembly: ApplicationActivation(ActivationOption.Server)]
[assembly: ApplicationAccessControl(Value = false,
Authentication = AuthenticationOption.None)]

namespace PDFNoQueNew
{
[Guid("050355EC-83C9-4723-9E2D-AAAAD3CA3FFF")]
public class PDFConvNoQueNew: ServicedComponent, IPDFPrintTestNew.IPDFPrint
{
public string PDFPrintMethod()
{
return ("ok");
}
}
}

3. Client test //add a reference to IPDFPrintTestNew
using System;
using System.Runtime.InteropServices;
using System.EnterpriseServices;


namespace PDFNoQueNewClientTest
{
class Class1
{
[ComImport, Guid("050355EC-83C9-4723-9E2D-AAAAD3CA3FFF")]
class NewPDFNoQueNew
{
}
[STAThread]
static void Main(string[] args)
{
NewPDFNoQueNew myPDF = new NewPDFNoQueNew();
IPDFPrintTestNew.IPDFPrint iPDF = (IPDFPrintTestNew.IPDFPrint)myPDF;
string result = iPDF.PDFPrintMethod();
return;

}
}
}

Questionperformence ? Pin
drick_6719-Aug-05 12:02
drick_6719-Aug-05 12:02 
AnswerRe: performence ? Pin
Matt Gerrans19-Aug-05 14:22
Matt Gerrans19-Aug-05 14:22 
AnswerRe: performence ? Pin
Guffa19-Aug-05 22:25
Guffa19-Aug-05 22:25 
GeneralDrawing Numbers on a WinForm: Basics Pin
...---...19-Aug-05 11:28
...---...19-Aug-05 11:28 
GeneralXML Database Pin
surfman1919-Aug-05 11:02
surfman1919-Aug-05 11:02 
GeneralRe: XML Database Pin
rudy.net19-Aug-05 13:52
rudy.net19-Aug-05 13:52 
GeneralLock question Pin
Steve Messer19-Aug-05 10:59
Steve Messer19-Aug-05 10:59 
GeneralRe: Lock question Pin
Guffa19-Aug-05 22:19
Guffa19-Aug-05 22:19 
GeneralRe: Lock question Pin
Steve Messer20-Aug-05 4:58
Steve Messer20-Aug-05 4:58 
GeneralRe: Lock question Pin
Guffa20-Aug-05 13:31
Guffa20-Aug-05 13:31 
GeneralRe: Lock question Pin
Steve Messer20-Aug-05 13:48
Steve Messer20-Aug-05 13:48 
GeneralRe: Lock question Pin
Guffa21-Aug-05 1:23
Guffa21-Aug-05 1:23 
GeneralRe: Lock question Pin
Steve Messer21-Aug-05 2:43
Steve Messer21-Aug-05 2:43 
GeneralGDI+ Paths and Regions Pin
mpastchenko19-Aug-05 8:39
mpastchenko19-Aug-05 8:39 
GeneralRe: GDI+ Paths and Regions Pin
mpastchenko19-Aug-05 11:37
mpastchenko19-Aug-05 11:37 
GeneralLabel Graph Tick Mark Axis, Mistake Pin
...---...19-Aug-05 7:09
...---...19-Aug-05 7:09 
GeneralRe: Label Graph Tick Mark Axis, Mistake Pin
...---...19-Aug-05 7:13
...---...19-Aug-05 7:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.