Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old July 8th, 2003, 04:07 PM
esposito esposito is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2002
Posts: 20 esposito User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Problems handling .RES files

Hello, I have a problem handling .RES files in Visual Basic that I really hope you will help me to solve.

In particular, I cannot launch an embedded .AVI file after having compiled it by means of the Resource Compiler you can find in the VB CD-ROM.

The procedure I followed is the following:

1. I created an .RC file containing the following line of code:

101 AVI DISCARDABLE "TEST.AVI"

2. I embedded the .AVi file (TEST.AVI) into a resource file (TEST.RES) using RC.EXE.

3. I added TEST.RES to the VB project and placed the following code in the General Declarations window of Form1:

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

4. Finally, I typed the following code in the click event of a command button:

Private Sub cmdPlayAviRes_Click()
Dim RetValue As Long
Dim AviArray() As Byte
Dim strCmdStr As String
AviArray = LoadResData(101, "AVI")
strCmdStr = "play " & AviArray(0) & " "
RetValue = mciSendString(strCmdStr, 0&, 0, 0&)
End Sub

The code above works perfectly, with some modifications, when dealing with .WAV files. Unfortunately, it seems not to work with .AVI files: clicking on the command button produces no results. Where did I make a mistake?

Thanks for your attention. I'm counting on your help.

Pasquale Esposito
Perugia - Italy
http://www.toprete.com/software/

Reply With Quote
  #2  
Old July 9th, 2003, 04:26 PM
NicMic's Avatar
NicMic NicMic is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Cheltenham, England.
Posts: 94 NicMic User rank is Corporal (100 - 500 Reputation Level)NicMic User rank is Corporal (100 - 500 Reputation Level)NicMic User rank is Corporal (100 - 500 Reputation Level)NicMic User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 22 h 21 m 45 sec
Reputation Power: 9
Silly question, perhaps, but do you have the necessary association for .AVI files on the target system? What happens if you double-click on an AVI file in Windows Explorer on the target PC?

Reply With Quote
  #3  
Old July 10th, 2003, 11:53 AM
esposito esposito is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2002
Posts: 20 esposito User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
.AVI files are associated to Windows Media Player, on both the source and target computer.

To tell the truth, I have already found a way to work around the problem: first I import the .RES file containing the .AVI movie, then I save it in a temporary file on the hard disk and, finally, I delete it after having played it. What I don't like of this solution is the fact that I have to create a temporary file on the local computer: this slows down the execution of the movie which can only start after the temporary file has been created. That's why I am exploring the possibility of playing .AVI movies directly from the embedded .RES file. Do you know how - and if - it is possible?

Reply With Quote
  #4  
Old July 10th, 2003, 12:39 PM
NicMic's Avatar
NicMic NicMic is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Cheltenham, England.
Posts: 94 NicMic User rank is Corporal (100 - 500 Reputation Level)NicMic User rank is Corporal (100 - 500 Reputation Level)NicMic User rank is Corporal (100 - 500 Reputation Level)NicMic User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 22 h 21 m 45 sec
Reputation Power: 9
Sorry, no - you're way ahead of me in this area.

Reply With Quote
  #5  
Old July 11th, 2003, 12:35 AM
esposito esposito is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2002
Posts: 20 esposito User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
No problem. Thank you anyway.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming > Problems handling .RES files


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway