all groups > dotnet component services > october 2003 >
You're in the

dotnet component services

group:

COULD INVOKE A COM+ (CCW - .NET) FROM A CLIENT WITHOUT FRAMEWORK .NET INSTALLET


COULD INVOKE A COM+ (CCW - .NET) FROM A CLIENT WITHOUT FRAMEWORK .NET INSTALLET scollpov scollpov
10/27/2003 3:58:39 AM
dotnet component services:
This is my COM+'s code:

using System;
using System.Text;
using System.IO;
using System.Reflection;
using System.EnterpriseServices;
using System.Runtime.InteropServices;

namespace Sgm.Interface
{
public interface ISampleSgm2
{
string Sistema {set;}
void Write();
}

[ProgIdAttribute("SampleSgm2")]
public class SampleSgm2 : ServicedComponent,
ISampleSgm2
{
public string _sistema = "";

public SampleSgm2(){}

public string Sistema
{
set {_sistema=value;}
get {return _sistema;}
}

public void Write()
{
String reg="";
FileStream fs = new
FileStream
("c:\\temp\\SampleSgm.log",
FileMode.Append);

DateTime dt = DateTime.Now;

reg=_sistema + " "+ dt.ToShortDateString()+"
"+dt.ToShortTimeString()+"\n";

byte[] text = ASCIIEncoding.ASCII.GetBytes(reg);

fs.Write(text, 0,
text.Length);

fs.Close();

}
}
}

I follow the next steps:

1.- sn -k XXXXXX.snk
2.- compile (VS-2002)
3.- regasm /tlb:XXXXX.tlb /codebase XXXXXX.dll
4.- gacutil -i XXXXXX.dll

and next ..

I create manually a application in Serviced Components (Server's
application)and I import this registered COM.

Finally I generated a proxy for the client.

Install de proxy in the client.

And I try this code in client, VB for application in excel

Dim obj As Object

Set obj=CreateObject("SampleSgm2")

... and I recive an exception ('242'Object required or '70'Not Allowed)
it depends of the proxy's configuration.

If someone have an idea that can helps me, I'll be interested to read
it.

Thanks.







*** Sent via Developersdex http://www.developersdex.com ***
Re: COULD INVOKE A COM+ (CCW - .NET) FROM A CLIENT WITHOUT FRAMEWORK .NET INSTALLET Slava Gurevich
10/27/2003 9:25:37 AM
Disable COM+ application security or add the calling account to the
COM+ role and enable the role for your component. It's best to use
static registration with regsvcs

On Mon, 27 Oct 2003 03:58:39 -0800, scollpov scollpov
[quoted text, click to view]
AddThis Social Bookmark Button