com

Navision automation C# COM DLL

僤鯓⒐⒋嵵緔 提交于 2020-05-27 17:12:38
问题 What we did: We have created a C# class library project to talk to external webservices. When we check "register for COM interop" this DLL is automatically registered and ready for use on the PC where the registration occurred. The Navision client on that PC can then use an "automation" variable to find this DLL and use it. What's the problem? We need to rollout this DLL to the production environment. We're working with an RDP solution where the navision client runs on 2 RDP servers which our

Navision automation C# COM DLL

霸气de小男生 提交于 2020-05-27 17:07:57
问题 What we did: We have created a C# class library project to talk to external webservices. When we check "register for COM interop" this DLL is automatically registered and ready for use on the PC where the registration occurred. The Navision client on that PC can then use an "automation" variable to find this DLL and use it. What's the problem? We need to rollout this DLL to the production environment. We're working with an RDP solution where the navision client runs on 2 RDP servers which our

Accessing COM Interface with JNA

[亡魂溺海] 提交于 2020-05-15 08:01:26
问题 I'm trying to access the IDesktopWallpaper interface with JNA, but I've hit a wall. I went through ShOljIdl_core.idl (from Windows 10 SDK) and discovered the GUID of the interface as follows // IDesktopWallpaper [ uuid(B92B56A9-8B55-4E14-9A89-0199BBB6F93B), object ] and the GUID of the concrete class that implements the interface // CLSID_DesktopWallpaper [uuid(C2CF3110-460E-4fc1-B9D0-8A1C0C9CC4BD)] coclass DesktopWallpaper { interface IDesktopWallpaper; } So I followed the official example

Wrong vtable generated by C++ compiler (for COM object)

让人想犯罪 __ 提交于 2020-05-15 08:01:12
问题 I have this C++ code that defines a IMyInterface COM interface. The only subtlety is it defines two methods with different parameters but same name: struct __declspec(uuid("bd8a0cfc-312e-4871-8f82-07adab05c6d0")) __declspec(novtable) IMyInterface : public IUnknown { virtual HRESULT __stdcall SetValue(float value) = 0; virtual HRESULT __stdcall SetValue(int value) = 0; }; Here is a simple implementation: class MyClass : public IMyInterface { public: // poor man's COM object impl HRESULT

Wrong vtable generated by C++ compiler (for COM object)

柔情痞子 提交于 2020-05-15 08:01:05
问题 I have this C++ code that defines a IMyInterface COM interface. The only subtlety is it defines two methods with different parameters but same name: struct __declspec(uuid("bd8a0cfc-312e-4871-8f82-07adab05c6d0")) __declspec(novtable) IMyInterface : public IUnknown { virtual HRESULT __stdcall SetValue(float value) = 0; virtual HRESULT __stdcall SetValue(int value) = 0; }; Here is a simple implementation: class MyClass : public IMyInterface { public: // poor man's COM object impl HRESULT

What is the difference between IDispatch and IUnkown in COM? [closed]

纵饮孤独 提交于 2020-05-14 13:54:46
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 3 years ago . I have read and saw example for COM , but I couldn't clearly get there Interface difference. 回答1: IUnknown is the primal COM interface. It provides the basic ability to "cast" a instance of a COM object to any of it's supported interfaces (QueryInterface). IDispatch builds on IUnknown adding the

What is the difference between IDispatch and IUnkown in COM? [closed]

混江龙づ霸主 提交于 2020-05-14 13:54:01
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 3 years ago . I have read and saw example for COM , but I couldn't clearly get there Interface difference. 回答1: IUnknown is the primal COM interface. It provides the basic ability to "cast" a instance of a COM object to any of it's supported interfaces (QueryInterface). IDispatch builds on IUnknown adding the

Invoking GetMethod() on a System.__ComObject always returns null

时光毁灭记忆、已成空白 提交于 2020-05-13 17:43:11
问题 I am using .NET 4.0 and dynamic to invoke members on a System.__ComObject at runtime. I instanciate the object in the following way: dynamic DrApi; DrApi = Activator.CreateInstance(SprImportedTypes.DrApi); The types are declared in a static class like this: internal static Type DrApi = Type.GetTypeFromProgID("DrApi.DrApi.1"); Since the object is dynamic, I can invoke methods without any difficulty: string vers = string.Empty; DrApi.Version(ref vers); For consolidation and localized error

How do you return an struct or class from a .NET COM dll to a consuming VB6 application?

ε祈祈猫儿з 提交于 2020-05-13 08:04:13
问题 This seems like something that would be easy to find on here, but if this has been asked before, I don't see where. Basically, I'm a.NET developer and am having to work with VB6 for a minute and learn about making a COM DLL. I'm working in C# and am trying to get a COM DLL made in that language to return a custom class/struct to some VB6 code, and though the answer here was easy enough to use when returning a string or int from the COM method, I'm having trouble getting it to work with an

“Class not registered” when loading the Video Processor MFT on Windows 7

早过忘川 提交于 2020-04-16 02:59:09
问题 I have the following COM call: IMFTransform* pMFT = NULL; HRESULT hr = CoCreateInstance(CLSID_VideoProcessorMFT, NULL, CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&pMFT)); On my development machine, this call to CoCreateInstance succeeds. However, when I deploy this on my old Windows 7 machine, the call to CoCreateInstance fails, and I don't know why. Here's how I'm displaying the error: _com_error err(hr); LPCTSTR hrErrMsg = err.ErrorMessage(); WCHAR msg[MAX_PATH]; StringCbPrintf(msg, sizeof(msg), L