msvisual.com Forum Index
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How should i implement a delegate in VB6?

 
Post new topic   Reply to topic    msvisual.com Forum Index -> VB Syntax
Author Message
Joris van Lier



Joined: 04 Oct 2007
Posts: 12

PostPosted: Sun Dec 17, 2006 10:09 pm    Post subject: How should i implement a delegate in VB6? Reply with quote

I need to implement delegates in VB6, having some experience in C# and read
about AddressOf in VB6 but am not sure how to call the procedure at the
address.

The application should evaluate the state of certain variables and call a
corresponding method, the operators of the expression being evaluated and
the resulting method to be called should be configurable without touching
the code. Have read about CallByName, but need a solution that's as fast as
possible because app will be talking to a PLC

Archived from group: microsoft>public>vb>syntax
Back to top
View user's profile Send private message
Bob O`Bob



Joined: 04 Oct 2007
Posts: 1456

PostPosted: Sun Dec 17, 2006 9:28 pm    Post subject: Re: How should i implement a delegate in VB6? Reply with quote

Joris van Lier wrote:
> I need to implement delegates in VB6, having some experience in C# and read
> about AddressOf in VB6 but am not sure how to call the procedure at the
> address.
>
> The application should evaluate the state of certain variables and call a
> corresponding method, the operators of the expression being evaluated and
> the resulting method to be called should be configurable without touching
> the code. Have read about CallByName, but need a solution that's as fast as
> possible because app will be talking to a PLC


It would probably be best to explain what it is that you actually need
without expecting knowledge of other languages' terminology.

And maybe some specifics about what you have tried and why it was
found inadequate.



Bob
--
Back to top
View user's profile Send private message
Tony Proctor



Joined: 04 Oct 2007
Posts: 1051

PostPosted: Mon Dec 18, 2006 3:28 pm    Post subject: Re: How should i implement a delegate in VB6? Reply with quote

CallByName is the standard VB way, although the call is bordering on being
brain-dead (see
http://groups.google.ie/group/microsoft.public.vb.com/browse_frm/thread/0444c10d72f15cae/b3e094976a617518?&hl=en#b3e094976a617518).

Matt Curland's VB book explains better ways of doing it, although I use
InvokeHook and InvokeHookArray from TLBINF32.DLL (which I think he wrote
anyway)

Tony Proctor


"Bob O`Bob" wrote in message@TK2MSFTNGP02.phx.gbl...
> Joris van Lier wrote:
> > I need to implement delegates in VB6, having some experience in C# and
read
> > about AddressOf in VB6 but am not sure how to call the procedure at the
> > address.
> >
> > The application should evaluate the state of certain variables and call
a
> > corresponding method, the operators of the expression being evaluated
and
> > the resulting method to be called should be configurable without
touching
> > the code. Have read about CallByName, but need a solution that's as fast
as
> > possible because app will be talking to a PLC
>
>
> It would probably be best to explain what it is that you actually need
> without expecting knowledge of other languages' terminology.
>
> And maybe some specifics about what you have tried and why it was
> found inadequate.
>
>
>
> Bob
> --

Back to top
View user's profile Send private message
Display posts from previous:   
Related Topics:
Method ... does not have the same signature as delegate ... Please can anyone help a delegate newbie. I am upgrading some VB6 code ... Add a delegate for AddressOf MidiIN_Proc midiError = mMPU401IN, AddressOf MidiIN_Proc, 0, and am getting the error ... Meth

Implement C Interface in VB I am writing a Plugin Architecture where the application sends messages to the Plugins (Com Server DLLs) and the Plugin does some work. The problem is there are different kinds of messages so in C - I went by this definition: HRESULT Me

VBscript to implement TCP/IP sockets I need to implement TCP/IP sockets in VBscript. Does anyone have a code snippet that does this? Without a new tool. My system does not allow installation of new tools. The socket must open, connect, listen, send, receive and cl

implement Save button Hi, Is there any other way to implement a SAVE function without implementing an Action Class? This is the generic problem: 1) I have a grid 2) I read the data from the database to the grid 3) Users may do whatever they want with the grid 4) Changes are no

Events in Implement interface I have a program which has several class' sharing an implemented interface. I would like this reference to the implemented interface to be able to recieve an event. My interface definition for what I call "DynCalc" looks like this:
Post new topic   Reply to topic    msvisual.com Forum Index -> VB Syntax 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, 2005 phpBB Group