|
|
|||||||
| About Us | Register | FAQ | Members List | Calendar | Mark Forums Read |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|
#2 (permalink) |
|
I want you INSIDE me
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Join Date: Mar 2002
Location: Massachusetts, USA
Posts: 8,382
|
Don't you use the global variable?
Code:
Private strExample As String
__________________
![]() Kirby's AnimeDB list AMD Athlon64 X2 4400+ Toledo, Nvidia GeForce 7950GT SLi, 2GB PC3200 2-3-2-5, ABit AN8-SLi, Sound Blaster X-FI XtremeMusic |
|
|
|
|
|
#3 (permalink) |
|
Administrator
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Join Date: Dec 2001
Location: Montreal, Canada
Posts: 7,129
|
make a Module and declare it Public
Code:
Public Variable as Integer and in the module put Code:
Sub Main() Application.Run(New MainForm) End Sub |
|
|
|
|
|
#5 (permalink) |
|
Puchiko-nyu!
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jul 2001
Location: 49° 11' N 123° 10' W
Posts: 2,854
|
Declare the variable as "public" at the beginning of the form.
Public strVal As String Then you can access it by using formname.strVal
__________________
"Not every ejaculation deserves a name." --- George Carlin |
|
|
|
|
|
#6 (permalink) |
|
Administrator
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Join Date: Dec 2001
Location: Montreal, Canada
Posts: 7,129
|
yup like Kairi00 a said. thats how you can access then via fromain.variable
ive always worked with modules since its easier to know where the global variables are and it saves me from always writing formname. (usefull when you need to access alot the variables from alot of forms) |
|
|
|
|
|
#8 (permalink) |
|
Ataru Moroboshi Fan =)
![]() ![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2001
Location: Portugal, Oporto
Posts: 5,759
|
Ok guys i have a new problem
I used a module to declare the Win32 function "sndPlaySound" like this:Public Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long then whenever i wanted to play a sound i would call the function like this: sndPlaySound App.Path & "\soms\tiro.wav", SND_ASYNC The sound does play, however it stops the program untill the sound is finished. Is there anyway to play a sound in the background without freezing the program? And another thing... anyof you know how to play a MIDI file in VB |
|
|
|
|
|
#9 (permalink) | |
|
Administrator
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Join Date: Dec 2001
Location: Montreal, Canada
Posts: 7,129
|
Quote:
|
|
|
|
|
|
|
#10 (permalink) |
|
Ataru Moroboshi Fan =)
![]() ![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2001
Location: Portugal, Oporto
Posts: 5,759
|
Thks for the help Chrono Archangel but that code only seems to work in VB.net! Im using VB 6.0! :/
*edit* I was able to play the midi file same way as used with the wave file... however samething happens! While the music is playing the program freezes! |
|
|
|
|
|
#11 (permalink) |
|
Banned
![]() ![]() Join Date: May 2004
Posts: 151
|
You need to play the sound asynchronously, meaning along with everything else. Do it like this
Private Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" ( ByVal lpszSoundName As String, ByVal uFlags As Long) As Long Const SND_ASYNC = &H1 Const SND_NODEFAULT = &H2 Private Sub Command1_Click() sndPlaySound "mysound.wav", SND_ASYNC Or SND_NODEFAULT End Sub Also you could always just use the "Do Events" tag but that is annoying to a degree and much easier to just set up the sound to sync at the inital. |
|
|
|
|
|
#12 (permalink) |
|
Ataru Moroboshi Fan =)
![]() ![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2001
Location: Portugal, Oporto
Posts: 5,759
|
Thks jaydawg but i already saw it in a vb tutorial page! Thks anyway
![]() Trying to figure out how to work with files now to save high-scores and stuff like that! But i think this website covers that! |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|