🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.lang.pascal.delphi.components.writing
1 messages
1 total messages Started by Martin Harvey Thu, 06 Nov 1997 00:00
HELP!! Advanced Problem: FindClass,GetClass,RegisterClass(es).
#11
Author: Martin Harvey
Date: Thu, 06 Nov 1997 00:00
48 lines
2854 bytes
Hi all,

Yet another subtle and insiuous problem here:

I'm writing a communications protocol that requires polymorphic
construction of objects which are being transferred from one machine
to another. In some ways, it's very much like the delphi streaming
system.

For part of this protocol I need to convert type TClass into it's
string representation *and vice versa*.

The first part is easy, TObject has a class function called
"ClassName".

However, the second part is more tricky: In order to convert from a
string representation to something of type TPersistentClass, I need to
use either FindClass or GetClass. However, In order to use these, I
suspect that I have to register my classes first using RegisterClass.

So, here's the conundrum. RegisterClass says that it registers certain
classes with the Delphi Streaming system. Does this mean that it
alters the innards of the IDE in some way? Do I only ever have to call
it once? Or is it something that you have to call every time you run
your program?

However it registers the classes, I need to be sure that this process
will enable me to use these class functions correctly on machines with
no Delphi IDE, so that I can transfer ClassName strings from one
machine to another and transfer a data structure from one machine to
another. I'm not using the entire Delphi streaming system, most of it
is a streaming system of my own devising, I just need this particular
set of functions.

In addition to this, The protocol that I'm specifying states that
(partially) incompatible versions of the protocol can be used, so that
if the reciever doesn't recognise the classes of objects it's being
sent, it simply goes up the inheritance heirarchy until it finds a
class that it does recognise, and unmarshalls an object as that parent
class.

Can anyone out there (borland folks?) offer some help and advice?

I would appreciate a reply cc to my email address, since the Cambridge
University news server doesn't host the borland groups :-(

Martin Harvey.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads