com

Heavily confused by win32api + COM and an answer from SO

本秂侑毒 提交于 2019-12-10 11:26:16
问题 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+

Classic ASP using C# .net DLL Object doesn't support this property or method

旧城冷巷雨未停 提交于 2019-12-10 11:09:15
问题 Hey all this is my first time creating a COM object for a classic asp page. The process I followed when creating this COM DLL is this: 1) Used the Strong Name Tool (sn.exe) and placed the .snk file within the app. (sn -k myKey.snk) 2) Added: [assembly: AssemblyKeyFile(@"myKey.snk")] [assembly: ComVisible(true)] to the AssemblyInfo.cs. I do get a warning on the KeyFile saying: Use command line option '/keyfile' or appropriate project settings instead of 'AssemblyKeyFile' 3) Ran the following

How to attach event to dynamic object or COM object

大憨熊 提交于 2019-12-10 11:06:10
问题 I think this article has the same problem with me. However, there's no workable solution for my case. I'm using Windows Media Player ActiveX in my program. For some reason, I don't want to add a reference of it and convert to AxHost automatically by IDE. I create the instance by Activator and ProgID protected const string WMP_PROG_ID = "WMPlayer.OCX.7"; private dynamic _wmp; protected virtual bool init(){ try{ _wmp = Activator.CreateInstance(Type.GetTypeFromProgID(WMP_PROG_ID)); } catch{

Copying values from excel to body of outlook email vb.net

混江龙づ霸主 提交于 2019-12-10 10:54:54
问题 So this is a more refined version of a question I asked earlier. I have been trying to sort this out for quite a while. I found a site that makes sense, but I can't implement it for some reason. I just want to be able to copy information from excel (tables, charts, ranges, etc) into the body of an outlook email. From here: http://pastebin.com/4VWmcrx6 It suggests: Using VB.NET to copy Excel Range (a table) to body of Outlook email Sub CopyFromExcelIntoEMail() Dim Doc As Word.Document Dim wdRn

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

我与影子孤独终老i 提交于 2019-12-10 10:36:06
问题 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

Performance of passing data between .Net and COM assemblies

喜欢而已 提交于 2019-12-10 10:18:09
问题 I am in the process of migrating a legacy VB6 app to .Net, however since it is a high-profile business critical application, it is being done piece by piece. In the interest of improving performance, there is one method which gets hit a lot,thousands of times during the application life, and I was wanting to rewrite it in .Net (C#) to see if the runtime can be improved. The method in question manipulates ADODB Recordsets. Is there any performance issues I should be aware of or take into

“class not registered” which class?

拟墨画扇 提交于 2019-12-10 10:14:32
问题 Consider this code: try { ISomeObject pObj(__uuidof(SomeClass)); ISomeObject pObj2(__uuidof(SomeOtherClass)); } catch ( _com_error& e ) { // Log what failed } I.e. I have a block of code which instanciates my objects. Sometimes (a bad install) it failes because some class wasn't properly registered. (I don't have a particular problem, rather general discussion here.) Is there some way to, from the caught exception or otherwise, realize what class failed? A have pondered to make a wrapper of

How to call a COM component in C

若如初见. 提交于 2019-12-10 10:14:09
问题 I have to call a COM component from C done in Visual Studio. I am able to call it from Visual C++ using the '#import' directive by specifying the .tlb file. But I don't see #import directive in the C language. Is there an alternative I can use instead of that? I cannot write in C++ as I have to create the module in pure C only. 回答1: The type library in that component likely comes from compiling a IDL file by MIDL. MIDL produces three files - .tlb, .c and .h. .c and .h files contain interface

Undefined reference to CLSID_MMDeviceEnumerator and IID_IMMDeviceEnumerator

感情迁移 提交于 2019-12-10 10:13:23
问题 Trying to compile an example code using COM and CoCreateInstance() using MinGW-w64 in C fails. #include <windows.h> #include <mmdeviceapi.h> #include <endpointvolume.h> #include <stdlib.h> #include <stdio.h> extern const CLSID CLSID_MMDeviceEnumerator; extern const IID IID_IMMDeviceEnumerator; int main( void ) { CoInitialize( NULL ); LPVOID device = NULL; const HRESULT ok = CoCreateInstance( &CLSID_MMDeviceEnumerator, NULL, CLSCTX_INPROC_SERVER, &IID_IMMDeviceEnumerator, &device );

Windows OSes and Memory Management— What happens when an application is minimized?

北战南征 提交于 2019-12-10 10:12:37
问题 I'm asking this question for posterity reasons and general interest. Years ago I noticed an odd behavior within Windows. I know this works in XP and at that time it also worked in Windows 2000 and even 98 and I'd assume this behavior still works for Windows 7. To setup my question, try this experiment by following these steps. Open the Task Manager and navigate to the Processes tab. Open an application that you use that you know consumes a fair amount of memory (a web browser should work fine