Click here to Skip to main content
15,914,594 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
QuestionDelete Record from Data Grid Pin
saif_saifi12-May-09 21:50
professionalsaif_saifi12-May-09 21:50 
Questionhow to paint the MainMenu Pin
coderormnger12-May-09 21:21
coderormnger12-May-09 21:21 
AnswerRe: how to paint the MainMenu Pin
Pete O'Hanlon12-May-09 22:08
mvePete O'Hanlon12-May-09 22:08 
QuestionHow to get machine certificate and user license. Pin
deadlyabbas12-May-09 21:01
deadlyabbas12-May-09 21:01 
Question.Net Remoting with COM client Pin
lee2312-May-09 19:43
lee2312-May-09 19:43 
Questionproblem with richedit control [modified] Pin
ramaluciano12-May-09 18:52
ramaluciano12-May-09 18:52 
QuestionIRunningObjectTable.Register method Pin
lee2312-May-09 18:23
lee2312-May-09 18:23 
AnswerRe: IRunningObjectTable.Register method Pin
lee2312-May-09 19:06
lee2312-May-09 19:06 
Sorry, I just saw the "Community Content" bit at the end of the .net article saying the return value is the dwRegister value for the Revoke method.

I have a windows service which instantiates a class and would like to register this object in the ROT. I have found that testing this registry to the ROT works fine when it's done in a standalone exe but not within a windows service. I have read a case for why it doesn't work when in the Windows Service, that there is this flag ROTFLAGS_ALLOWANYCLIENT which you can pass to the Register method to allow any client to see it. Have I understood that the .net's IRunningObjectTable is the one that accepts this flag whereas the Ole32 one does not?
private int myRegisterActiveObject(object pUnk)
{
    string sDelim = "!";
    string sProgID = "MyNamespace.ClassName";

    IBindCtx bc;
    Ole32.CreateBindCtx(0, out bc);

    IMoniker moniker;
    Ole32.CreateItemMoniker(sDelim,sProgID, out moniker);

    IRunningObjectTable rot;
    bc.GetRunningObjectTable(out rot);

    int register = rot.Register((ROTFLAGS_REGISTRATIONKEEPSALIVE | ROTFLAGS_ALLOWANYCLIENT), pUnk, moniker);

    return register;
}


I get in the EventLog, "Service cannot be started. System.Runtime.InteropServices.COMException (0x80004015): The class is configured to run as a security id different from the caller (Exception from HRESULT: 0x80004015)..."

The Service is run under account type LocalSystem.


GeneralRe: IRunningObjectTable.Register method Pin
lee2313-May-09 20:25
lee2313-May-09 20:25 
QuestionSeeking advice for storing data in memory [modified] Pin
glumlord12-May-09 7:46
glumlord12-May-09 7:46 
AnswerRe: Seeking advice for storing data in memory Pin
glumlord12-May-09 7:59
glumlord12-May-09 7:59 
AnswerRe: Seeking advice for storing data in memory Pin
Ian McCaul12-May-09 8:32
Ian McCaul12-May-09 8:32 
GeneralRe: Seeking advice for storing data in memory Pin
glumlord12-May-09 8:37
glumlord12-May-09 8:37 
GeneralRe: Seeking advice for storing data in memory Pin
Ian McCaul12-May-09 8:43
Ian McCaul12-May-09 8:43 
GeneralRe: Seeking advice for storing data in memory Pin
glumlord12-May-09 9:26
glumlord12-May-09 9:26 
GeneralRe: Seeking advice for storing data in memory Pin
jarbo3a12-May-09 20:13
jarbo3a12-May-09 20:13 
GeneralRe: Seeking advice for storing data in memory Pin
glumlord13-May-09 7:35
glumlord13-May-09 7:35 
AnswerRe: Seeking advice for storing data in memory Pin
Dave Kreskowiak12-May-09 8:43
mveDave Kreskowiak12-May-09 8:43 
GeneralRe: Seeking advice for storing data in memory Pin
glumlord12-May-09 9:24
glumlord12-May-09 9:24 
GeneralRe: Seeking advice for storing data in memory Pin
Dave Kreskowiak12-May-09 11:01
mveDave Kreskowiak12-May-09 11:01 
GeneralRe: Seeking advice for storing data in memory Pin
Luc Pattyn12-May-09 9:45
sitebuilderLuc Pattyn12-May-09 9:45 
GeneralRe: Seeking advice for storing data in memory Pin
Dave Kreskowiak12-May-09 10:57
mveDave Kreskowiak12-May-09 10:57 
GeneralRe: Seeking advice for storing data in memory Pin
Luc Pattyn12-May-09 13:54
sitebuilderLuc Pattyn12-May-09 13:54 
GeneralRe: Seeking advice for storing data in memory Pin
Dave Kreskowiak12-May-09 16:12
mveDave Kreskowiak12-May-09 16:12 
GeneralRe: Seeking advice for storing data in memory Pin
glumlord13-May-09 7:30
glumlord13-May-09 7:30 

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.