• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 151
  • Last Modified:

compiling and only one exe file

Hi all

I have a swf flash file embedded in vb application (vb 6.0)
now it is running but there are two files swf and vb application

When i compile it, i need only one exe file, that is vb application and swf file is compiled together (only one exe file)

I tried to use VB Recouse Editor, but i couldnt use it

How can i compile them together

thanks in advance

  • 3
  • 2
1 Solution
Why couldn't you use the resource editor? You have to add them as Custom Resources.
nurbekAuthor Commented:
I added to custom Resources

calling like
myFlash.Movie = LoadResData(101, "CUSTOM")

but it doesnt show the swf object
nurbekAuthor Commented:
when i use like this
myFlash.Movie = App.Path & "\test.swf"

it is working
You cannot do that. You will have to extract the swf file from the exe to a temp file while your app runs,then kill the file when your app closes. Here is an example:

Private Sub Form_Load()
Dim swfFile As String
' location to save file to,it will be extracted from .exe
swfFile = Environ("Temp") & "\" & "myfile.swf"

'save Resource item 101 to disk
SaveResItemToDisk 101, "Custom", swfFile

' Load your swfFile
ShockwaveFlash1.Movie = swfFile

End Sub

Private Sub Form_Unload(Cancel As Integer)
Dim swfFile As String
swfFile = Environ("Temp") & "\" & "myfile.swf"

' kill the file when your app unloads
If Dir(swfFile) <> "" Then
    Kill swfFile
End If

End Sub

Private Function SaveResItemToDisk(ByVal iResourceNum As Integer, _
  ByVal sResourceType As String, ByVal sDestFileName As String) As Long
Dim bytResourceData()   As Byte
Dim iFileNumOut         As Integer
On Error GoTo SaveResItemToDisk_err
bytResourceData = LoadResData(iResourceNum, sResourceType)
iFileNumOut = FreeFile
Open sDestFileName For Binary Access Write As #iFileNumOut
Put #iFileNumOut, , bytResourceData
Close #iFileNumOut
SaveResItemToDisk = 0
Exit Function
SaveResItemToDisk = Err.Number
End Function
nurbekAuthor Commented:
thank you, it works :)


Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now