Solved

MCI error

Posted on 1998-12-20
4
266 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 100 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

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…
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…

688 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