?
Solved

MCI error

Posted on 1998-12-20
4
Medium Priority
?
269 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
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 …
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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…
Suggested Courses
Course of the Month9 days, 9 hours left to enroll

762 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