com

COM multi-threading support

回眸只為那壹抹淺笑 提交于 2019-12-04 11:01:12
Working with COM for the first time I have got this COM dll, say ABCServer.dll, i created a RCW and added reference to it in my project. Now my application creates several threads and each thread creates certain classes from COM dll and works with them. But then each thread is waiting while other thread is working with certain class from COM dll. The whole purpose of modifying my application was enabling multi-threading on it. Now when multithreading is happening at my side, the COM causing it to be sequential. Although each thread is creating new instances, why are they waiting for others to

How does CreateStdDispatch know what method to invoke?

北城以北 提交于 2019-12-04 10:57:35
i'm faced with implementing an IDispatch interface. There are four methods, and fortunately 3 of them are easy: function TIEEventsSink.GetTypeInfoCount(...): HResult; { Result := E_NOTIMPL; } function TIEEventsSink.GetTypeInfo(...): HResult; { Result := E_NOTIMPL; } function TIEEventsSink.GetIDsOfNames(...): HResult; { Result := E_NOTIMPL; } It's the last method, Invoke that is difficult. Here i am faced with having to actually case the DispID , and call my appropriate method; unmarhsalling parameters from a variant array. function Invoke( dispIdMember: DISPID; riid: REFIID; lcid: LCID; wFlags

Class not registered error for Instantiation of C# object via COM from VC++

依然范特西╮ 提交于 2019-12-04 10:41:40
问题 In a VC++ project, I am trying to create an instance (via COM) of a C# class contained within a C# project. Facts Both the C# and C++ projects are compiled using .NET 4.0 The C# .dll is being registered using regasm /codebase "CSharpProjectName.dll" ", and windows command prompt reports, "Types registered successfully." In the c++ project, I attempt to create an instance of a class in the C# project, but I get an HRESULT of 0x80040154 - class not registered Here is an example of my attempt to

How to use Office from Visual Studio C#?

时间秒杀一切 提交于 2019-12-04 10:39:20
问题 The technique for adding a reference to the COM interop of Office in Visual Studio is to go to: References Add Reference Select the COM tab Select Microsoft Office 11.0 Object Library And magically named reference appears: Microsoft.Office.Core The Project.csproj file shows the details of the reference: <COMReference Include="Microsoft.Office.Core"> <Guid>{2DF8D04C-5BFA-101B-BDE5-00AA0044DE52}</Guid> <VersionMajor>2</VersionMajor> <VersionMinor>3</VersionMinor> <Lcid>0</Lcid> <WrapperTool

Server.MapPath in a COM Component

北城以北 提交于 2019-12-04 10:28:01
I'm rewriting an old VBSCript WSC component into a nicer C# COM Component. For a horrid reason the old component in one place is passed the Server Context, IServer by using Set objCurr = CreateObject("MTxAS.AppServer.1") Set objCurrObjCont = objCurr.GetObjectContext() Set component.servercontext = objCurrObjCont("Server") this is then used to do a standard Server.MapPath("/somelocation") However I'm stumped upon what to do in the .Net COM Component, System.Web.HttpContext.Current.MapPath() doesn't work as expected as there is no Web Context. I tried passing the context from Classic ASP into

COM interface wrappers in PowerShell?

不羁的心 提交于 2019-12-04 10:12:54
I have the following code in C# which I try to port to PowerShell. But I don't know how to port this cast: ((_ISkypeEvents_Event)skype).CallStatus += CallStatusHandler; If I just type [Skype4COM.ISkypeEvents_Event] in my PowerShell console I get: Unable to find type [Skype4COM.ISkypeEvents_Event]: make sure that the assembly containing this type is loaded. However, I can get all the members of the $skype object: $skype = New-Object -ComObject Skype4COM.Skype The following line doesn't work: $skypeevent = [Skype4COM._ISkypeEvents_Event]$skype If I try to call the method directly on the $skype

Building a COM object vtable in x86 assembly

与世无争的帅哥 提交于 2019-12-04 10:11:02
I am building a COM object in x86 assembly using NASM. I understand COM quite well and I understand x86 assembly pretty well, but getting the two to mesh is getting me hung up... (by the way, if you're thinking of attempting to dissuade me from using x86 assembly, please refrain, I have very particular reasons why I'm building this in x86 assembly!) I am trying to build a vtable to use in my COM object, but I keep getting strange pointers, rather than actual pointers to my functions. (I'm thinking that I'm getting relative offsets or that NASM is embedding temporary values in there and they're

what is the equivalent of COM in Mac OS?

橙三吉。 提交于 2019-12-04 10:08:46
I'm new to the world of Mac programming. Can someone please tell me what the equivalent of reusable COM components are in Mac and some links to a good resource to get started (in creating reusable COM-like components and referring those components from a calling app)? Thank you. Clarification: - I wish to know if there exist a similar technology, which is supported at OS level. - I asked the question because I want to port some of my apps (which make use of existing type libraries from Windows as well as those that I make) to Mac. - Is it possible that I create wrapper classes for my existing

VB6 ActiveX exe - what is the proper registration sequence?

一个人想着一个人 提交于 2019-12-04 10:07:54
I have recently updated a Visual Basic 6 application that is an ActiveX exe, running on Windows XP. I have a couple of testers for this application who have received a copy of the exe and are attempting to run it. However, they are getting an error message "Unexpected error;quitting" when trying to do so. A key difference between their testing and my testing is that on the machines I tested on, I have admin rights and was able to register the application using the appname.exe /regserver command line. Reading the details at MS Support about file registration appears unclear: Visual Basic

scriptable objects in internet explorer content plugin

丶灬走出姿态 提交于 2019-12-04 09:59:00
问题 While there are many guides for Browser Helper Objects, i have a hard time finding resources on how to implement scriptable objects (i.e. besides the main control) for content plugins (i.e. embedded in website). To avoid misunderstandings: the question is about scriptable objects that a plugin object may return to the scripts in a website, e.g. from a method call. While i guess scriptability in general for these probably works via the usual IDispatch , i don't see how events are to be handled