Solved

MCI error

Posted on 1998-12-20
4
258 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
  • 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

759 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now