IT SOLUTIONS
Your full service technology partner! 
-Collapse +Expand
Delphi
Search Delphi Group:

Advanced
-Collapse +Expand Delphi To/From
To/FromCODEGuides
-Collapse +Expand Delphi Store
PRESTWOODSTORE

Prestwood eMagazine

June Edition
Subscribe now! It's Free!
Enter your email:

   ► MB LobbyPascal and Delphi Coding BoardDelphi Object PASCAL Topic   Print This    All Groups  

Importing interface

Importing interface in Delphi Object PASCAL topic (part of our Pascal and Delphi Coding group).

Quick Search: Importing   interface   Importing interface  
AnnA.C
 (Inactive)
Makati, -- PH
Dear All,

I am experiencing the following problem with Delphi. I want to develop a COM server application that would implement an Interface contained into a DLL downloaded from the web.
The interface describes a set of procedures. Among these procedures, there is one (named Execute) which I must cusotmize.

Since I am quite new to Delphi, I don't know how to do that. Can anyone please help me ?

Thank you in advance,
Seb
 Posted 16 years ago (Thread Starter)
Comment Quote
About AnnA.C -Collapse +Expand
Visit Profile
Inactive member.
Member does not subscribe to this thread.
Email Not Verified!
Once email is verified, we will review and approve the account.
Web Presence Hidden.
Once above is taken care of, full Profile content will display including back links, about me, my message, custom Profile html, social networking links, message board signature, company profile, etc.

Post ID #754, 4 replies
Thread Started 1/29/2001 7:01:00 AM
View Counter=1420
Last Reply Posted 2/7/2001 12:09:00 AM)
Location=Makati, -- PH 
Joined=14 years ago   MB Posts=4  
Larry J. Rutledge
Prestwood IT
Citrus Heights, CA USA
Lechelle,

Interfacing Delphi with COM objects is quite simple; however, I am unsure what you mean when you say you need to "customize" the Execute procedure.

If you want to alter the code for an existing COM object you will not be able to. You can, however, create a COM object that descends from the COM object you are working with and override the Execute method and do whatever you want.

If you need more information, please let me know what version of Delphi you are using as the COM support varies between versions.

Thanks,
Larry



------------------
Larry J. Rutledge

Programmer / Analyst
Prestwood Software & Consulting
7525 Auburn Blvd., #8
Citrus Heights, CA 95610


Old UBB Archived Link: [URL=http://www.prestwood.com]www.prestwood.com[/URL]


Serving your IT needs since 1984!
Larry J. Rutledge

Analyst

Prestwood Software

www.prestwood.com
 Posted 16 years ago
Comment Quote
About Larry J. Rutledge -Collapse +Expand
Visit Profile
Approved member.
Member subscribes to this thread with a verified email.
About Larry J. Rutledge
I worked for Prestwood Software as a Delphi developer from 1997 through 2002. During that time I enjoyed working with Mike Prestwood and the other developers at Prestwood.

Post ID #838 (Level 1.1)  Reply to 754
Thread Started 2/1/2001 3:59:00 PM
View Counter=2
Location=Citrus Heights, CA USA 
Joined=17 years ago   MB Posts=73   KB Posts=9  
Larry J. Rutledge
Prestwood IT
Citrus Heights, CA USA
Lechelle,

Thanks for the information, that is very helpful. I have downloaded the XML-RPC COM objects and will check them out this weekend. Then I will post a reply that explains how to import and use these objects.

In the meantime, if you are interested in COM programming, let me recommend an excellent book:

"Delphi COM Programming by Eric Harmon (Macmillan Technical Publishing - ISBN:1-57870-221-6). You can get more information about the book from
Old UBB Archived Link: [URL=http://www.newriders.com]http://www.newriders.com[/URL]


Larry

------------------
Larry J. Rutledge

Programmer / Analyst
Prestwood Software & Consulting
7525 Auburn Blvd., #8
Citrus Heights, CA 95610


Old UBB Archived Link: [URL=http://www.prestwood.com]www.prestwood.com[/URL]


Serving your IT needs since 1984!

[This message has been edited by Larry Rutledge (edited February 02, 2001).]
Larry J. Rutledge

Analyst

Prestwood Software

www.prestwood.com
 Posted 16 years ago
Comment Quote
About Larry J. Rutledge -Collapse +Expand
Visit Profile
Approved member.
Member subscribes to this thread with a verified email.
About Larry J. Rutledge
I worked for Prestwood Software as a Delphi developer from 1997 through 2002. During that time I enjoyed working with Mike Prestwood and the other developers at Prestwood.

Post ID #843 (Level 1.2)  Reply to 754
Reply Posted 2/2/2001 8:14:00 AM
Location=Citrus Heights, CA USA 
Joined=17 years ago   MB Posts=73   KB Posts=9  
AnnA.C
 (Inactive)
Makati, -- PH
Hi Larry !

It is so nice to have someone interested in my problem ! The version of Delphi I use is Delphi 5 Pro (but it doesn't mean I am a Pro ! In fact I am not even a developper !).

Here is a better description of my problem. I want to make use of the XML-RPC for COM library developed by Jan G.P. Sjim (http://home.hccnet.nl/jan.sijm/). This library contains a dll named XMLRPCS.dll which contains an XML-RPC server for COM and which contains the interface IXMLRPCServer. This interface declares the "Execute" method which must implemente the remote procedure.

Here is an example of what I tried to do:

*******************************************
unit server6;

interface

uses
ComObj, ActiveX, XMLRPCS_TLB, StdVcl;

type
Tcoclass5 = class(TAutoObject, IXMLRPCServer)
protected
procedure Execute(const sMethod: WideString; var vParams: PSafeArray; var vResult: OleVariant); safecall;
end;

implementation

uses ComServ;

procedure Tcoclass5.Execute(const sMethod: WideString; var vParams: PSafeArray; var vResult: OleVariant); safecall;
begin
write('Salut !!!');
end;

initialization
TAutoObjectFactory.Create(ComServer, Tcoclass5, Class_Server,
ciMultiInstance, tmApartment);
end.

*******************************************

I create a class Tcoclass5 which implements IXMLRPCServer and descends from TAuoObject. XMLRPCS_TLB is the unit generated after I imported XMLRPCS.dll.
The signature of Execute is as described in XMLRPCS_TLB. In the initialization section, I didn't really know what to put. So I put Tcoclass5, the name of the class I defined in this unit and I put class_Server (TServer being a class in XMLRPCS_TLB which is generated as a component wraper when you import the type library XMLRPCS.dll.

I compile everything (Delphi does not tell me off !!!). However it crashes at run time (error 217). I cannot even register the COM object.

Do you have, Larry, an idea of what could cause this problem ?

Regards,
Seb
 Posted 16 years ago (Thread Starter)
Comment Quote
About AnnA.C -Collapse +Expand
Visit Profile
Inactive member.
Member does not subscribe to this thread.
Email Not Verified!
Once email is verified, we will review and approve the account.
Web Presence Hidden.
Once above is taken care of, full Profile content will display including back links, about me, my message, custom Profile html, social networking links, message board signature, company profile, etc.

Post ID #840 (Level 1.3)  Reply to 754
Reply Posted 2/2/2001 12:56:00 AM
Location=Makati, -- PH 
Joined=14 years ago   MB Posts=4  
Most Recent Post
AnnA.C
 (Inactive)
Makati, -- PH
Dear Larry,

I have also found out that you will need to have the following dll registered : MSVBVM60.dll in order to be able to register Base64.dll and all the other XMLRPC*.dll that come with the XML-RPC for COM library.

Regards,
Sebastien
 Posted 16 years ago (Thread Starter)
Comment Quote
About AnnA.C -Collapse +Expand
Visit Profile
Inactive member.
Member does not subscribe to this thread.
Email Not Verified!
Once email is verified, we will review and approve the account.
Web Presence Hidden.
Once above is taken care of, full Profile content will display including back links, about me, my message, custom Profile html, social networking links, message board signature, company profile, etc.

Post ID #914 (Level 1.4)  Reply to 754
Reply Posted 2/7/2001 12:09:00 AM
Location=Makati, -- PH 
Joined=14 years ago   MB Posts=4  

Revive Thread!

Add a comment to revive this old thread and make this archived thread more useful.

Write a Comment...
Full Editor
...
Sign in...

If you are a member, Sign In. Or, you can Create a Free account now.


Anonymous Post (text-only, no HTML):

Enter your name and security key.

Your Name:
Security key = P1225A1
Enter key:
Icon: A Post    Thread    Idea    Important!    Cool    Sad    No    Yes    Includes a Link...   
Thread #754 Counter
1420
Since 4/2/2008
-
   Contact Us!
 
Have a question? Need our services? Contact us now.
--Mike Prestwood

Call: 916-726-5675

email: info@prestwood.com


Go ahead!   Use Us! Call: 916-726-5675 


©1995-2017 Prestwood IT Solutions.   [Security & Privacy]