Hey guys, long time no see.
I have searched everywhere on the internet and I couldn't find an answer.
The problem is at school due the threat of viruses you can't add components.
So instead I have to reference them and load them at runtime.
I can get it working for most things but I am having problems with the flash control.
This is my code:
Code:
Dim flash As ShockwaveFlash
Call Controls.Add("ShockwaveFlash.ShockwaveFlash.10", "flash")
Set flash = CreateObject("ShockwaveFlash.ShockwaveFlash.10")
This returns with a type mismatch.
So then I try:
Code:
Dim flash As ShockwaveFlashObjects.FlashProp
Call Controls.Add("ShockwaveFlash.ShockwaveFlash.10", "flash")
Set flash = CreateObject("ShockwaveFlash.ShockwaveFlash.10")
But then I can't use the "LoadMovie" function.
I am left really confused...
Any ideas anyone?
Because it returns a "ShockwaveObjects.FlashProp" which isn't want I'm wanting.
Also the only Flash control that allows WithEvents is "ShockwaveObjects.Shockwave"
Now do you see my problem?
Note: I got the name "ShockwaveFlash.ShockwaveFlash.10" from regedit.
I need to load them at runtime.
I can't load them at design time.
If I try to add new components, VB crashes.
So I can't use the Load() function.
Any more ideas?
I need to load them at runtime.
I can't load them at design time.
If I try to add new components, VB crashes.
So I can't use the Load() function.
Any more ideas?
What post #3 describes is a method for adding them at runtime. I've attached a demo.
Ok, now as I said earlier the Load() function doesn't work for me.
I can't initially have one on the form, I need to do everything at runtime.
Here is an example from another application I made:
Code:
Dim WithEvents wsSend As Winsock
Private Sub Form_Load()
Set wsSend = New Winsock
wsSend.Protocol = sckUDPProtocol
wsSend.LocalPort = 1233
wsSend.RemoteHost = "255.255.255.255"
wsSend.RemotePort = 1234
wsSend.Bind
End Sub
See what I am aiming for now?
In stead of adding them as components I add them as a reference.
Has anybody done this before?
Private flash As Object
Private Sub Form_Load()
Set flash = Me.Controls.Add("ShockwaveFlash.ShockwaveFlash.10", "flash")
'or
'Set flash = CreateObject("AxShockwaveFlashObjects.AxShockwaveFlash")
End Sub