Ole Error 80131509
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers hresult 80131509 or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question hresult 0x80131509 x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them;
0x80131509 Sccm
it only takes a minute: Sign up C++ calling C# COM interop error: HRESULT 0x80131509 up vote 1 down vote favorite I create a C# COM interop for c++ to invoke. I have registered the dll and tlb file by
0x80131509 Ssis
regasm. everything goes well till one day i changed code of C# part (i didn't change the definition of interface, just implementation changed). one interface in COM returns an error 0x80131509. the strange thing is, it is only happened in some computers (my develop PC is works well so i can't debug this problem). I'm not really clear on how the C# COM worked with C++, after i registered them, i just know they create key value in window registry.(like sccm 2012 r2 0x80131509 what regasm /regfile generated). how c++ knows where the COM dll is(search path environment variables)? and what the use of tlb file in run time? any suggestion? c# com interop share|improve this question asked Feb 1 '12 at 9:34 ArdenZhao 58112 add a comment| 2 Answers 2 active oldest votes up vote 0 down vote accepted I think that your problem is related to the registry... You should try to unregister and register (using regasm) your dll in the computers that are having this problem. If that doesn't work unregister the dll in those computers, than use regedit to search and delete any missing registry keys that refer to it, after that register your dll again. You could also use one of those registry cleaner programs after deleting the missing keys to guarantee that you didn't miss anything. Remember that you should allways register a dll in the directory that it will be used by your application and this should happen only once. If you need to unregister a dll, then you should allways do it in the same directory that you used for the registration. In other words, once a dll is registered do not move it. Note: if your dll is not on the same path as your C++ application it should be in a directory that is referenced in the PATH environment variable. share|improve this answer answered Feb 1 '12 at 11:16 Komyg 64
a COM application -- something I don't have an every day need for. Like a lot of things, it seems simple enough on the surface, but the devil is in the details. This rather lengthy post illustrates a typical forensic investigation for this kind of thing, leading from obstacle to obstacle, through to the final solution. Its value is not only to describe how specifically to expose a .NET class to a COM client, http://stackoverflow.com/questions/9093531/c-calling-c-sharp-com-interop-error-hresult-0x80131509 but how to figure such problems out for yourself. First, according to one school of thought, you add a couple of attributes to the class: [ClassInterface(ClassInterfaceType.AutoDual)]
[ProgId("myStuff.Common.Utility")] Actually even these aren't really mandatory, because if I understand correctly, the default interface type is AutoDual anyway, and the default ProgId is the fully qualified name of the class http://bobondevelopment.com/2007/09/11/exposing-a-net-20-class-via-com-a-case-study/ you're decorating. If those defaults are acceptable, you don't need the attributes -- but I figure this way there is no question what I want, and if someone changes the defaults or the configuration of the project later, it won't break things. The common wisdom now is to go to the project properties, under the Build tab, and check "Register for COM interop", then build the project and everything happens automagically. (You should also click the Assembly Information button on the Application tab and check "Make assembly COM-Visible" as well). That is great for your development machine, but I needed to deploy this on a server where Visual Studio isn't available. Besides, my COM client and its interactive test environment for accessing this Interop DLL only exists on that server. This is one of those cases where the magic is kind of useless and you have to figure out what's going on under the hood so you can do the same thing on the target machine. So, the next layer of the onion: a
question and get tips & solutions from a community of 418,606 IT Pros & Developers. It's quick & easy. error '80131509' P: https://bytes.com/topic/asp-classic/answers/101945-error-80131509-a n/a Jason Rowland I created a .NET assembly and made it accessable as a COM object. When I tried to instantiate it in an ASP page, I got error '80131509'. If I create the COM object in a simple HTML page it works fine. I am using ASP, not ASP.NET. Searching for the number on google gives no help whatsoever. This is ole error the ASP that I am using: <%@ Language=VBScript %> <% Option Explicit %> <% Dim WebFarmSession: WebFarmSession = CreateObject("ComTest.WebFarmSession") %> Jul 21 '05 #1 Post Reply Share this Question 4 Replies P: n/a Aaron [SQL Server MVP] How are you "creating the COM object in a simple HTML page"? Is it a control that the user will see? Otherwise, what purpose could it ole error 80131509 serve in HTML? -- http://www.aspfaq.com/ (Reverse address to reply.) "Jason Rowland"