
ActiveX-Exe: .Value=True doesn't work while direct click on button works
Quote:
> When I click on the button on the mForm, an event is raised in both the
> ActiveX-Exe and the Client.
> However if I set a timer to call "me.btnNofication.Value=True", the event
> is raised ONLY in the ActiveX-exe.
> Can anybody help?
I was hoping someone would jump in and ask for more info.
Any problem you may be having isn't caused by the code below, even though I
had to double-check to believe you were able to expose a VB command button
to "the world". That doesn't seem right to me, for some reason.
All of those Publics scare the heck out of me. Do they need to be Public?
You do know that, since your form's declared Public in a module, all
instances of the class will be sharing the same global and stomping on each
others values, right?... that means, if the class init method creates an
instance of the form and your app creates more than one instance of the
class, only the last instance created will be holding a reference to the
object variable that'll be raising events. Any other loaded forms will be
firing events into "thin air"
You say the client app's not getting the events when using a timer... place
some debug.prints in there and add a temporary property you can set to let
you know who VB "thinks" the client is.... basically, there's not enough
info in the post to give any "here, do this" type answers... no "client
side" code at all.
Quote:
> 1) a module with the declare
> "Public mForm As frmMain"
> 2) a class module with
> Public WithEvents eButton As CommandButton
> Private Sub Class_Initialize()
> Set mForm = New frmMain
> Load mForm
> mForm.Show
> Set eButton = mForm.btnNotification
> End Sub
> Private Sub eBtnNotification_Click()
> Call Beep(500, 100)
> RaiseEvent Notification
> End Sub
> 3) A form "frmMain" with a command button.
--
Ken Halter - MS-MVP-VB - Please keep all discussions in the groups..
In Loving Memory - http://www.vbsight.com/Remembrance.htm