Forum > Windows


(1/3) > >>


is it possible to create a COM-Client with Freepascal under Windows? I think it should as Freepascal supports COM-Interfaces, but I didn't find any information on how to connect to a COM-Server. I only found some OLE and ActiveX examples, but I guess thats something else.

See below C++ code snippet, I want to achive the same with freepascal. As far as I understand the #import directive gathers the type information of the COM object, so for a successful compilation the compiler already has to retrieve type information. Is it possible or is there a workaround to gather the type information in other means and to translate it to Pascal 'headers'?

--- Code: C  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---#import "libid:BD962F0D-A990-[...]" no_namespace   CoCreateInstance(__uuidof(NNNNDeviceList), [...] 

Edit: Removed brand name.

The FPC type importer is called importtl. 

Thanks, I'll have a look! And then perhaps ask further :)

There are some com related bug reports in the trackers that have good examples.


--- Quote from: kupferstecher on November 22, 2023, 06:43:23 pm ---is it possible to create a COM-Client with Freepascal under Windows?
--- End quote ---
Of course it is. OPC DA is based on COM, so you can also take a look at it.


[0] Message Index

[#] Next page

Go to full version