com

COM: Create a VT_ARRAY with VT_BSTR values

不羁岁月 提交于 2019-12-06 06:41:20
问题 I'm a COM newbie and I think what I have is correct, but the runtime doesn't like it. Any help is much appreciated. I need to invoke a COM function that takes in a single dimensional array of BSTRs. Specifically, the documentation says the parameter must be: Function: AddFiles ( [in] VARIANT * filePaths ) filePaths The single-dimensioned array of full paths to each file or folder. filePaths can be of type VT_ARRAY|VT_VARIANT , where each entry is a VT_BSTR , or VT_ARRAY|VT_BSTR . I have a

C# COM Cross Thread

和自甴很熟 提交于 2019-12-06 06:41:15
问题 we're developing a software to control a scientific measuring device. it provides a COM-Interface defines several functions to set measurement parameters and fires an event when it measured data. in order to test our software, I'm implementing a simulation of that device. the com-object runs a loop which periodically fires the event. another loop in the client app should now setup up the com-simulator using the given functions. I created a class for measuring parameters which will be

After COM API call, getting EOSError Exceptions (access denied) but only when switching users or Locking the station on Windows 7

孤人 提交于 2019-12-06 06:30:58
I have a Delphi 6 application that is getting an EOSError Exception, code 5, access denied but only when I switch away to another Windows 7 user account, or I Lock the station. I am printing out a stack trace but the error appears to be coming straight from the Application.Run() statement with Application.ProcessMessages() immediately beneath it on the stack. The rest of the stack is my Exception handling code. During operation the code does make calls to ShellExecuteEx() and accesses a COM/ActiveX object, but only when the user explicitly clicks a button. This only happens on Windows 7, not

Windows Limited User Installation

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-06 06:29:00
问题 I have a Win32 application that includes an EXE, an ActiveX control (DLL) and a COM server (EXE) and I am using Inno Setup 5 to build my installer. Many of our customers use limited user accounts where the user has no admin rights and because the COM components require to be registered (which writes to HKEY_CLASSES_ROOT), my setup file must run with elevated (admin) privileges. I think this in unavoidable (sadly, I can't use registration-free COM because of the EXE COM server I have). However

Is the IShellItemImageFactory interface, used for getting Vista/7 shell thumbnails, broken?

让人想犯罪 __ 提交于 2019-12-06 06:22:16
I want to use IShellItemImageFactory to retrieve the shell thumbnail of files. According to the MSDN docs, if I pass in a SIZE struct of 256x256, it should populate the HBITMAP parameter with a 256x256 bitmap, and if I use the SIIGBF_RESIZETOFIT flag, it should resize smaller thumbnails to 256x256. It doesn't. Instead, the result is a 256x256 bitmap with a small icon drawn in the middle. Okay, maybe that's just not what SIIGBF_RESIZETOFIT is supposed to do. But then, as I understand it, I should be able to use SIIGBF_BIGGERSIZEOK and specify a tiny size (say 1x1) and it should return the

#import command line equivalent

若如初见. 提交于 2019-12-06 06:16:32
问题 Using Visual Studio with Microsoft's C++ compiler, we have several source files which use the Microsoft-specific '#import' directive to import a type library. For instance: #import my_type_lib.tlb I'd like to remove the #import from the source code, and replace it with a command line step to be executed via GNU Make. The necessary interface definitions (.idl source code) are available during the build. How can I remove my dependency on #import and replace it with specialized build tools to be

I need to access a 32bit dll from a 64bit exe

☆樱花仙子☆ 提交于 2019-12-06 06:05:52
问题 I know I read all about surrogate process, and I was able to create a surrogate COM but it either all works in 32bit or all works in 64bit. What would be the correct structure? 1) 32.dll <- 64.com <- 64.exe 2) 32.dll <- 32.com <- 64.exe I tried both of the above but I did not succeed to call the 32.dll? 回答1: I'm not too informed about the surrogate COM you refer to but I've solved this problem (Using a 32bit dll from a 64bit exe) by introducing a COM object in the middle: 32.dll <-> 32bit-out

COM multi-threading support

瘦欲@ 提交于 2019-12-06 05:50:10
问题 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

Heavily confused by win32api + COM and an answer from SO

风格不统一 提交于 2019-12-06 05:41:40
From my other question here on SO, I asked how to retrieve the current playing song from Windows Media Player and Zune, I got an answer from a c++ dev who gave me an explanation of how I would do this for WMP. However, I am no C++ dev, nor am I very experienced with the pywin32 library. And on-top of all that, the documentation on all this (especially concerning WMP) is horrible . Therefor, I need your help understanding how I would do the following in Python. Source I have working code in C++ to print the name of media currently playing in WMP. It's a simple console application (78 lines of

How to register COM libraries at runtime?

烂漫一生 提交于 2019-12-06 05:38:32
问题 Let's say I'm developing an application that installs COM component and installer registers them. This works great. Now the software is required to run from a memory stick. How can I register my libraries runtime and make sure, that the registry is cleaned up after running the application? 回答1: Are you always running on XP or later? Don't bother. Use "registration free COM". Essentially what you do is create a manifest file for the COM component so the Windows loader know what its