com

Calling function from 64bit app from a 32bit dll

眉间皱痕 提交于 2019-12-08 06:29:50
问题 I have a 32bit dll (no source code) that I need to access from 64bit C# application. I've read this article and took a look into the corresponding code from here. I've also read this post. I'm not sure that I'm asking the right question, so please help me. There are 3 projects: dotnetclient , x86Library and x86x64 . The x86x64 has x86LibraryProxy.cpp which loads the x86library.dll and calls the GetTemperature function: STDMETHODIMP Cx86LibraryProxy::GetTemperature(ULONG sensorId, FLOAT*

MIDL Compiler error: MIDL

筅森魡賤 提交于 2019-12-08 06:13:43
问题 When I use MIDL to compile a IDL file to .h and .c, I get a error said: midl : command line error MIDL1004 : cannot execute C preprocessor cl.exe. Please kindly help me, I do not know why. The MIDL compiler which I use is part of VC++ 6.0. Thanks. 回答1: It seems your environment is not correctly set. Try calling vcvars32 before compiling. 来源: https://stackoverflow.com/questions/5079275/midl-compiler-error-midl

How to know which COM component is called by a certain PIA?

梦想的初衷 提交于 2019-12-08 06:03:22
问题 I got a PIA installed on my box, it is Microsoft.mshtml . If I understandd it correctly, these PIA is provided by Microsoft to ease our life of COM interop. But I want to know which COM component is actually wrapped/called by this PIA. Because I am having a UnauthorizedAccessException, I want to locate the actual COM component and use dcomcnfg.exe to grant it proper permission. I hope this is the right direction. Thanks! 回答1: It is c:\windows\system32\mshtml.dll. I seriously doubt that

Debugging a crash while unloading DLL in Win 10, but not Win 7

浪子不回头ぞ 提交于 2019-12-08 05:55:27
问题 Not totally sure that I've got this problem nailed down yet, but here's what I'm seeing and what I think is going on. I have a Win32 program mostly written in C that loads a C++ DLL. That DLL passes data from the C program to another application via a COM object--one that's probably instantiated by the DLL itself. All of this has apparently worked fine through at least Windows XP and Windows 7 (possibly Win95 and Win98, I'd need to look back deeper into the code history to find out when this

Access MS-Word spell-checker from (unmanaged) C++

南楼画角 提交于 2019-12-08 05:37:56
问题 I found a few articles on interacting with the MS-Word spell-checker from C# and managed C++ using .NET. (For anyone interested: this and this) But I couldn't find anything comparable on doing it through standard unmanaged C++ in an MFC app, using COM. I assume the .NET examples are actually using COM meaning it's possible, but is it likely to be horrific and ugly to do? 回答1: I did this. It is not that complicated. I packed the whole thing in a DLL and made the suggestions-dialog myself.

Deploying .NET COM dll, getting error (0x80070002)

旧城冷巷雨未停 提交于 2019-12-08 05:25:29
I have a .NET COM assembly I am attempting to deploy to a web server (IIS 6 Win 2003). We have successfully deployed this assembly to our test environment, but the production environment is not working. The assembly is being called from a classic ASP page. Every time that page tries to initialize the assembly with “ Set LTMRender = CreateObject("LTMRender.Render") ”, I get an error “ Error Type:, (0x80070002) ”. This error seems to indicate a permission denied, or file not found type problem. I created a test app to see if the assembly works outside of the web page. The .exe initializes the

Create COM object in Qt

夙愿已清 提交于 2019-12-08 05:13:51
问题 I try to create a COM object and get the interface from the object in Qt. So Qt works as the COM client. In my example the COM server is the CANoe COM server. Here is my source code of the Qt pro file and my interface.cpp file where I try to establish the connection to CANoe: pro file: # Add more folders to ship with the application, here folder_01.source = qml/3com_interface folder_01.target = qml DEPLOYMENTFOLDERS = folder_01 # Additional import path used to resolve QML modules in Creator's

Accessing an application's COM interface using C++ or C

十年热恋 提交于 2019-12-08 05:13:51
问题 In response to question, how can I (or find more information to) automate certain functionality without user intervention, from a C++ (or C) using: ATL Or Automation code directly in C/C++ Regards 回答1: If the application exposes a type library (and Microsoft Office applications do), then you can get at it from Microsoft C++ by using the #import keyword. This will create C++ wrappers for the COM interfaces exposed by the application. Type libraries are often .TLB files, but they are regularly

conversion between std::vector and _variant_t

社会主义新天地 提交于 2019-12-08 05:02:48
问题 I need to convert between std::vector and _variant_t to avoid looping when writing/sending data into some file (database, Excel, etc.) Could you please let me know how to proceed with that? I was trying to get a std::vector<_variant_t> and somehow put into another _variant_t variable, but direct conversion is not supported and even if it's done there's no either method or some kind of wrapper to get this vector into a _variant_t variable. I would prefer not to deal with any loops. 回答1: A std:

How do I correctly use CoInitialize() and CoInitializeSecurity() as if I didn't call the latter so I can use IGlobalOptions?

时光总嘲笑我的痴心妄想 提交于 2019-12-08 05:02:39
问题 My UI is provided in a DLL that calls CoInitialize() so I can use the Common Item Dialog, shell open folder dialog. and any other new Vista-only stuff that may require COM (I don't know of/don't use any others just yet). The DLL will also provide a UI Automation interface to a custom control (my Table control from questions past, which I've decided to move to UI Automation). I don't want COM's "helpful" exception handling; I want exceptions in my DLL to bubble through to the DLL so they can