Solved

developing a software

Posted on 1998-12-08
4
137 Views
Last Modified: 2010-05-03
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
Comment
Question by:lslim
4 Comments
 
LVL 4

Accepted Solution

by:
idcanada earned 50 total points
ID: 1448923

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
 
LVL 3

Expert Comment

by:Sendoh
ID: 1448924
Hi !
I thought you can just using imagelist control for graphics and multimedia control for sound ??
Much more easier than resource right ??
0
 
LVL 14

Expert Comment

by:waty
ID: 1448925
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
 
LVL 1

Author Comment

by:lslim
ID: 1448926
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

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Suggested Solutions

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now