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

developing a software

i am currently developing a software which will involve a lot of graphics, animation and sound. i am thinking about an idea of creating a blank form and import any picture that i want at any time so that i have no need to create a number of forms with pictures stay still on them, as those forms might have similar functions. in that case, i need to create a file where i will store all the pictures inside for future access. my problem is, how am i going to access the picture that i want in the form and then clear it to access the other picture in the same form?
another problem is that how to import sound into my software?
thanks!
0
lslim
Asked:
lslim
1 Solution
 
idcanadaCommented:

You MUST use a Resouce file for all of this.
Should you not know how, simply post a comment,
and I will give you instructions on how to create, add and read.


0
 
SendohCommented:
Hi !
I thought you can just using imagelist control for graphics and multimedia control for sound ??
Much more easier than resource right ??
0
 
watyCommented:
Save all in ressource files. You could even store your bitmaps in imagelist.

For the sound, do as follow to play them

' #VBIDEUtils#************************************************************
' * Programmer Name  : Waty Thierry
' * Web Site         : www.geocities.com/ResearchTriangle/6311/
' * E-Mail           : waty.thierry@usa.net
' * Date             : 20/11/98
' * Time             : 09:33
' * Module Name      : Multimedia_Module
' * Module Filename  : Multimedia.bas
' **********************************************************************
' * Comments         : Contains several multimedia functions
' *
' *
' **********************************************************************

Option Explicit

Private Const SND_ALIAS = &H10000
Private Const SND_ASYNC = &H1
Private Const SND_FILENAME = &H20000
Private Const SND_LOOP = &H8
Private Const SND_NODEFAULT = &H2
Private Const SND_MEMORY = &H4
Private Const SND_NOSTOP = &H10
Private Const SND_NOWAIT = &H2000
Private Const SND_SYNC = &H0

Private Declare Function PlaySound Lib "winmm.dll" Alias "PlaySoundA" (ByVal lpszName As String, ByVal hModule As Long, ByVal dwFlags As Long) As Long
Private Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long

Private Declare Function waveOutGetNumDevs Lib "winmm" () As Long
Private Declare Function midiOutGetNumDevs Lib "winmm" () As Integer

Private Declare Function midiOutGetVolume Lib "winmm.dll" (ByVal uDeviceID As Long, lpdwVolume As Long) As Long
Private Declare Function waveOutGetVolume Lib "winmm.dll" (ByVal uDeviceID As Long, lpdwVolume As Long) As Long

Private Declare Function midiOutSetVolume Lib "winmm.dll" (ByVal uDeviceID As Long, lpdwVolume As Long) As Long
Private Declare Function waveOutSetVolume Lib "winmm.dll" (ByVal uDeviceID As Long, lpdwVolume As Long) As Long

Private Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal lpstrCommand As String, ByVal lpstrReturnString As String, ByVal uReturnLength As Long, ByVal hwndCallback As Long) As Long

Private Const MMSYSERR_NOERROR = 0

Public Const AUDIO_NONE = 0
Public Const AUDIO_WAVE = 1
Public Const AUDIO_MIDI = 2

Public Sub PlayWaveRes(vntResourceID As Variant, Optional vntFlags)
   ' #VBIDEUtils#************************************************************
   ' * Programmer Name  : Waty Thierry
   ' * Web Site         : www.geocities.com/ResearchTriangle/6311/
   ' * E-Mail           : waty.thierry@usa.net
   ' * Date             : 3/12/98
   ' * Time             : 09:47
   ' * Module Name      : Multimedia_Module
   ' * Module Filename  : Multimedia.bas
   ' * Procedure Name   : PlayWaveRes
   ' * Parameters       :
   ' *                    vntResourceID As Variant
   ' *                    Optional vntFlags
   ' **********************************************************************
   ' * Comments         :
   '           If you want to play sound files asynchronously in
   '           Win32, then you MUST change bytSound() from a local
   '           variable to a module-level or static variable. Doing
   '           this prevents your array from being destroyed before
   '           sndPlaySound is complete. If you fail to do this, you
   '           will pass an invalid memory pointer, which will cause
   '           a GPF in the Multimedia Control Interface (MCI).
   ' *
   ' *
   ' **********************************************************************

   Dim bytSound() As Byte ' Always store binary data in byte arrays!
   
   bytSound = LoadResData(vntResourceID, "WAVE")
   
   If IsMissing(vntFlags) Then
      vntFlags = SND_NODEFAULT Or SND_SYNC Or SND_MEMORY
   End If
   
   If (vntFlags And SND_MEMORY) = 0 Then
      vntFlags = vntFlags Or SND_MEMORY
   End If
   
   sndPlaySound bytSound(0), vntFlags
   
End Sub

0
 
lslimAuthor Commented:
idcanada,
       i will be very much grateful if you could give me more instructions on that. i am just a beginner using vb...i look forward to your prompt reply...

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

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