473,406 Members | 2,619 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Need playsound to wait for picturebox to become visible

I am a novice writing a simple program in Visual C++ Express and am
having an issue. I basically have several picture boxes of the same
size on top of each other with only one visible at a time. I have a
button that when clicked triggers an event that makes each picturebox
visible one at a time and plays a wav file associated with the image
in the picturebox. I have put an example of the code below:

//picturebox1 is already visible on the screen
PlaySound("c:\\picturebox1wave.wav",0,SND_SYNC|SND _FILENAME);
this->picturebox1->visible = false;
this->picturebox2->visible = true;
PlaySound("c:\\picturebox2wave.wav",0,SND_SYNC|SND _FILENAME);
this->picturebox2->visible = false;
this->picturebox3->visible = true;
PlaySound("c:\\picturebox3wave.wav",0,SND_SYNC|SND _FILENAME);
and so on......

The issue I have is that picturebox1 goes away after its wav file is
played as it should, but the screen remains blank until all the wav
files are played and then the last picturebox is displayed. None of
the intermediate pictureboxes are displayed while the associated wave
file is playing. Any suggestions on how to fix this? Thanks.

Jul 31 '07 #1
0 1247

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: MLH | last post by:
I have a line of code that works when called from a procedure in Access 2.0 form... PlaySound("C:\cr\help\Help0018.wav", 0) I imported what I thought was needed into A97. However, running it...
0
by: Johann Blake | last post by:
I am creating PictureBox controls at runtime in code and not at design time. These controls do get created and appear. These controls have a form as their container. Not all of the controls I...
2
by: Joe Thompson | last post by:
Hi, I am trying to use PlaySound in a VC++.net Windows app (VS 2003). I can use it to play a file but now I want to play it from a resource. I have two questions: How do I add a wav file to...
0
by: akh | last post by:
I want to use de Drag and Drop ´s event to move a picture box from a form and within a Picture Box. But I have behaviour if the MyPBox As PictureBox as the Globale varible or not Thanks for...
3
by: Jared | last post by:
I'm using the first code sample below to play WAV files stored as embedded resources. For some reason I *occasionally* get scratching and crackling. I'm using a couple WAVs that ship with...
6
by: robusto33 | last post by:
Hi everyone, I'm really new to C#.net development, especially for win32 applications. I'm basically making a board game and was wondering if anyone could help me out with this predicament: I have...
0
by: Jerry West | last post by:
Coming from VB6 a PictureBox was a container for other controls. This doesn't seem to be the case with .NET. In light of that can someone comment on the following.... I'm creating an app that...
2
by: =?Utf-8?B?RU1hbm5pbmc=?= | last post by:
I'm developing an application for my customer to log info about photos/images he has done. Each record contains the file name of the image and displays the image based on that file name in a...
4
by: munibe | last post by:
Hi, i have a problem about picturebox control. if you may help me, i will be so happy. i have a picturebox named pic_map, and i added a button named customer_button, my wish is to add a new small...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.