com

How do I install both 32-bit and 64-bit versions of a COM DLL and “auto-select”?

天涯浪子 提交于 2019-12-03 20:05:22
问题 We've got a DLL (a COM server) that will compile fine in 32-bit and 64-bit, but the DLL uses the same CLSID and AppID for the 32-bit version and the 64-bit version. Is this OK or does this have to change? I'm asking this because apparently on a 64-bit machine, we can't register the 32-bit version and the 64-bit version together. It would be nice if 32-bit client applications could automatically use the 32-bit DLL, and 64-bit client applications could automatically use the 64-bit DLL. On a

COM object methods are not executed on the thread that CoInitialize-d and created the object

浪子不回头ぞ 提交于 2019-12-03 19:44:08
问题 I am developing an UI application that creates a COM object along the way. The problem is, I want to "move" this COM object entirely on a different thread. What I do is this: create the new thread I want to move the object into (with CreateThread API) after entering this thread, I'm calling PeekMessage to setup a message queue for it calling CoInitialize, CoCreateInstance to create the COM object, QueryInterface to get the interface I want finally I call a method on the interface that

C# - writing a COM server - Properties mapped to methods

試著忘記壹切 提交于 2019-12-03 17:34:06
We are trying to replace a COM server originally written for a VB6 application We have no access to source code. For some reason, the VB6 app can call our constructor, but then it gets: System Error &H80004002. No such interface supported. I assume when it tries to get the interface with QueryInterface. We have our assembly properly sent through regasm /tlb and gacutil, but I then noticed something strange. I opened the .tlb file regasm generated for our assembly, and noticed all the properties on my interface show up as methods. Is this something the .Net tools are doing? And would this cause

How to do a simple mail merge in OpenOffice

大憨熊 提交于 2019-12-03 17:31:07
I need to do a simple mail merge in OpenOffice using C++, VBScript, VB.Net or C# via OLE or native API. Are there any good examples available? I haven't come up with a solution I'm really happy with but here are some notes: Q. What is the OO API for mail merge? A. http://api.openoffice.org/docs/common/ref/com/sun/star/text/MailMerge.html Q. What support groups? A. http://user.services.openoffice.org/en/forum/viewforum.php?f=20 Q. Sample code? A. http://user.services.openoffice.org/en/forum/viewtopic.php?f=20&t=946&p=3778&hilit=mail+merge#p3778 http://user.services.openoffice.org/en/forum

OneNote 2013 Add-in won't load. How to debug?

好久不见. 提交于 2019-12-03 17:14:32
I'm following the excellent tutorial by Malte Ahrens on how to create a OneNote add-in. Initially I followed it step by step, making a few changes (just renaming the class, and using my own name and GUID in the assembly) info. As I'm using VS2012 and am not yet ready to hand-roll a WiX installer I manually copied over the built dll to the correct place and also created a registry file to make the requisite entries. I confirmed that they were all there, loaded up OneNote but no add-in, going to "mange COM addins" section I saw the following error: Load Behavior: Not loaded. A runtime error

Getting a specific instance of COM object in VB.Net

六月ゝ 毕业季﹏ 提交于 2019-12-03 17:09:34
I am writing a Windows Form application in .Net to list all running instances of a third-party CAD/CAM software (in this case CATIA) and let user to choose one of them to perform couple of automated tasks. For performing automated tasks, I need to get the specific instance of COM objects - compared to Getobject() which gives me a non-specific COM instance. Is there a way to get a specific COM instance using window handle or any other methods? UPDATE: As Raymond said there is no single solution for all COM objects; however I managed to get CATIA COM objects using following code (Which uses ROT

Using tlbexp.exe on a COM dll

放肆的年华 提交于 2019-12-03 15:59:40
I am trying to set up communication between Centura and a COM .dll. (Downloaded from http://download.resip.fr for a database import) Centura requires a .tlb file to be able to communicate to this component. Normally I would use regasm /tlb to generate the .tlb but seeing as it is a COM .dll this is not possible. I found that I could use tlbexp for .NET dll's: http://msdn.microsoft.com/en-us/library/hfzzah2c(v=vs.80).aspx I tried this out, knowing it would probably fail (as I have COM .dll). I received this error: TlbExp : error TX0000 : Could not load file or assembly 'file:///C:\Windows

Subscribe to C# .net Event in VB6

こ雲淡風輕ζ 提交于 2019-12-03 15:58:15
I need to get be able to handle a .net event in VB6. So far i have it set up by making me c# class COM visible. My VB6 object can call methods on it fine but now i need some way to communicate from .net to VB. If i add an event to my c# class the .net wrapper seems to add an add_EventName and remove_EventName which i assume this is to subscribe and unsubscribe to the event. But i'm still a novice when it comes to VB6 and come so i'm not really sure how to use it. The add_EventName seems to take an EventNameEventHadler but what do i give it? i tried the sub but this gives me a runtime error.

How can I return both an error string and error code to VB6 from an ATL activex control?

这一生的挚爱 提交于 2019-12-03 15:31:00
I'm trying to return a detailed error to VB6 using CComCoClass::Error , but it seems I can only return an error code /or/ a message - but not both. return Error(_T("Not connected"), __uuidof(IMyInterface), HRESULT_FROM_WIN32(ERROR_CONNECTION_INVALID)); results in a generic "Method 'Request' of object 'IMyInterface' failed" error message in Err.Description on the VB6 side (but ERROR_CONNECTION_INVALID in Err.Number), while return Error(_T("Not connected")); results in the appropriate error message, but a generic error code in Err.Number. How can I get the best of both worlds? Steffen Opel You

How to properly use a hardware accelerated Media Foundation Source Reader to decode a video?

萝らか妹 提交于 2019-12-03 15:17:31
I'm in the process of writing a hardware accelerated h264 decoder using Media Foundation's Source Reader, but have encountered a problem. I followed this tutorial and supported myself with Windows SDK Media Foundation samples. My app seems to work fine when hardware acceleration is turned off, but it doesn't provide the performance I need. When I turn the acceleration on by passing a IMFDXGIDeviceManager to IMFAttributes used to create the reader, things get complicated. If I create the ID3D11Device using a D3D_DRIVER_TYPE_NULL driver, the app works fine and the frames are processed faster