BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Need help on easy stuff - Type Library Editor - PLEASE HELP

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi OLE Automation
View previous topic :: View next topic  
Author Message
Brad M
Guest





PostPosted: Mon Jun 20, 2005 2:02 am    Post subject: Need help on easy stuff - Type Library Editor - PLEASE HELP Reply with quote



So I'm trying to do some easy stuff, but I'm clearing doing something
wrong, and it has been years since I did this stuff.

I have an app in which I want to expose a COM object, so another app can
get some info from it. I tried just creating my COM object in the app,
but that wasn't working, so I tried to create an ZctiveX Library and put
the COM Object in there.

All I really want to do is have this object hold some string data. Seems
simple. So I go to the type Library editor, and add a property. Two
appear, a put and a get. Seems logical. Now what combination of
Attribute | Return Type and Parameters | Return Type and Parameters |
Modifier | Type do I need to make this work? Setting everything to
WideString just gives me "Inconsistent Property Functions"? I'm
completely lost, and of course, am on the road, so I don't have my
Delphi COM book with me.

Please help!!!
Back to top
John Carlyle-Clarke
Guest





PostPosted: Mon Jun 20, 2005 8:17 am    Post subject: Re: Need help on easy stuff - Type Library Editor - PLEASE H Reply with quote



Brad M <Windopaene (AT) noYAHspamformeOO (DOT) COM> wrote in
news:42b623a6$1 (AT) newsgroups (DOT) borland.com:


Quote:
All I really want to do is have this object hold some string data.
Seems simple. So I go to the type Library editor, and add a
property. Two appear, a put and a get. Seems logical. Now what
combination of Attribute | Return Type and Parameters | Return
Type and Parameters | Modifier | Type do I need to make this
work? Setting everything to WideString just gives me "Inconsistent
Property Functions"?

Are you using the editor in IDL mode or Pascal mode?

IDL Mode:

All methods should return HRESULT. Getter should have one parameter,
type BSTR, modifier [in]. Setter should have one parameter, type
BSTR*, modifier [out, retval].

Pascal Mode:

With the caution that I never use this mode, it looks like Getter
should have no paramters (but the type on the attributes tab must be
set to widestring), and the setter should have one parameter, type
widestring, no modifiers.

Normally, once you add the property, on the Attributes tab you set the
type, and this does everything for you automatically.

Back to top
Brad M
Guest





PostPosted: Mon Jun 20, 2005 1:16 pm    Post subject: Re: Need help on easy stuff - Type Library Editor - PLEASE H Reply with quote



John Carlyle-Clarke wrote:
Quote:
Brad M <Windopaene (AT) noYAHspamformeOO (DOT) COM> wrote in
news:42b623a6$1 (AT) newsgroups (DOT) borland.com:



All I really want to do is have this object hold some string data.
Seems simple. So I go to the type Library editor, and add a
property. Two appear, a put and a get. Seems logical. Now what
combination of Attribute | Return Type and Parameters | Return
Type and Parameters | Modifier | Type do I need to make this
work? Setting everything to WideString just gives me "Inconsistent
Property Functions"?


Are you using the editor in IDL mode or Pascal mode?

IDL Mode:

All methods should return HRESULT. Getter should have one parameter,
type BSTR, modifier [in]. Setter should have one parameter, type
BSTR*, modifier [out, retval].

Pascal Mode:

With the caution that I never use this mode, it looks like Getter
should have no paramters (but the type on the attributes tab must be
set to widestring), and the setter should have one parameter, type
widestring, no modifiers.

Normally, once you add the property, on the Attributes tab you set the
type, and this does everything for you automatically.
Thank you. I got it to accept what I wanted finally, though I didn't

quite do this. Still, the damn thing doesn't work. How does one control
whether you are creating an in process or out of proccess server?

Back to top
Marin Atanasov
Guest





PostPosted: Thu Jun 30, 2005 9:57 am    Post subject: Re: Need help on easy stuff - Type Library Editor - PLEASE H Reply with quote

If you want to "publish" some information from one application to another
both written by you?
The easiest way to do that for me was to add automation object to
application that serves data.
The only problem is that if client wants to "establish connection" i.e. to
create COM object is that Windows will start automatically your application
which implements COM object. If you don't want to do that is to read on
http://www.blong.com/Conferences/IConUK2000/DelphiMoreAutomation/More%20Automation%20In%20Delphi.htm
Additional Feature that Automation Object gives you is that you can tell
your "server" application to do something ... like MS Word can i.e. create
new document, close, etc.
/Marin

"Brad M" <Windopaene (AT) noYAHspamformeOO (DOT) COM> wrote

Quote:
So I'm trying to do some easy stuff, but I'm clearing doing something
wrong, and it has been years since I did this stuff.

I have an app in which I want to expose a COM object, so another app can
get some info from it. I tried just creating my COM object in the app, but
that wasn't working, so I tried to create an ZctiveX Library and put the
COM Object in there.

All I really want to do is have this object hold some string data. Seems
simple. So I go to the type Library editor, and add a property. Two
appear, a put and a get. Seems logical. Now what combination of Attribute
| Return Type and Parameters | Return Type and Parameters | Modifier |
Type do I need to make this work? Setting everything to WideString just
gives me "Inconsistent Property Functions"? I'm completely lost, and of
course, am on the road, so I don't have my Delphi COM book with me.

Please help!!!



Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi OLE Automation All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.