com

COMException in System.WIndows.Forms.dll with Interactive Brokers TWS API

Hi, I've been trying to run the sample project provided with the tutorial at stockbotprogramming http://www.stockbotprogramming.com/sharpcibtutorial1.php , but I keep getting a COMException every time I run the application. I have the TWS Client running and the sample VB projects provided with the API are able to connect just fine, but ...

crash with CoUnintailize() api of COM

My main process(main.exe) initilaized COM library and created a thread which creates a new process(p1.exe) this new process is again initializing COM library and after making all references as zero unintialized COM here.. the unintailezed COM in the main process (i.e main.exe) also.... When i run p1.exe individually it is successful.. b...

How to hide GetType() method from COM?

I made an automation Add-In for Excel, and I made several functions (formulas). I have a class which header looks like this (it is COM visible): [ClassInterface(ClassInterfaceType.AutoDual)] [ComVisible(true)] public class Functions {} In a list of methods, I see: ToString(), Equals(), GetHashCode() and GetType() methods. Since ...

How to access COM vtable and acess its entries from TLB(Type Library) in C#?

Hello, I need to access COM vtable which have entries of those functions which are exposed to outside world under some specific interface in C#. I've accessed and iterate over the types enclosed in the TLB with LoadTypeLib and playing with ITypeInfo. Now only thing I need to access one by one those methods inside vtable of COM Interfac...

does declaring appid for com exe lib makes it a dcom?

we've got some legacy com libs exposed as exe, they register as dcom. we'd like to get rid of any dcom-ness and not be forced to give users extra dcom execution rights. can someone point me to some documentation or samples (rgs files, registration code?) how I register an exe com lib without dcom? ...

VB6 ActiveX exe - what is the proper registration sequence?

I have recently updated a Visual Basic 6 application that is an ActiveX exe, running on Windows XP. I have a couple of testers for this application who have received a copy of the exe and are attempting to run it. However, they are getting an error message "Unexpected error;quitting" when trying to do so. A key difference between their...

Calling Matlab's MLApp.MLAppClass.FEval from F#

Matlab provides a COM interface that supports remote execution of arbitrary functions (and code snippets). In particular, it has an Feval method that calls a given Matlab function. The third parameter to this method, pvarArgOut, has COM type VARIANT*, and appears in the Visual Studio F# editor as an argument of type: pvarArgOut: byref<o...

Why Exception occured getting address of COM function ?

I am getting address of COM function by loading type library (TLB) and iterating over types using ITypeLib and ITypeInfo. After calling AddressOfMember function of ITypeInfo I am facing the following exception: System.Runtime.InteropServices.COMException (0x800288BD): Wrong module kind for the operation. (Exception from HRESULT: 0x80...

Some basic COM question...

I have just finished my first COM server DLL. And it runs smoothly. So I'd like to show my understanding for now and hear your critics. 1- How COM simply works? COM - "The Call Chain" COM Lib methods -> Traditional DLL exports -> Classes encapsulated in the COM DLL 2- With C++, the benefits like "interface" in OOP can only be taken ad...

How to manipulate another cell when excel is in edit mode

Hi, I'm writing a RTD server in c++. it works fine, but I noticed that when excel cell is in edit mode RTD cells does not get updated. I would like to know whether there is a way to update RTD cells even when the excel is edit mode. I know that I can use Excel COM object to directly write any value to a cell.(with out using RTD). But I...

How to Call COM unmanaged code at Runtime from C#.NET using ITypeLib and ITypeInfo ?

Hello, I need to call unmanaged COM code from C#.NET. By Loading unmanaged COM Type libraries from (LoadTypeLibEx), I am able to iterate over all exposed types by COM TLB. Now I need to call those exposed methods at run time by knowing their addresses or by accessing some how COM vtable's starting address and by applying indexing for ge...

Calling COM Library From XBAP

I am trying to call an old COM library from my XBAP and continue to receive the following exception: System.AccessViolationException was unhandled Message: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. I have tried adding the HKLM value for RunUnrestricted to no avail. I don't ...

OLE Automation: IDispatch implementing class; client or Server?

I have a project which I'm studying the codebase of, however I'm trying to understand how this whole OLE Automation works. In the OLE Automation protocol, which application has to implement IDispatch on one of its classes, the server or the client? ...

COM Dual Interfaces

A dual interface in COM is one that is able to be accessed via a DispInterface or via VTable methods. Now can someone tell me what is exactly what the difference is between the two methods? I thought that a VTable is a virtual table which holds the pointers to the different functions when implementing a class hierarchy which has virtua...

Why don't Direct2D and DirectWrite use traditional COM objects?

I'm toying with a little 2D game engine in C# and decided to use Direct2D and DirectWrite for rendering. I know there's the Windows API Code Pack and SlimDX, but I'd really like to dig in and write an interface from scratch. I'm trying to do it without Managed C++, but Direct2D and DirectWrite don't appear to use traditional COM objects....

Any way to avoid creating a huge C# COM interface wrapper when only a few methods needed?

Greetings all, I’m working on a C# program that requires being able to get the index of the hot item in Windows 7 Explorer’s new ItemsView control. Fortunately, Microsoft has provided a way to do this through UI Automation, by querying custom properties of the control. Unfortunately, the System.Windows.Automation namespace inexplicabl...

Guaranteed COM object release?

I wrote the following code under the assumption that Excel will die with Monkey: class ExcelMonkey { private static Excel.Application xl = new Excel.Application(); public static bool parse(string filename) { if (filename.Contains("foo")) { var workbook = xl.Workbooks.Open(filename); ...

COM IUnknown and do I need a pointer to it first before calling CoGetClassObject?

In COM, when you want to create an instance of some COM Server object, do you first need to get a pointer to it's IUnknown interface and only then create a class object using CoGetClassObject? As far as I understand it, IUnknown is used to manage object lifetimes, so from my understanding, whatever object the client wants to create, one...

Is it possible to interop with Thunderbird using C#?

Here's the latest hurdle in my ongoing quest to automate my job: All email in the company goes through 4 different email adresses, switching randomly back and forth (with a note attached in the global share: please set "keep email on server") All logic related to email is contained in a nice big Thunderbird profile, which gets copied b...

COM port - how to identify a device (.net/c#)

Hi, I'm programming for Windows CE and I need to connect to a scanner. There is no problem - I know that it is on port COM0, but if I plug in another device earlier it gets another COM port... to get all com ports the easy way is: SerialPort.GetPortNames() But I don't know how to identify a device? Is there any standard way? I can't ...