com

how to use a method inside a com dll into C# ?

how to use a method inside a com dll into C# ? ...

How to reference ADO RecordSet object in C#?

I am using a COM DLL, a function call which returns an ADO RecordSet object and want to refer to it in my C# application. Have added the reference, put the msado15,interop.adodb dll in the bin directory and debug directory, added assembly key in web.config but still get the following error: The type 'ADODB.Recordset' is defined ...

COM API - could not pass "NULL" for a pointer argument

I have a COM API foo, the IDL looks like: foo([in] unsigned long ulSize, [in, size_is(ulSize)] unsigned char* pData) when I consume this function with foo(0,NULL); I get an error - NULL argument passed. Is there a way to workaround this? ...

COM with ATL Versioning

My Visual Studio 2008 ATL project has a control that defines a version number in several places. The IDL file: uuid(56CD4ADB-B72D-4BF8-B5AC-6CA320EAD27D), version(1.0), helpstring("MyProject 1.0 Type Library") The control's header file: class ATL_NO_VTABLE CMyControl : public CComObjectRootEx<CComSingleThreadModel>, ...

Determine if device is connected/disconnected to RS232 port without opening the port

I"m working on a C++ Win32 application for which I'm trying to essentially "auto detect" if a device has been plugged into one of the RS232 ports and then if it has been disconnected. The checking for a connected device is easy enough because my use case allows me to assume that this particular thread will be the first to try to initiat...

How to make a .com file using C/C++?

How can we make a .com file using C/C++? Is it possible? Edit: I was able to successfully make a com file using darin's suggestions. But somehow the exe file of the following program cannot be converted to com file. I get the "File cannot be converted" message by exe2bin. I'm using Borland Turbo C++ 3.0. Any suggestions? #include <dos....

Is COM aggregation not supportable by most objects?

I have noticed that numerous books, etc. on COM point out that it is relatively easy to implement an object that can be used as an inner object in COM aggregation. However, unless I am missing something, it seems that aggregation can only be successful in extremely limited scenarios and thus support for it should only be provided when su...

.Net COM DLL not working from vb6 across appdomains

We have a large vb6 application, and as we need to change/fix things, we are moving sections to .net, targeting the framework 2.0. We have moved a bunch of classes to a .net dll, and they are set up properly to be exposed to com. Here's the problem: MainAppVB6.exe instantiates DOTNET_COM.ComClass. It passes this to a method in a diff...

COM Interface question - .NET

Hi Recently I was reading about interop marshalling but I still don't understand one thing. To make .NET assembly visible to COM I need to use tlbexp tool and/or regasm tool. To make COM visible to .NET assebly I have to use tlbimp tool - all that is clear for me. Apart from that, I've seen on the internet a lot of code dealing with C...

COM server AnsiString parameters in Delphi 2009

I have a simple COM dll with a method that takes two strings. In the type library editor of delphi these strings are defined as LPSTR. This translates to PChar in the TLB file. When upgrading from D2007 to D2009 this became a problem since PChar now has changed from PAnsiChar to PWideChar (it still becomes PChar in the TLB file when it i...

What open-source COM implementations work on embedded systems?

I am considering using COM interfaces within an embedded (non-Windows) system that has a limited C++ compiler, and I am looking for an open-source COM implementation using simple C++, in particular with little or no use of templates and without use of exceptions (yes I know COM doesn't use exceptions but an implementation could use them ...

Java to access pci-modem

Hi, I have a pci-modem in my laptop and I tried to run a program that opens the port and configures it.I get an excepcion while doing it, I think that it can't see the port, even though it is on COM3. Is there any way of doing it in java? The error I get is noClassDefFoundError. It says the SerialPortEventListener class isn't found. I...

Same DLL loaded twice in a process

I have an ActiveX control (foo.dll), when I embedded the same in the IE and start the page. I could see that the process explorer shows two instances of the foo.dll loaded from the same location. This causes the DLL_PROCESS_ATTACH to be called twice and the global data structures gets initialized twice. Is there a way to workaround thi...

ActiveX Flash component in C# .NET 2.0 Application causes memory leak?

We have a C#/.NET 2.0 WinForm with an ActiveX ShockwaveFlashObject control on it. The program loops through a schedule of content and displays it over and over on the control, fullscreen, like this: axFlash.BringToFront(); axFlash.Movie = scheduleItem.FilePath; axFlash.Show(); axFlash.Play(); This works great, but after a couple of da...

Using FaxComEx library?

I'm trying to write a program that will send faxes to the Windows Fax system but I am having problems with the COM library FaxComEx. My code: try { var faxServer = new FAXCOMEXLib.FaxServer(); var faxDoc = new FAXCOMEXLib.FaxDocument(); faxServer.Connect(""); faxDoc.Body = @"C:\\test.txt"; faxDoc.Recipients.Add("555...

Create an ActiveX control with pure WinAPI? (no MFC/ATL/etc)

Hi all, I'm looking at getting into ActiveX development and hopefully make a couple browser plug-ins by the end of things. I'm a seasoned WinAPI developer who has stayed away from such wrappers as MFC and ATL in the past, so I have virtually no experience in either area. However, in searching for tutorials on creating ActiveX controls in...

Marshal.ReleaseComObject ?

I'm playing around with these two native win32 functions: [DllImport( "oleacc.dll" )] public static extern int AccessibleObjectFromWindow( IntPtr hwnd, int dwObjectID, ref Guid refID, ref Accessibility.IAccessible ppvObject ); [DllImport( "oleacc.dll" )] public static extern uint AccessibleChildren( Accessibility.IAcce...

Using early binding on a COM object

Hello, I have this piece of code that works very well and gives me the path the user's start menu: Dim oShell As Object = CreateObject("Shell.Application") MsgBox(oShell.NameSpace(11).Self.Path) This obviously uses late binding. Now say I want to do this in C#, or in VB.NET strict mode, neither of which support this kind of s...

Calling a COM object from .Net C#

I am trying to access a COM dll(eObjectBroker) from my C# application. Here are things I have done. run tlbimport with eObjectBroker.dll to get the assembly. I get two assemblies, as COMSVCLIB is referenced from eObjectBroker. So I have eObjectType.dll and COMSCVLIB.dll I add reference to these two assemblies in my .Net c# project. I a...

How can I get tlbimp to not automatically generate assemblies for referenced types?

I want to create an interop assembly from a type library using the tlbimp.exe tool that is included in the .NET SDK. My problem is that the source type library is referencing a type in another library that I do not have available. How can I get tlbimp to not automatically generate assemblies for referenced types? I get the following e...