Microsoft.Vsa.IVsaItems question

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am having a little trouble with this bugger. I am trying to add a non event object to my script code, but it doesnt seem to work correctly. I can add objects with events just fine by doing the followin

Public Sub AddObject(ByVal Name As String, ByVal Type As String, ByRef Instance As System.Object, ByVal AssemblyName As String, Optional ByVal Events As Boolean = True

Microsoft.Vsa.IVsaItems.AddEventSource(Name, Type
My_Class_Implementing_IVsaSite.AddEvent(Name, Instance

End Su

The AddEvent adds the name and instance into a new hashtable and returns it to IVsaSite.GetEventSourceInstance

If I add an object that does not contain any events I will still get the same generated script something like the follwing

<System.ContextStaticAttribute()> Public WithEvents Name As Typ

This will throw errors about not having any events, but if i remove the WithEvents, I can still run the scripts and get to the data in those variables from the script i.e

<System.ContextStaticAttribute()> Public Name As Typ

Sub Mai
Msgbox(Name.Property,,"Global Value"
End Su

This seems like quite a hack to go and just remove the WithEvents in order to get this working correctly. Hopefully someone may be able to point me in the right direction. Thank
 
Actually, after a bit of diggin in the msdn, i found my solution with the IVsaGlobaltem. By creating a new hashtable and returning it to GetGlobalInstance seems to be working

Thanks
 
Back
Top