Invoke from a Module

  • Thread starter Thread starter FNZB
  • Start date Start date
F

FNZB

Hi,

Does anyone know how to do the equivalent of me.invoke from within a
module?

Cheers..
 
Sorry, should have expanded on the question.

I can invoke a delegate within a forms class by creating a delegate sub
for another assembly event, small example below.

Private Delegate Sub dlgClient(ByVal index As integer)

private sub....
Dim dlg As New dlgClient(AddressOf Client)
me.invoke(dlg, New Object() {index})
end sub

Private Sub Client(ByVal index As Integer)
....

My problem is that im trying to do this within a Module because i
dont want to start my application from a form, however i do want to
display a form later. So Im currently using ...dlg.invoke... but when
i try to show the form from within the sub Client it runs the code fine
but the form doesnt show.

Im open to suggestions...

Thanks..
 
FNZB said:
Sorry, should have expanded on the question.

I can invoke a delegate within a forms class by creating a delegate
sub for another assembly event, small example below.

Private Delegate Sub dlgClient(ByVal index As integer)

private sub....
Dim dlg As New dlgClient(AddressOf Client)
me.invoke(dlg, New Object() {index})
end sub

Private Sub Client(ByVal index As Integer)
...

My problem is that im trying to do this within a Module because i
dont want to start my application from a form, however i do want to
display a form later. So Im currently using ...dlg.invoke... but
when i try to show the form from within the sub Client it runs the
code fine but the form doesnt show.

Im open to suggestions...

Thanks..

private sub....
Dim dlg As New dlgClient(AddressOf Client)
dlg(0)
end sub


Armin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top