views:

83

answers:

1

Hello

there is a code

var 
myobject:OleVariant;
begin
 myobject:=CreateOleObject('SomeNamespace.SomeClass');
end;

this com object has event OnClick for example. How must I connect to them without importing tlb?

Regards, Yuriy

+2  A: 

You are working with COM late-binding, so do you need write a lot of code to handle events. this task is not difficult if you know COM, basically do you need follow these steps.

you can found examples of this implementation on these links

try out these links for more info about COM, late-binding and events

RRUZ
Generally, links to experts-exchange.com are not very helpful...
Andreas Rejbrand
Andreas wasn't talking about the quality of the answers at Experts Exchange, @Rruz. Experts Exchange links aren't useful because unless you are a member or you arrive at the site via Google, the page doesn't show the text of any answers.
Rob Kennedy
ok @Rob, I had not realized that.
RRUZ
It's usually easy enough to get the Google cache though; visit the experts-exchange link, select the question title, right click and select 'search Google for ...'. For both of the links RRUZ provided it's the first hit.
Sertac Akyuz
@Rob, @Andreas, @RRUZ: experts exchange answers actually are **freely** available. Just scroll down... way, way down the page, and you'll find the answer that they are trying to get you to sign up for earlier on the page.
Marjan Venema
@Marjan: Where? I only see this: http://privat.rejbrand.se/ee.png And there is nothing below the box.
Andreas Rejbrand
thanks a lot. It was very helpful
Yuriy Vikulov
Guess again, @Marjan. The site only does that *if you arrive from Google*. If you arrive from the links the links on *this page*, you'll see nothing.
Rob Kennedy
@Rob, @Andreas: oh bugger, never thought it would make a difference form where you arrived. I guess, you could construct a google search to turn up the links as one of the first, but heck, why bother. Darn site.
Marjan Venema
@Rob, interesting, I never relaized that Marjan's way of accesing Expert Exchange only works from a google search page - I used it that way myself for years.
iamjoosy