Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

MCI error

Posted on 1998-12-20
4
Medium Priority
?
273 Views
Last Modified: 2010-05-03
My app has been using this mciSendString fine until recently:

CmdStr = ("open  " & AVIFileName & " Type AVIVideo alias Animation parent " _
           + LTrim$(Str$(frmAVI.hwnd)) + " style " + LTrim$(Str$(WS_CHILD)))
   
   ret = mciSendString(CmdStr, 0&, 0, 0)

I am receiving this error...Why, and how can I fix this?
MMSYSTEM259 The command parameter used is not defined in the MCI command set.

Thanks
0
Comment
Question by:BWATERS
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 3

Accepted Solution

by:
Sendoh earned 400 total points
ID: 1451535
Hi !
I'd tried out your code the posted above.
Same error obtain. I suspect you copy the above code from somewhere and paste it on VB and run it right ??
It is because when I tried to retype the whole command (even a space), I'd make it work on my machine. Then I'd retried the code pasted a bove by using "copy" and "paste" it does not worked.

So :
1) make sure the file name and path are accurate.
2) make sure the command entered were correct(by adding
msgbox cmdstr 'before calling mcisendstring.
3) Don't just copied from experts-exchange homepage and paste on VB. It'll not worked.
4) Check the mci type valid in Win.ini

Hope it'll help you.
0
 
LVL 3

Expert Comment

by:Sendoh
ID: 1451536
Hi !
I forgot to post my code as well !!

    Dim cmdStr As String * 100
    Dim retStr As String * 100
   
    cmdStr = "open c:\temp\mci\battery.avi type AVIVideo alias myavi parent " _
            & Form1.hWnd & " style " & Str(WS_CHILD)
    'cmdStr = "close all"
   
    'MsgBox cmdStr
    ret = mciSendString(cmdStr, 0&, 0, 0&)
    mciGetErrorString ret, retStr, 100
    MsgBox "Value = " & ret & Chr(13) & _
            "Str = " & retStr
    cmdStr = "play myavi"
    ret = mciSendString(cmdStr, 0&, 0, 0)
    mciGetErrorString ret, retStr, 100
    MsgBox "Value = " & ret & Chr(13) & _
            "Str = " & retStr

0
 

Author Comment

by:BWATERS
ID: 1451537
Ah Sendoh...you were correct assuming there was a space in the string.  What was confusing me was the CmdStr WORKED on another machine because the avi path (AVIFileName) did not have a space in path. For example: 'c:\path\avifile.avi'.  Wheni I installed it on another machine, there was a space in the path
'c:\my path\avifile.avi".
You answered my question, thanks.  I know this might be a different question, but how would you get around a space in the path?  I want to get a response from you before I close out the question.  Thanks again.
0
 
LVL 3

Expert Comment

by:Sendoh
ID: 1451538
Hi !

Ok, for this situation, you can tried follow :

cmdStr = "open c:\temp\mci\mypath~1\abc.avi type AVIVideo alias myavi parent " _
            & Picture1.hWnd & " style " & Str(WS_CHILD)

where the path name can be found when you were in dos prompt because for dos format is only 8.3. So the window actually stored the filename as what you'll see on the dos prompt.

Hope it'll help you  ^_^.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
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…
Suggested Courses

618 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