|
The HResult returned was 0x80070005.
I also tried,
object retval = Marshal.GetActiveObject("MyNamespace.MyClass"); and the exception that got thrown was...
System.Runtime.InteropServices.COMException was unhandled
Message="Operation unavailable (Exception from HRESULT: 0x800401E3 (MK_E_UNAVAILABLE))"
Source="mscorlib"
ErrorCode=-2147221021
;
The return value for the call to register the object in the ROT was 65536. This value seems to be the same everytime.
int register = rot.Register((ROTFLAGS_REGISTRATIONKEEPSALIVE | ROTFLAGS_ALLOWANYCLIENT), pObj, moniker);
|
|
|
|
|
lee23 wrote: The return value for the call to register the object in the ROT was 65536. This value seems to be the same everytime.
I think you'll find this is a token that identifies the running-object you've registered, which you pass into the IRunningObjectTable::Revoke method.
If your program registered the object and exited without revoking, then that could lead to the situation you describe, where IROTVIEW shows your object, but you can't reference it.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
hi,
how can i write any text,value on bars using mschart
thanks
|
|
|
|
|
I explored this control so long ago, I'd forgotton what the object model was like, so, I GOOGLED, and found this over at MSDN: MSChart Control Objects Listed Alphabetically[^]. Unfortunately, the code is Visual Basic, but, it gives you the specifics of the object model hierarchy.
You could use Dumpbin to determine the exported function prototype, and the rest would be fairly simple.
|
|
|
|
|
You can see on Adv. Win32 group
where a complete code in native Win32 had been posted (a few weeks ago)
|
|
|
|
|
I have a Windows Serviced written in .Net which creates an instance of a comvisible class on start up of the service. In the constructor of this class, it tries to register this instance on the running object table with the ROTFLAGS_ALLOWANYCLIENT flag.
I read, in order for a ROT registration with ROTFLAGS_ALLOWANYCLIENT to succeed, the following registry entries must be present:
[HKEY_CLASSES_ROOT\AppID\app.exe] "AppID"="{APPIDGUID}"
What I like to ask is who creates this appid guid or where can I find it in the project?
I am getting the below error and cannot understand why. I tried installing the service as account type LocalSystem, LocalService & User and still got the same result...
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)
I am unclear as to what other registry entries I need to make to get this to work.
Any help is appreciated.
|
|
|
|
|
lee23 wrote: What I like to ask is who creates this appid guid or where can I find it in the project?
This blog post[^] looks informative.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
I have seen this article and have tried getting dcomcnfg.exe to create it. I loaded it up but didn't see any prompt asking if I want to create an appid for my exe. I also didn't see it listed there after it's finished loading up.
|
|
|
|
|
This Google groups thread[^] may be informative.
In addition - I created an ATL service project, just to see what ATL would have for that - it contained the definition of the AppID, which it would put in the registry as necessary - that kind of says your executable needs to do that.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Thanks Stuart for your responses. I have also seen this article and have followed it and created a MyRegisterObject function and still isn't clear to me this AppID guid I need.
I have created my windows service in .Net and therefore not sure where to find this appid. I tried entering the assembly guid and the object's (the one I want to register on the ROT) guid for the {APPIDGUID} value and that didn't help.
[HKEY_CLASSES_ROOT\AppID\app.exe] "AppID"="{APPIDGUID}"
Just to clarify, I have a Windows Service project written in .Net, it also contains a class made to be comvisible. On start up of the service, I create an instance of this class. In the constructor of this class, I try to register this instance on the running object table with the ROTFLAGS_ALLOWANYCLIENT flag.
|
|
|
|
|
lee23 wrote: Just to clarify, I have a Windows Service project written in .Net, it also contains a class made to be comvisible. On start up of the service, I create an instance of this class. In the constructor of this class, I try to register this instance on the running object table with the ROTFLAGS_ALLOWANYCLIENT flag.
Yeah, I understand all that - I'm just finding it difficult to work out what the implications of that are when mixed in with services, user permissions, the running object table etc
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
This seems to work...
I picked a new guid (via guidgen.exe) and then followed this article in creating the necessary windows registry and that seems to registered the object in the ROT.
http://lastinch.blogspot.com/2009/05/proper-basic-appid-plus-service.html
modified on Thursday, May 21, 2009 3:42 AM
|
|
|
|
|
Nice one - thanks for feeding that back!
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Hi,
I am facing a problem with compilation order of .idl files in Visual Studio 2005.
My project contain 2 .idl files. When I build the project, sometimes the compilation sequence of these files vary.
I have observed that, when I build application 1st time on a clean machine, order of compiling .idl is different. and after that, on every rebuild the files complier compiles in alphabetical order of filenames.
Which factor decides the build sequence of files in visual studio 2005?
Can we forcefully define the order of building the .idl files? (i.e. specific file must be compiled before/after another)
Please help...
modified on Tuesday, May 19, 2009 2:20 AM
|
|
|
|
|
Easiest thing I can think of (and it's reasonably easy, I guess) would be to rename the file and use a custom build rule (which would just be the MIDL command-line - make sure you copy that before you rename the file). You then specify outputs so that VS knows what it builds, and you can specify additional dependencies, i.e. the things which need to have been built from your other MIDL file.
|
|
|
|
|
Hi,
I developed a webservice with a web method integrating with Microsoft office project and it reads all the tasks and resources inside it with the help of the DCOM 'Microsfot project basic'. It is working fine when i hosted it in IIS in XP but having the issue while hosting in IIS windows server 2003. I am getting the following error when i open the file and it get resolved after giving the enough permission in DCOM security and restart the server but it was avail only for the first time, when i tested it for the second time that shows me the same error.
Given below the error, Kinldy help me out in this.
System.Runtime.InteropServices.COMException: Call was rejected by callee. (Exception from HRESULT: 0x80010001 (RPC_E_CALL_REJECTED))
at System.RuntimeType.ForwardCallToInvokeMember(String memberName, BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData& msgData)
at Microsoft.Office.Interop.MSProject.ApplicationClass.Quit(PjSaveType SaveChanges)
at Service.CheckProject(String projectID) in C:\vcclient\App_Code\Service.vb:line 41 --
----------
Private gobjProjectInstance1 As Microsoft.Office.Interop.MSProject.Application gobjProjectInstance1 = New Microsoft.Office.Interop.MSProject.ApplicationgobjProjectInstance.FileOpen(FileName) ---
|
|
|
|
|
i use an activex in my source code, but i worry about replacing it. i thought use 2 activex witch one of them check the other but i'm not sure this way is the best even i'm not sure it has a differ!
please help me and tell benefits ans its benefits and galls.
thx
|
|
|
|
|
You should clarify the question,...I found it confusing.
What kind of application is the source code for? Is this a website? Why replace the ActiveX control? And what is the security issue? Is this a networking security issue? You should be more specific, as none of us here know what context you are operating under.
|
|
|
|
|
sorry, you're right.
we produce a hardware lock which use an activex for checking, setting & getting information on lock.
now i'm searching for a way which make replacing activex more difficult.
thx
|
|
|
|
|
...have you considered, LIQUID NITROGEN?
|
|
|
|
|
hi,
i am writting UT code to test my module class it uses some com dll which is having dependencies with some hardware thats why its not registered in my local system. now i want to use interface having in that dll for that i am creating my own stub for that interface. now the problem is i am not able to query my interface CLSID of my interface is not in registry so please any one let me know what i will do to register CLSID of that interface?
also if is there any other way to implement please let me know
thanks,
ashish chandrakar
|
|
|
|
|
|
You cannot use a COM component unless it is registered on the system.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
Google for "Registration-Free COM" you will find lots of information, mostly by microsoft. The "trick" is done by using manifests and activation contexts.
|
|
|
|
|
I’m well aware of the Microsoft support base article stating that it’s not supported to automate office products UI less. It seems that Windows Server 2008 and Excel 2007 enforce the given statement.
I’m running the following code in a NT Service (Local System account) OnStart method. All it does is Excel automation the way it’s working when you run the same code in a Console Application.
The provided code has two parts. The first part launches Excel, creates a new work book and saves it to the given filename. The second part launches a new instance of Excel and opens the given file. The open operation ends in this exception:
Service cannot be started. System.Runtime.InteropServices.COMException (0x800A03EC): Microsoft Office Excel cannot access the file 'c:\temp\test.xls'. There are several possible reasons:
• The file name or path does not exist.
• The file is being used by another program.
• The workbook you are trying to save has the same name as a currently open workbook.
Why was the automated excel able to launch and write files to disk but fails when it’s asked “just “ to open an existing file?
System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("en-US");
Microsoft.Office.Interop.Excel.ApplicationClass excel = new Microsoft.Office.Interop.Excel.ApplicationClass();
excel.UserLibraryPath, excel.Interactive));
string filename = "c:\\temp\\test.xls";
if(System.IO.File.Exists(filename)) System.IO.File.Delete(filename);
excel.Workbooks.Add(System.Reflection.Missing.Value);
excel.Save(filename);
excel.Quit();
excel = null;
excel = new Microsoft.Office.Interop.Excel.ApplicationClass();
try
{
Microsoft.Office.Interop.Excel.Workbook book = excel.Workbooks.Open(filename,
System.Reflection.Missing.Value,
System.Reflection.Missing.Value,
System.Reflection.Missing.Value,
System.Reflection.Missing.Value,
System.Reflection.Missing.Value,
true,
System.Reflection.Missing.Value,
System.Reflection.Missing.Value,
false,
false,
System.Reflection.Missing.Value,
false,
System.Reflection.Missing.Value,
System.Reflection.Missing.Value);
book.Close(false, System.Reflection.Missing.Value, System.Reflection.Missing.Value);
book = null;
}
finally
{
excel.Quit();
excel = null;
}
GC.Collect();
modified on Thursday, May 14, 2009 4:32 PM
|
|
|
|