com

Odd one: @myRecordArray[0] returns invalid pointer if array size is bigger than 4136

hello stack, this is really strange, i have an array in delphi and fill it with directX matrices. then i get the pointer to the first element and pass it via com to c# managed code: function TMPlugTransformInPin.GetMatrixPointer(out SliceCount: Integer; out ValueP: Int64): HResult; var matrices: array of TD3DMatrix; i: Integer;...

casting COM objects in VBA

I have a base abstract class MyClass, and it has an interface IMyClass. I have 2 other classes (MyClassA, and MyClassB) that inherit from MyClass and include the IMyClass Interface. I have a fourth class (MyList) that inherits from List<IMyClass> and it has an interface that has a method Add(IMyClass value); All classes have been ...

How to make WPF App as OLE object which can embedded in MS Excel ?

I want to make my WPF app as an OLE object which can be inserted and launched from an MS-Excel . When I open an Excel-2003 and go to Insert->Object a list of OLE object are shown in Create New tab. I want to register my WPF app as an OLE object so that it is also shown in the list. User can able to insert and launch the appliction from ...

How to create a COM DLL (class library)?

I have an existing COM DLL (class library), originally written in VB6 and source code now lost. I need to very quickly rewrite to make a minor tweak it and don't have access to VB6. I understand that C++ Express 2008 will let me create the DLL, but I get bogged down ATL and the like. Is there a really simple step by step guide to creat...

COM + WaitForSingleObject

I've been trying to find a good architecture for one application for the last few days, and after some research I'm finally stuck, and the reason is COM. The app in question will have multiple GUI threads, and they will schedule work items for worker thread. The worker thread will initialize COM via CoInitialize(NULL);, create few COM c...

COM Exception (code 0x800A03EC) thrown when programmatically changing page breaks in VB.Net

I am attempting to use the VB.Net Excel COM interop to programmatically change the location of the first horizontal page break on an Excel spreadsheet being generated by the program. Code to do so is as follows: Dim range As Excel.Range xlActualWS.Activate() xlActualWS.PageSetup.PrintArea = "$A$1:$K$68" range = xlActualW...

Using a 32 Bit Com Object from a 64 Bit IFilter

I have an IFilter written in Delphi that I'm trying to get working under 64 bit Windows 7 Desktop Search. Due to it being developed in Delphi I can only compile this as a 32 Bit DLL. To work around this I am trying to write a 64bit IFilter Dll in Visual C++ which internally uses my 32Bit IFilter Com Object using the DllSurogate techn...

TV capture EZACP - DirectShow capture filter - error ERROR_DEVICE_NOT_CONNECTED while running graph

Hello I have a EZCAP video capture device. It has its DirectShow capture filter. When I add this filter to GraphEdt and connect to Video Renderer filter, I get following error: HRESULT: 0x8007048f (2147943567) Name: ERROR_DEVICE_NOT_CONNECTED Description: n/a Severity code: Failed Facility Code: FACILITY_WIN32 (7) Error Code: 0x04...

out of proc COM server unable to createobject from asp.net webservice

I have the following setup WinXP SP2, IIS 5.1 I have an Asp.net website(a) calling -> Asp.net Webservice(b) calling a function Creating a COM object in an already running EXE server(c). This COM server works fine with local clients. The CreateObject fails even when run on a machine when COM server is registered as a user(adminuser) w...

Passing ComObjects in Powershell

Hi! I am trying to call some COM method which uses another COM object as argument via Powershell but I can't get it to work. $dbc = New-Object -ComObject "BMS.MOL.DBConnector" $client = New-Object -ComObject "BMS.MOL.Client" Calling $dbc.GetClient(1, $client) results in an unknown error (translated): Exception during call of "Get...

How do I resolve process hanging on CoUnitialize()?

I have a native Visual C++ NT service. When the service is started its thread calls CoInitialize() which attaches the thread to an STA - the service thread uses MSXML through COM interfaces. When the service receives SERVICE_CONTROL_STOP it posts a message in the message queue, then later that message is retrieved and the OnStop() handl...

Passing 32-bit pointer to 64-bit COM control

We have a 32-bit app which interfaces with a 64-bit COM control. In order to handle the interface, I created a 64-bit COM object which resides in a local server (exe). This local server object implements the same interface as our COM control, and simply passes-through the calls. Everything is working except for those interface functio...

Is COM object redirection via "TreatAs" supported by WinCE 5.0 and above?

If not, is there a way to obtain equivalent functionality? We want to provide a new COM component as a drop-in replacement for a panel who's vendor can change things in the registry, but not their client code. ...

Extending RUMBA/3270 client using COM interface or EHLLAPI

Hi All In my application i want to listen for any RUMBA/3270 (It is a 3270 emulator) screen update/event which i can capture and get the text/byte stream coming from mainframe. Once there i can use that stream for data mining. In the RUMBA data-sheet they have mentioned that RUMBA 3270 emulator could be extended either by using EHLLAPI...

What is a current analog of COM technology?

COM technology seems a little outdated already, though still in use. But what approach is recommended now for implementing the same kind of interoperability when building a .NET app, specifically, in WPF? I.e. what is a modern replacement of a COM object? ...

Leaving a Project file open after retrieving it with GetObject

What is the right way to leave an MS Project file opened with GetObject() open and visible to the user after the end of a macro in a different app? The information I found online suggests that setting the Application.UserControl property to True before the objects go out of scope should allow the user to continue using the opened file. ...

Creating an IShellItem instance for a non-existent file

How can I get an IShellItem object for a non-existent file (or directory)? SHCreateItemFromParsingName and SHCreateItemFromRelativeName fail with 0x80070002 (file not found) and ILCreateFromPath returns a NULL pidl. First I thought it might be impossible, but for example IFileSaveDialog creates such an IShellItem for its result (if ...

Opening a cash drawer using C/C++ or Java

I need to open a cash drawer using C/C++ or Java. It is a POS-X cash box with a USB connection. I've never done anything like this before. I noticed the cash box was linked to the "COM3" port. I know Java does not have a USB API so I turned to C/C++. ...

Access: persist a COM reference across Program Reset?

Are there ways in Access VBA (2003) to cast a COM reference to an integer, and to call AddRef/Release? (which give the error "Function or interface marked as restricted, or the function uses an Automation type not supported in Visual Basic") I'm using a third-party COM object which doesn't handle being instantiated twice in a single pro...

Why call CoFreeUnusedLibraries() before OleUninitialize()?

While trying to resolve process hanging on CoUninitialize() I came upon a piece of code shared by many of our projects. When a program is going to quit it first calls CoFreeUnusedLibraries(), then immediately OleUninitialize(). While the effect of OleUninitialize() is quite clear I can't find why one would want to call CoFreeUnusedLibra...