com

Registering object _instances_ instead of _types_ with .NET remoting?

There's something I'm just not getting about .NET remoting. Well, two things actually: Why is the emphasis back on classes that inherit from MarshalByRef instead of interfaces ala the original COM style (which I liked)? Why is it that .NET remoting always forces you to effectively create some sort of object pool instead of allowing you...

Is AxBrowser.GetOcx() is equal to Webbrowser.ActiveXInstance() ?

I'm trying to understand the different between .NET 2.0+ provided Webbrowser Control and AxWebBrowser. As far as I understand AxWebBrowser is a COM object and Webbrowser Control is just managed wrapper around AxBrowser. Am I right? Is AxBrowser.GetOcx() is equal to Webbrowser.ActiveXInstance() almost same? ...

.NET force COM objects release

Hi ! I have an ASP.NET 2.0 application under IIS that has the functionnality of exporting some data to a software called HFM (Oracle Hyperion Financial Management). To perform that export, the .net application uses an API based on COM objects provided by the HFM client (the client is installed on the same machine that the server, etc.)...

Need to 'wrap up' a C++ dll/h/lib/xml/exe based SDK into a COM to use in a C# 2.0 project

I just got handed an SDK made of C++ dll, lib, exe, and various .h files. I presume it is meant for C++ developers. The sample projects they provide with their documentation are all written in C++. I am able to spin them up with Visual Studio 8 (2005) and run them. They do control the device as advertised. However the project this nee...

How to embed .tlb as a resource file into .NET Assembly DLL?

We're using our .NET Assembly DLL within native C++ through COM (CCW). Whenever I make new version of my DLL, I have to send two files (.dll and corresponding .tlb) to crew that's using it in their code. Is it possible to embed .tlb file as a resource in .NET DLL file? ...

Exposing events from .NET to COM

Hello everyone, recently I have been encountering problems with exposing events from .NET to COM. I have been successful with this example (conceptually taken from http://blogs.msdn.com/andreww/archive/2008/10/13/exposing-events-from-managed-add-in-objects.aspx): // The delegate type for our custom event. [ComVisible(false)] public de...

Pointer to COM object when application does not return it

I am using a third-party application, and making a call to create an instance of my COM object. This call is succeeding, however the function on the third-party application does not return a pointer to the created object (I have no idea why). Is there any way to get a pointer to my object? To clarify, here's some pseudo-code: // This...

Use of CoGetClassObject() in C - access COM Object interface

Instruction on accessing a interface to an application, in plain C/C++ without: MFC ATL WTL Basically, I would like to make use of a COM object. Working sample source code or guidance - to using (functionality) a COM object, not creating a COM server. Regards ...

How to pass a COM method as a function argument? And Microsoft Compiler error C3867.

Hello, I would like to pass a COM method as a function argument but I get this error (Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 15.00.30729.01 for 80x86): error C3867: 'IDispatch::GetTypeInfoCount': function call missing argument list; use '&IDispatch::GetTypeInfoCount' to create a pointer to member What am I missing? Tha...

What kind of code library should I build for distribution?

I need to build a C++ library to distribute among our customers. The library must be able to be accessed from a wide range of languages including VB6, C++, VB.net and C#. I've being using ActiveX controls (ocx files) until now. But I wonder if there is a better kind of library (dll, etc.) that I can build. What do you recommend? I'm li...

Access a COM Interface method C++

Both: CLSID IID Having specified the above, and using: CoCreateInstance() To returning a single uninitialised object of the class specified by the CLSID above. How can I then access an Interface's method from C++? Without: ATL MFC Just plain C++ Afterwards, I use CreateInstance() I'm having trouble, using CreateInstance() - wi...

Using updated ActiveX component in an existing WinForms application ?

Currently there is a Winforms application that is using an ActiveX component .ocx through the two interops. Now that there is a new version of the ocx available, I would like force the WinForms app to use newer version. Unregistering the old ocx and registering the new ocx doesn't help. Appreciate any help in achieving the same. ...

COM object in C# VS2008: Error loading type library/DLL

I am trying to reference a third party COM DLL from a Visual Studio 2008 project (.NET 3.5 SP1) on Vista Ultimate. I ran the setup for the COM component, and then discovered that it was not the right setup. So I uninstalled and ran the correct install. After adding the reference to a new C# project, not all the object methods are availa...

Questions about COM/ActiveX objects

I have a pretty good grasp on how a "traditional" .dll works, the differences between dynamic and static loading, etc. However, I'm confused about how COM objects work: it is mandatory to register it (with regsvr32)? can I have two versions of a registered COM object lying in the same/different directory? besides beying packaged insid...

Efficient way to handle COM related errors (C++)

Efficient way to handle COM related errors in C++. For instance: switch (HRESULT_CODE(hresult)) { case NOERROR: cout << "Object instantiated and " "pointer to interface IS8Simulation " "obtained" << endl; break; //Specifed Class not registered case REGDB_E_CLASSNOTREG: cerr << "Specified Class not registered....

What is the correct syntax when passing CComSafeArray to a method expecting SAFEARRAY**

Hi guys, This most likely has a very simple answer, but I can't figure it out. I'm trying to refactor some code that looks like this: SAFEARRAY* psa; long* count; HRESULT hr = pSomeInterface->ListSomething(&psa, &count); if (SUCCEEDED(hr)) { CComSafeArray<BSTR> sa; if (*count > 0) { sa.Attach(psa); } } // perf...

.Net CCW no events with registration-free COM!

I have a COM Callable Wrapper that I'm using from a VB6 program, but the program won't receive COM events unless the CCW is registered. Otherwise, the CCW works fine, just no events until I remove the program's manifest file and register the CCW using "regasm /tlb /codebase theccw.dll". This is in WinXP SP3. What could be the problem? ...

Manually generate ActiveX wrapper after TLBIMP-ed dlls?

I have several ActiveX components that needed to be accessed from a C# project. I can import them via Visual Studio's add reference dialog, which will also automatically generate wrappers class. (i.e. ABCLib and AxABCLib) I know that I can generate the primary interop assembly manually by running TLBIMP /primary on each individual OCX ...

Delphi 2009 COM/ActiveX Type Library support stability

Referring to TLB and maintenance issues ... My question to people (often) using the new COM/ActiveX type library support in Delphi 2009: How stable is the implementation? Especially, I'm interested in: adding/deleting classes, changing GUIDs, renaming methods/properties, reordering methods/properties, huge type libraries (50+ classes),...

Create Out-Of-Process COM in C#/.Net ?

Hi, I need to create an out-of-process COM server (.exe) in C# that will be accessed by multiple other processes on the same box. The component has to be a single process because it will cache the information it provides to its consumers in memory. Note: the processes that will access my COM Server are mostly Matlab processes, thus the...