Click here to Skip to main content
15,891,777 members
Everything / COM

COM

COM

Great Reads

by Maxim Kartavenkov
Article describes how to make H.264 Video Encoder DirectShow Filter using NVIDIA encoder API in C#
by Michael Dunn
A tutorial on using owner-drawn menus in a context menu shell extensions, and on making a context menu extension that responds to a right-click in a directory background.
by Arik Poznanski
Complete Library for using the Windows 7 Ribbon from C#, including 18 samples and 21 blog posts documenting the Ribbon features
by CMalcheski
How to Create a Complete DirectX Game in Assembly Language

Latest Articles

by Michael Chourdakis
DirectX hardware screen capture and encoding with audio mixing capabilities. H264/H265/VP80/VP90/FLAC/MP3. HDR supported.
by flyhigh
By implementing a UI library and exporting its necessary components to lua script, we can create a beautiful UI and implement relevant logic in Lua script completely.
by Andrea Simonassi
The first and simplest of the multiplication algorithms, fast enough to multiply not too large numbers
by Excel-lent
This article shows how to compile and execute OpenCL code from VBA.

All Articles

Sort by Updated

COM 

20 Mar 2024 by Michael Chourdakis
DirectX hardware screen capture and encoding with audio mixing capabilities. H264/H265/VP80/VP90/FLAC/MP3. HDR supported.
27 Feb 2024 by Maxim Kartavenkov
In practice to control releasing instances of the COM objects in the application you can use the helper template classes such as CComPtr CComQIPtr or CInterfaceList of the ATL. That allowing you to work with COM interfaces as with the regular C++...
24 Feb 2024 by KarstenK
Check that you release your own COM pointers in time, so best not in the destructor but earlier like at the begin at the WM_CLOSE handler or even earlier like when the user wants to exit. The COM stuff takes some time, so be sure that it gets its...
23 Feb 2024 by CPallini
With objects you do not control (e.g. COM objects internal to the libraries) there's nothing you can do. On the other hand, with objects you do control, you may check the return value of the Release method, at least to inspect the updated...
23 Feb 2024 by Saurabh Ashtaputre
I have a C++ MFC application which uses many COM pointers from some other libraries. Those pointers are fetched using QueryInterface calls. While closing my application, I get an exception log stating that some COM pointers are not yet released. ...
9 Jan 2024 by Maxim Kartavenkov
On application layer you can start to look from the topic: COM+ Security Concepts - Win32 apps | Microsoft Learn[^] It starts from the basic description and go down to the implementation. Next thing you can look is the COM+ events: COM+ Events...
9 Jan 2024 by Maxim Kartavenkov
You should specify on what language you want to implement it. In .NET it's more easy to make: you should declare class with fields which you planning to pass as an event arguments. The class should have fields only and have class attribute...
3 Jan 2024 by Member 16008221
Hi, Can you please provide steps to create a WMI provider. I have to develop a WMI provider to get details of devices connected with my machine. I need details like, can I create WMI provider as visual studio console application? I have red COM...
2 Jan 2024 by Member 15635207
Hello Folks, I have a COM server and Client. AFAIK, they communicate over RPC on different computers and LPC on the same computer system. Is there any way to secure this communication? i.e. verify client and server and then start communication?...
24 Nov 2023 by Saurabh Ashtaputre
I have a C# WPF User Control. I want to load that on C++ MFC Dialog. But the catch is, I do not want to use ActiveX Control. I want the C# WPF User Control to be COM component and that COM component should be loaded on my other C++ MFC Dialog. ...
30 Oct 2023 by Member 16127436
const char on = 1; int iResult = setsockopt(udp_socket, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on)); if (iResult != NO_ERROR) { std::cerr
26 May 2023 by Saurabh Ashtaputre
I have a C# WPF User Control DLL. I want to show this User Control over a C++ MFC UI. For communication between them I am using C++ COM DLL (CLR enabled for this VS project). The IDL file has an entry for the COM function like this: [local]...
26 May 2023 by JudyL_MD
I think you need to put an out on the C# method itself so the compiler knows to pass the changed value back to the caller. Without the out, the changes to the parameter variable are only visible within the method.
15 May 2023 by Saurabh Ashtaputre
I have two DLLs, one is C++ MFC COM DLL and another is C# WPF User Control DLL. I want to have the communication between them to happen over COM itself. Is there any way to achieve this? PS: I have tried registering the C++ MFC COM DLL as COM...
15 May 2023 by KarstenK
The key problem is to register the library and create an instance in your code. Read COM Interop Sample: .NET Client and COM Server from Microsoft and try adapt it for you. Important is the statement using CLoan; which imports the library in...
7 Apr 2023 by Zouaoui Billel
Hello All; I am working on C++/MFC project where I need to use access control device SDK acualy I registred SKD DLL (using regsvr32.exe) to create a controller, after that I Open my MFC project and I added activex controller from the wizard, ...
12 Mar 2023 by hans.sch
I created a PowerShell script that accesses iTunes on my PC, but I failed at receiving events from the iTunes object. The code which I found on the internet (in fact, Chat GPT recommended this code) is: $eventHandler = {Write-Host...
31 Oct 2022 by flyhigh
By implementing a UI library and exporting its necessary components to lua script, we can create a beautiful UI and implement relevant logic in Lua script completely.
22 Aug 2022 by PaulaJoannAllen
I really need help, please. I look at the chart, and both series have the right values but don't display them, but they only display the first and last values. I managed to get the data for the columns to work, but then the x-axis did not...
22 Aug 2022 by PaulaJoannAllen
private void UpdateChartSeries() { Excel.Worksheet chartWorksheet = (Excel.Worksheet)frmFoodPantry.theWorkbook.Worksheets.get_Item("Totals");//Select the sheet the chart is on // Diaable the alearts ...
18 Aug 2022 by Vineeth.B
Hi, I have a C# library with some interfaces and need to use it from an MFC application. To accomplish this, i registered C# dll as COM and i used the COM interfaces from a C++ dll. This C++ dll is statically linked to the MFC app and uses its...
18 Aug 2022 by Michael Haephrati
To simplify things, if you place the DLL in the system directory (%SystemRoot%\system32). it will work. That would usually be: c:\Windows\System32
9 Aug 2022 by 0x01AA
If you register your 'COM Visible .NET Assembly' with regasm.exe you can place it (and it's dependencies) wherever you want. At least this works for me until today. "C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\RegAsm.exe"...
9 Aug 2022 by Richard MacCutchan
See Dynamic-Link Library Search Order - Win32 apps | Microsoft Docs[^].
11 Jun 2022 by Andrea Simonassi
The first and simplest of the multiplication algorithms, fast enough to multiply not too large numbers
16 May 2022 by Excel-lent
This article shows how to compile and execute OpenCL code from VBA.
28 Apr 2022 by free5lot
Camera_Net is a FLOSS library for using video-cameras and video-inputs in .NET projects easily
28 Mar 2022 by Bruce Ramsland
I know COM Port settings can be read and set using the Device Manager. However, I need to be able to obtain the BaudRate programmatically. What I have tried: I noticed that *some* COM Ports settings are included in the...
28 Mar 2022 by Richard MacCutchan
If you are talking about a Windows system then you can use GetCommConfig function (winbase.h) - Win32 apps | Microsoft Docs[^].
28 Mar 2022 by OriginalGriff
You can't get a baudrate, unless you have set it - it's not a "feature" that is transmitted as part of the communication between two devices unless they actively have a "negotiation phase" which is unbelievably rare and mostly only found in...
20 Mar 2022 by sridhar vattam
I am facing a strange issue where my UDP socket that was earlier bound to a port is not unbinding from the port when I call closesocket(). The API call doesn't return any error but netstat command and TCPView app still show that port is still in...
9 Mar 2022 by SiretT
Console app to share internet connection with other network interface
13 Jan 2022 by blyon
I would like to call a C++ COM dll from C# without having to register the COM object. I've read everything I can including closely following Registration-Free Activation of COM Components: A Walkthrough but I can't get it to work. It's fine if...
13 Jan 2022 by blyon
Changing the C# code in Form1.cs to: var sbsl = new SideBySideLib.SideBySideClass(); sbsl.Output(); fixed the problem.
18 Dec 2021 by Kai Schtrom
Win32_NetworkAdapterConfiguration WMI class in plain C and C++
27 Nov 2021 by Member 15445727
Hi From Excel VBA (Office365 on Win 10) I am trying to send a string to my new USB relay. It requires a Hex string "FF 01 01" to put the relay On, but it does not go On. I use the VBA code, which I have copied from "somewhere". I have also...
27 Nov 2021 by Member 15445727
Thank you, Dave The documentation says 9600 bps, no parity, 8 bits, 1 stop bit. And command to activate relay is Hex FF 01 01. I really dont know what to do else.
26 Nov 2021 by Dave Kreskowiak
The port may open, but are the parameters you specified the ones your device is expecting? You opened the port with a baud rate of 9600 bps, no parity, 8 bits, 1 stop bit. You're going to have to consult the documentation on your device to see...
26 Nov 2021 by Richard MacCutchan
VarString$ = "FF 01 01" That is what you are doing wrong. You are sending the ASCCI character string FF0101 instead of the actual hex (i.e. 8-bit) bytes FF0101. You need to use the VBA HEX function to get the correct values,...
27 Sep 2021 by Member 14167751
I have a problem with the termination character when sending a message on the GPIB. Default character is line feed and my instrument needs a carriage return. I´v tried to change it but when I sniffing at the bus it is still line feed. Anyone...
27 Sep 2021 by Luc Pattyn
This is how I understand the documentation: - TerminationCharacter is used during serial reads to locate end of message; - TerminationCharacter is optionally sent during serial writes, depending on the value of some "End Mode for Write". When...
4 Sep 2021 by Manidas Payyoli
Hi there, I am actuali doing some research work for my academic project. I can find solution in other excel opensource packages for this problem but still i wonder how to overcome this issue in Excel interoperability and i have to use that only. ...
3 Sep 2021 by Wendelius
if I understand your question correctly, the inner loop should start from the next row where the outer loop is. This way you won't find the same row as a duplicate. For example when i=123 then j should start from row 124 and so forth. Perhaps...
24 Aug 2021 by Manidas Payyoli
How to copy, Edit ,save an excel file in a specific Location in C# using excel interop? i have following method which will edit the existing same excel.But i want to copy the original excel file and edit 2 colums and save that as a diffrent...
24 Aug 2021 by Wendelius
You can use Workbook.SaveAs(Object, Object, Object, Object, Object, Object, XlSaveAsAccessMode, Object, Object, Object, Object, Object) Method (Microsoft.Office.Tools.Excel) | Microsoft Docs[^] method to save the opened file to a desired location...
8 Aug 2021 by Member 2237472
Years ago I wrote an application in VB.NET that opens Word documents to make certain corrections to them, and it has been running smoothly until now. The code is as follows: Imports Microsoft.Office.Interop.Word ... Friend WithEvents oWord As...
8 Aug 2021 by Member 2237472
This is not a solution, but... I have proceeded to change the declarations of the variables, as follows: Before: Friend WithEvents oWord As Word.Application Friend WithEvents oDoc As Document Now: Friend WithEvents oWord As Object...
26 Jul 2021 by Wendelius
Looking at the variables, you seem to have defined oWord twice and oDoc is not defined. So instead of Friend WithEvents oWord As Word.Application Friend WithEvents oWord As Word.Document try Friend WithEvents oWord As Word.Application Friend...
11 Jun 2021 by mohammed abdu
Hello, I have a multi touch frame that I want to communicate with and maybe write some code to do something when multi touch is active (this is for a work project). I have no idea what to do or how to do it (or if it is even possible). I...
11 Jun 2021 by Richard MacCutchan
Google has many links that will help you: Nexio HID Multi-Touch ATI0320-10 - Google Search[^]
20 Apr 2021 by Alexander Yumashev
The code compacts and repairs an MS Access database from C# code using a JRO.JetEngine COM-object. Binding occurs at runtime, no references, no interops. Pure System.Reflection.
19 Mar 2021 by Member 11520335
I was using VS 2013. Recently i have been asked to port into VS 2019 that COM componts. When i compile one of the project , i get this below error MIDL2003: redefinition : _xml_error msxml2.idl - File says // If, when importing this file...
22 Feb 2021 by grilialex
In scientific projects, it is often needed to sample sounds from remote locations, for classification or other purposes. As data link rates may be low or unreliable, transmitting raw samples to inland processing centers may not be an option. An alternative is to do off-line processing in batches.
11 Jan 2021 by Benktesh Sharma
How to create, modify and update Docker image from container
27 Dec 2020 by Jeremy Likness
In this post, I will continue the tradition which I started in a 2015 blog post of celebrating the year and looking back at highlights.
24 Dec 2020 by #realJSOP
The most correct answer is, don't use activex... It's a known security risk and is to be avoided at all costs. EDIT 2020.12.24 ======================= I can tell by the number of reputation points I lost (2) as a result of the recent down-vote,...
8 Nov 2020 by Richard Deeming
CLSID 00024500-0000-0000-C000-000000000046 refers to Microsoft Excel. The error means that Office is not installed on the computer where your code is running. If this is an ASP.NET application, you should read the following Microsoft...
8 Nov 2020 by Member 14987679
Request attachment is unable to be viewed.Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 8000401a What I have tried: Request attachment is unable to be...
8 Nov 2020 by Richard MacCutchan
The message is telling you that whatever class you are trying to instantiate is not registered on your system. Since you did not tell us what your code is trying to do so there is not much more that we can say.
8 Nov 2020 by rajesh482
I've implimented a ATL single thread apartment based project . class ATL_NO_VTABLE CMySrv : public CComObjectRootEx, public CComCoClass, public IMySrv In the method, I'm creating multiple worker...
15 Oct 2020 by Greg Atkinson
I have a legacy program written in C that I am having to add calls to a COM object. The problem I am having is passing the data to the functions in the COM module. I can pass literals to the module but how can I convert the variables to BSTR? ...
15 Oct 2020 by steveb
In C you can use MultiByteToWideChar Windows API
15 Oct 2020 by Richard MacCutchan
The SysAllocString function (oleauto.h) - Win32 apps | Microsoft Docs[^] takes a pointer to a Unicode string. So if you convert the string variable via MultiByteToWideChar function (stringapiset.h) - Win32 apps | Microsoft Docs[^] it should work.
30 Jul 2020 by DiponRoy
Making schedule jobs exe using Quartz scheduler
10 Jul 2020 by lenniscata
Back in VS2017, When referencing an Activex/OCX two files were created and referenced on Visual Studio Interop.XYZLib.dll AxInterop.XYZLib.dll from there I was able to create a wrapper around AxInterop.XYZLib.dll that exposed the methods and...
29 Jun 2020 by Member 14875971
Hello, we are developing software for a 'Smart Device' for WEC2013 using VS2013. Basis is a C++ ATL COM Project (ATL Simple Object with Connection points) using the 'Smart Device' specific SDK, which results in a DLL. That DLL is referend by a...
29 Jun 2020 by Richard MacCutchan
You cannot use a null GUID to refer to a COM interface. Check the actual value that it use to register itself.
4 Jun 2020 by Snuff Daddy
Put this meta tag in your html's : That is all. Nothing will change with editing because edge doesn't have an editor. But at least it will display HTML5 correctly.
4 Jun 2020 by MrT33
We have developed a Windows Desktop HTML/XSL editing application, written in C++ using MFC/ATL/COM technologies, relying heavily on MSHTML's IHTML* COM interfaces, like IHTMLElementPtr, IHTMLDocumentPtr, IWebBrowser2, and so on, making it easy for an end user to build a website.We are now...
3 Jun 2020 by Mehdi Gholam
I tried out many other RSS readers like RSSOwl (which is also unsupported) but none of them felt right, so I decided to write my own.
1 Jun 2020 by Lee P Richardson
This post is the story of how to generate an unauthenticated client.
6 May 2020 by Coder969
We have a com dll from third party and using that com dll from the vb script. We want to remove the third party dll and write our own dll with same name and object so that we dont need to change anything in our scripting code. I created the new...
6 Apr 2020 by James A. Brannan
Introduction AWS SQS Message Queues are a way to exchange messages between applications. Senders, send data objects to a queue and receivers, receive objects from a queue.
5 Apr 2020 by James A. Brannan
Exploring AWS KMS to encrypt and decrypt data via the AWS Java 2 SDK
20 Mar 2020 by MohanaManikandan
I'm fixing some PC Lint Plus Warnings and errors. The codebase has IDL files for COM structs. Hence the auto generated h files have virtual functions for COM class but no virtual destructor. Following is the snippet from auto-generated header...
7 Mar 2020 by James A. Brannan
In this tutorial, you create a simple Python client that sends records to an AWS Kinesis Firehose stream.
26 Feb 2020 by Lukasz Szyrmer
Experimenting with output using three different alternative ways of working
9 Feb 2020 by OwenDavies
How to non-interactively login to Azure with PowerShell
9 Feb 2020 by Sacha Barber
In this post I want to talk about how to get started with some very nice monitoring tools, namely Prometheus Grafana
27 Jan 2020 by IndianaRags
The data you are showing is binary. You are getting this because you are using a BinaryWriter to write the file. Try changing to a TextWriter.
27 Jan 2020 by Member 14589606
The output I am getting after I save it to the text file is: ?????8 00r L???? ???? ???r??000.j ?r???r?0?0000? ?r??L?r? ?????????r????r??L?r? &????&???? &I??Mr?? ?000000000 ????I?? ????&???? ???r?????r ???r??????0020 Lr??L?r? ?)???r?? 0000.90000. &r??&?r?...
27 Jan 2020 by Patrice T
Quote: ?????8 00r L???? ???? ???r??000.j ?r???r?0?0000? ?r??L?r? ?????????r????r??L?r? This is typical of a wrong setting of serial port. A serial port have settings and serial communication works only when the settings match on both sides. Settings are Baud rate (speed), bits,...
27 Jan 2020 by OriginalGriff
Chances are it's the serial port configuration, ort the data you are receiving isn't in the format you think it should be. Start with the debugger and look at exactly what you are getting from the device, and check that against your manual If the manual specifies it should be human readable...
26 Jan 2020 by CHill60
You have posted a link to the solution yourself! - C# Com Enum and VB6 - Stack Overflow[^] Follow the instructions found there. Failing that, you have to actually provide details of a problem for someone to be able to help you
14 Jan 2020 by Chris A. Johnson
This article explains exactly how to setup an SSL certificate for FREE on your Azure account. The existing free SSL with Azure only works on 'non-naked' domains, making it pretty much worthless. This is a 100% free method which ensures your site will be 100% secure.
14 Jan 2020 by honey the codewitch
Easily add scripting support to your apps using Microsoft's active script technology
29 Dec 2019 by essentialSQL
How to select top rows within a query
27 Dec 2019 by Dave Kreskowiak
First, you don't need TlbImp at all. Your VB6 .DLL needs to be registered before you can use it. To do that, you launch a CMD prompt and navigate to where your VB6 .DLL is. You then run REGSVR32 filename.dll to register your .DLL. Close the CMD window. Once that's done, in your C# project, in...
27 Dec 2019 by Viken Patel
i am trying to use ActiveX VB6 dll in c# .net application to Test COM, but it giving me run time error that class is not registered. i have tried registering in both 32bit and 64 bit application and also tried targeting the same What I have tried: I have created VB6 Project of ActiveX dll...
27 Dec 2019 by RickZeeland
Try running VS as Administrator (if you haven't done that already), otherwise take a look at the answers here: VB6 DLL Imported in C# .net project - Class not registered - Stack Overflow[^]
9 Dec 2019 by Fabrice Lacharme
Yet another slider/trackbar in C#
3 Dec 2019 by thoughts-on-coding
Matrices are a key concept in solving linear equation systems. Efficient implementations of matrices are not only considering computation complexity but also space complexity of the matrix data.
1 Dec 2019 by HUNT333R
Hi all, I try to send 1 character and 8 variables (26 bytes) from arduino as struct over com port, i receive something but my inexperience in C# do note help, I use this code to send data from arduino to app over com port. the first character sent Serial.write('/'); is to know when to start...
1 Dec 2019 by OriginalGriff
The first thing to note is that you can't define those structs in C, C++, or C# - variable names cannot start with a numeric digit in any of those languages. So quite probably, what you are sending / receiving is nothing like what you expected because that code will not compile, and you are...
28 Nov 2019 by Member 14370529
Im initializing a session session.Init("", "XX", "XX001", "62"); but I get below error System.Runtime.InteropServices.COMException (0x80040154): Retrieving the COM class factory for component with CLSID {13898C04-C674-4B4E-B5C0-D78AF3E566CA} failed due to the following error: 80040154...
28 Nov 2019 by Dave Kreskowiak
It's trying to tell you that the library you're trying to use isn't installed on the machine. Either that, or there something wrong with your setup where it cannot create an instance of the class you're trying to use. Possibly a dependency is missing (like a C++ runtime) or permissions on the...
25 Nov 2019 by Esraa Saady
i create a function in matlab called segment, and i want to call it from c# programit takes 2 argument "string and integer"and it returns 6 arrays this is my code : var activationContext = Type.GetTypeFromProgID("matlab.application.single"); var matlab =...
24 Nov 2019 by Stefan_Lang
Update 2: After some disagreements (see comments) I've finally found a good site to read up on COM: The Component Object Model - Win32 apps | Microsoft Docs[^]. While this doesn't directly disagree with anything I've said, it seems that, under the hood, COM is still very much alive in Windows....