Re: COM interfaces



Hi Vertuas!
Accessing COM-Server from delphi is not a big issue. There is some documentation provided with delphi itself. Search for s.th. like "Creating a COM-Client". Usually it's all about Importing a Typ Library calling the Create or CreateRemote function of the Co-Class and Using the interface.


However if you want to know more about COM or start writing a COM-Server I would suggest to sneak into a good book. I don't know a book regarding COM specifically for delphi, but there are a lot of books and even web pages(you could possibly search for "Introduction Component Object Model") regarding COM itself. It's err... a little sophisticated topic, this COM-stuff. In the first 6 month you usually see nothing than mist and after that you always have the feeling you look throug a haze. But it's no magic!

IMPORTANT: If you access a COM-Server in your program always remember to make sure the COM-Server is available and registered on the Target System!

To give you short Idea of how to access a COM-Server here are some code snippets. They perform a XSL-Transformation:

"
var
  xmlDoc, xslDoc: IXMLDOMDocument2;
  s: String;
  error: IXMLDOMParseError;
  i: integer;
begin
  try
    xmlDoc := CoDOMDocument30.Create;
    xmlDoc.async := False;
    xslDoc := CoDOMDocument30.Create;
    xslDoc.async := False;
    xmlDoc.loadXML(sXMLData);
    xslDoc.loadXML(sXSLData);
    xmlDoc.validateOnParse := False;
    xmlDoc.resolveExternals := False;
    s := xmlDoc.TransformNode(xslDoc);
    error := xmlDoc.parseError;
    Result := error.reason;
"

brgds
Sven

dvddude schrieb:
Hello all,

I an trying to use some COM interface things from delphi, i have an SDK and everything is accessed through interfaces :o(

Could someone point me in the right direction to a web page that explains how to call COM Servers from delphi please?

Thanks

Vertuas


.



Relevant Pages

  • Re: Anbindung COM-Objekt
    ... Selbiges hat keine IDispatch-Implementierung. ... Leider hab ich auch keinen Tipp, hab aber mal einen COM-Server in Delphi ... In Delphi gibt es einen "Automatisierungsobjekt-Experten" der ...
    (microsoft.public.de.fox)
  • COM Server <-> keine Konstruktoren?
    ... Ich versuche mit einer VS2005 Applikation auf einen "alten" COM-Server, ... Andere "Delphi - Applikationen" haben aber kein Problem, ... COM-Server zuzugreifen, folglich gehe ich davon aus, dass ich etwas verkehrt ...
    (microsoft.public.de.german.entwickler.dotnet.csharp)
  • Error when opening Project file (COM-Server)
    ... we are working in a team using CVS to share source. ... COM-Server, which i cannot open any more. ... All my collegues have no problem with opening this file, ... Reinstalling delphi and unregistering and ...
    (borland.public.delphi.ide)
  • Re: Verbindung mit Tabelle im Internet
    ... danke, COM-Server habe ich schon geschrieben, allerdings ... nehme ich dafür immer Delphi. ... direkt den Pfad anzusprechen. ... Ich werde es einfach einmal ausprobieren ...
    (microsoft.public.de.fox)