Register to post in forums, or Log in to your existing account
 

Post new topic  Reply to topic     Home » Forums » zApp Developers
theNerd
Adept


Joined: 01 Mar 2005
Posts: 277

PostPosted: Wed Nov 09, 2005 4:08 pm   

Exposing zApp Object Events
 
Zugg,

How difficult would it be for you to expose the zApp events so that when I make references to zApp objects from with in VB, VB can also receive the events? Right now I can early bind to zApp objects but I cannot use the WithEvents clause. Now that I have two applications out I am rewriting the interface for one (that is coming out next) to use zApp. zApp will be key in the interface design but for security and speed my ActiveX object will early bind to some zApp objects so that on certain events I can set certain values, unlock certain things, perform CPU intensive actions, just be so handy, etc. Plus, early binding is %3000 percent faster than late binding.

Here is a very generic example of what I mean:

Code:
Dim WithEvents zAppCore As zapp.Core

' This is set from within the zApp script
' Example:
'   Set oMyActiveX = CreateObject("ActiveX.MyClass")
'   Set oMyActiveX.zAppCoreRef = Core
Public Property Set zAppCoreRef(oRef As zapp.Core)
    Set zAppCore = oRef
End Property

' When this event happens in zApp this is also automatically triggered
Private Sub zAppCore_OnLoad()
    ' Set unlock code to certain things.
    ' Perform some calculations that would be faster
End Sub
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23377
Location: Colorado, USA

PostPosted: Wed Nov 09, 2005 5:00 pm   
 
Very difficult actually. Early binding requires a Type Library, which essentially means making all of the zApp components available externally as real COM objects. This would violate the licensing terms of the 3rd party components in zApp, such as the DevExpress components. If you could use these components directly from VB (or any other language) then it would mean that instead of spending $1000 on the DevExpress components, you could just use them via zApp for $30. And that's obviously a big violation of the DevExpress terms and conditions.

Also, early binding (requiring a type library) requires that the interface be static (compiled) and the whole concept of zApp is for dynamic (interpreted/scripted) interfaces.

I'm afraid you are stuck with the existing method which is to have zApp call various methods of your ActiveX object from within it's own events.
Reply with quote
theNerd
Adept


Joined: 01 Mar 2005
Posts: 277

PostPosted: Wed Nov 09, 2005 5:29 pm   
 
Zugg,

Just for clarification, I'm not intending on using the zApp stuff in my app, just the other way around. I don't know if what I wrote made it sound like I wanted to use the DevExpress controls on my forms. My interface and much code will be in zApp itself (except the very CPU intensive and the key unlock for some 3rd party ActiveX.) The DLL will be used just the same as any ActiveX DLL would be used but I could "hide" code in the ActiveX. For example, rather than calling an "Init" function from VBScript to my DLL (which could be viewed through the Script Debugger) a particular zApp event would automatically call my Init function.

It's no real big deal, though. It was more a request for convenience. I definately wouldn't want you to violate any license.

BTW, what I am writing with zApp now is exactly the type of application zApp is tailored to and may be a good showcase piece. I'll PM you with the details just to give you a heads up.
Reply with quote
theNerd
Adept


Joined: 01 Mar 2005
Posts: 277

PostPosted: Wed Nov 09, 2005 6:14 pm   
 
I can already do early binding I just don't get the events. How about this (I know your time is tight but let me know what you think.) Have an object that exposes a limited set of events. It will have, as an example, OnAppStart, OnAppEnd, OnWindowOpen(ID), OnWindowClose(ID), etc. Just a few events like those would be very useful. It would be very useful for hiding security code in there, along with certain actions.

Hopefully, you get my drift of what I want to do.
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23377
Location: Colorado, USA

PostPosted: Wed Nov 09, 2005 7:04 pm   
 
I think what you are getting is the early binding for the actual COM objects, such as "core", "str", "net", etc. Those are real COM objects with a real type library. But none of these objects have any events. The events are generated by the visual components (Edit, Memo, Button, etc) and you shouldn't be able to get early binding for those because they are not published COM objects.

For example, the OnWindowOpen is generated by the Window component (the OnOpen event) which doesn't have a COM interface.

OnAppStart and OnAppEnd *might* be possible, since those would be generated by the "core" object, which *does* have a COM interface. Other events fed through the core object might be possible.

But honestly, right now I'm totally involved in zMUDXP and won't be able to release a new zApp for several weeks.
Reply with quote
theNerd
Adept


Joined: 01 Mar 2005
Posts: 277

PostPosted: Wed Nov 09, 2005 7:16 pm   
 
Your right. My mind was on those COM objects and I wasn't even thinking about the DevExpress controls, but that is what I originally was talking about.

Just some basic ones like you mentioned would be very helpful. No rush, I realize you have your hands full at the moment.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zApp Developers 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
© 2009 Zugg Software. Hosted on Wolfpaw.net