slickred

Basically, is it possible Can I include an avi in my program rather than have to link to an external resource

Thanks,

SlickRed



Re: Visual Basic Express Edition Resourcing AVIs

slickred

I take it this isn't possible I am using a media player component in my program but rather than link to an avi stored elsewhere I'd link to include it in the program.

SlickRed





Re: Visual Basic Express Edition Resourcing AVIs

clint...

just add your media to resources and rename rockola

Private Sub Form1_Load(ByVal sender As Object, _

ByVal e As System.EventArgs) Handles Me.Load

Dim b As Byte() = My.Resources.rockolaa

Dim TheFIlePath As String = "My.Resources.rockolaa.wmv"

Dim TempFile As System.IO.FileStream = IO.File.Create(TheFIlePath)

TempFile.Write(b, 0, b.Length)

TempFile.Close()

WMP.URL = (TheFIlePath)

End Sub






Re: Visual Basic Express Edition Resourcing AVIs

slickred

Thankyou, I tried your suggestion but it won't work. I get the feeling I'm doing something stupid. I have added my avi (called nadeslide.avi) to my resources folder. However, when I type

Dim b As Byte() = My.Resources.nadeslide

i get an error 'nadeslide' is not a member of 'Resources'.

I have double check and nadeslide.avi is DEFINITELY in my resources.

Any ideas !





Re: Visual Basic Express Edition Resourcing AVIs

Vaughn Friesen

Copying the file to the resources folder doesn't make it a resource. To add the resource to your project, follow these steps:

Open the properties window, click Resources, then click Add Resource. Browse for the avi file and click Open. Then it should work.





Re: Visual Basic Express Edition Resourcing AVIs

slickred

I'm sorry if I'm being really thick but I just don't see it.

I have the properties window open, and I can select the resources folder in the solution explorer. But I don't see anything for Add Resource anywhere!

I did right click on the resources folder and clicked Add Existing Item... then browsed to the avi file and added it. Is that wrong

If so could you please explain in baby terms where to find the Add Resource button because I am feeling very stupid right now :)

Thankyou,

SlickRed





Re: Visual Basic Express Edition Resourcing AVIs

Vaughn Friesen

What you did should work. But you're still having trouble with My.Resources.nadeslide



Re: Visual Basic Express Edition Resourcing AVIs

Vaughn Friesen

In the resources window make sure the resource is called nadeslide.



Re: Visual Basic Express Edition Resourcing AVIs

slickred

I did :)

When I type

Dim b As Byte() = My.Resources.

a menu comes up with all my Resources, and the resources listed before and after nadeslide.avi are there, but not nadeslide.avi. So I figure nadeslide.avi must not be resourced Even though it is in my resources folder

:( I'm so confused....

SlickRed





Re: Visual Basic Express Edition Resourcing AVIs

clint...

in solution explorer

double click my project....which opens resources window.....choose file

then click add resource

good luck






Re: Visual Basic Express Edition Resourcing AVIs

slickred

Hmmmm...

When I double click on Resources in the Solution Explorer all that happens is that the Resources folder has it's properties displayed in the Properties window.

I still don't see anything that says "Add Resource".

SlickRed





Re: Visual Basic Express Edition Resourcing AVIs

DMan1

IN VB 2005 you can click on the "My Project" icon form the solution explorer...this will open the project properties window...now on the left side click the resources tab...and at the top of the resource tab select from the drop down "add resource" button "existing file"...then browse and open your avi file...it should now be included in the resources window




Re: Visual Basic Express Edition Resourcing AVIs

slickred

Hi DMan,

I have done that, and added the avi as a Resource using the Existing Item... thing.

But for some reason the code posted above in this thread still isn't working for me.

SlickRed