Genesys CTI User Forum

Genesys CTI User Forum => Genesys-related Development => Topic started by: cavagnaro on October 02, 2008, 05:00:00 AM

Title: Create new extensions objects on the fly
Post by: cavagnaro on October 02, 2008, 05:00:00 AM
Hi guys,
I have a dumb question but I have forgot how to do it...  :-\
I have my VB 6 project with ActiveX for monitor some extensions, now I need to create extensions (TExtension) object on the fly meaning add more of them to monitor more DNs based on some events.

I'm trying to do:

Dim vExtension As DesktopToolkitX.TExtension
Set vExtension = New DesktopToolkitX.TExtension

However it is not working  :-\

Can somebody please refresh my mind???

Thanks!
Title: Re: Create new extensions objects on the fly
Post by: cavagnaro on October 03, 2008, 01:52:38 AM
Nobody?...
Title: Re: Create new extensions objects on the fly
Post by: Jiggolo on October 03, 2008, 07:14:23 AM
Hello Cavagnaro
I used to implement VB6 with ActiveX.  I created a TExtension object on my form and make index for this object is 0.

This is TExtension create:

For i =1 to numExt
      '***Create TExtension object
      Load myForm.TExtension(i)
        myForm.TExtension(i).ConnectionName = TConnection.ConnectionName
        myForm.TExtension(i).ExtensionName = "TExtension" & i
        myForm.TExtension(i).TDN = TDN
        myForm.TExtension(i).TQueue = TQueue
Next i

This is TExtension Event on the form:

Private Sub TExtension_TEvent(Index As Integer, EventInfo As DesktopToolkitX.TEventInfo)
'**** Event data
End sub

I am not sure these are solution you mean or not.
Title: Re: Create new extensions objects on the fly
Post by: cavagnaro on October 03, 2008, 08:23:02 PM
;D not exactly but I can work with this  ;D Thanks a lot for the idea  :D
Title: Re: Create new extensions objects on the fly
Post by: victor on October 06, 2008, 02:26:12 AM
Hi, Cav,

what is wrong with this one?

Vic
Title: Re: Create new extensions objects on the fly
Post by: cavagnaro on October 06, 2008, 02:58:24 AM
I was thinking on how to create an extension each time I receive an event that is under a public function. I believe with this I can do the job, will move on and update :)
Thanks a lot
Title: Re: Create new extensions objects on the fly
Post by: victor on October 06, 2008, 04:23:40 AM
I think this should do the job. Just make sure to add the object in a form first with index 0. :)
I still have to figure out how to do it without having a form thought :(
Title: Re: Create new extensions objects on the fly
Post by: cavagnaro on October 06, 2008, 04:50:17 AM
Yeah, would like that too, I have been testing and no good result with my code, don't know what can be missing
Title: Re: Create new extensions objects on the fly
Post by: barleycorn on October 06, 2008, 05:12:15 AM
I haven't used VB6 in years now, but seem to remember doing something similar to this too.  Is it possible that the control needs a parent (typically a form)? If so, you could just have a non-visible form, or an non-visible panel object as its parent, or something like that.
It's interesting.... I might have to dig out my Windows 2000 virtual machine to play around with it. :-)
Title: Re: Create new extensions objects on the fly
Post by: cavagnaro on October 06, 2008, 05:31:59 AM
Thanks for the idea, will try that as well, however the perfect scenario is that no form is needed. Something to be able to use like a DLL...