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

.NET (Core and Framework)

 
QuestionDelete Record from Data Grid Pin
saif_saifi12-May-09 22:50
professionalsaif_saifi12-May-09 22:50 
Questionhow to paint the MainMenu Pin
coderormnger12-May-09 22:21
coderormnger12-May-09 22:21 
AnswerRe: how to paint the MainMenu Pin
Pete O'Hanlon12-May-09 23:08
subeditorPete O'Hanlon12-May-09 23:08 
QuestionHow to get machine certificate and user license. Pin
deadlyabbas12-May-09 22:01
deadlyabbas12-May-09 22:01 
Question.Net Remoting with COM client Pin
lee2312-May-09 20:43
lee2312-May-09 20:43 
Questionproblem with richedit control [modified] Pin
ramaluciano12-May-09 19:52
ramaluciano12-May-09 19:52 
QuestionIRunningObjectTable.Register method Pin
lee2312-May-09 19:23
lee2312-May-09 19:23 
AnswerRe: IRunningObjectTable.Register method Pin
lee2312-May-09 20:06
lee2312-May-09 20: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 21:25
lee2313-May-09 21:25 
QuestionSeeking advice for storing data in memory [modified] Pin
glumlord12-May-09 8:46
glumlord12-May-09 8:46 
AnswerRe: Seeking advice for storing data in memory Pin
glumlord12-May-09 8:59
glumlord12-May-09 8:59 
AnswerRe: Seeking advice for storing data in memory Pin
Ian McCaul12-May-09 9:32
Ian McCaul12-May-09 9:32 
GeneralRe: Seeking advice for storing data in memory Pin
glumlord12-May-09 9:37
glumlord12-May-09 9:37 
GeneralRe: Seeking advice for storing data in memory Pin
Ian McCaul12-May-09 9:43
Ian McCaul12-May-09 9:43 
GeneralRe: Seeking advice for storing data in memory Pin
glumlord12-May-09 10:26
glumlord12-May-09 10:26 
GeneralRe: Seeking advice for storing data in memory Pin
jarbo3a12-May-09 21:13
jarbo3a12-May-09 21:13 
GeneralRe: Seeking advice for storing data in memory Pin
glumlord13-May-09 8:35
glumlord13-May-09 8:35 
AnswerRe: Seeking advice for storing data in memory Pin
Dave Kreskowiak12-May-09 9:43
mveDave Kreskowiak12-May-09 9:43 
GeneralRe: Seeking advice for storing data in memory Pin
glumlord12-May-09 10:24
glumlord12-May-09 10:24 
GeneralRe: Seeking advice for storing data in memory Pin
Dave Kreskowiak12-May-09 12:01
mveDave Kreskowiak12-May-09 12:01 
GeneralRe: Seeking advice for storing data in memory Pin
Luc Pattyn12-May-09 10:45
sitebuilderLuc Pattyn12-May-09 10:45 
GeneralRe: Seeking advice for storing data in memory Pin
Dave Kreskowiak12-May-09 11:57
mveDave Kreskowiak12-May-09 11:57 
GeneralRe: Seeking advice for storing data in memory Pin
Luc Pattyn12-May-09 14:54
sitebuilderLuc Pattyn12-May-09 14:54 
GeneralRe: Seeking advice for storing data in memory Pin
Dave Kreskowiak12-May-09 17:12
mveDave Kreskowiak12-May-09 17:12 
GeneralRe: Seeking advice for storing data in memory Pin
glumlord13-May-09 8:30
glumlord13-May-09 8: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.