Re: Desktop application permissions... by Michael
Michael
Sun Aug 22 13:00:02 CDT 2004
Well, the first error code seems to be the most relevant one. Does it even
make sense to make the second call once the first one fails?
Anyway, you can look up those codes in mmsystem.h. 266 is
MCIERR_CANNOT_LOAD_DRIVER. MSDN has this description "The specified device
driver will not load properly." You might try GetLastError() to see if that
gives you any additionaly information. You'd have to call SetLastError(0)
before the mciSendString, and then test if GetLastError() returns something
other than 0.
I don't know a lot about multimedia. I would check, though, that the string
you send in both cases is the same. I would check if multiple opens are ok
(if you in fact open more than once before closing). Btw, from what I read
in MSDN, your open string is not correctly formatted.
I doubt it's a threading problem - mmsys seems to be free-threaded. As for
permissions, I would hazard that you're calling the function in the same
context in both cases, so probably not that. To verify, you could open
WinXP Task Manager to see what user context the process is running in
(select the Processes tab, and make sure you have the "User Name" field
selected).
Also, you may have better luck in a desktop developer's forum.
--
Michael Salamone [eMVP]
Entrek Software, Inc.
www.entrek.com
"chris" <chris@discussions.microsoft.com> wrote in message
news:A253BCC4-C68E-4927-B279-54C7BA996E29@microsoft.com...
> When calling from the ppc app i get 266 and 263 (see below), while from
the
> desktop app, 0 and 0.
>
> // declared with class scope
> private StringBuilder m_sb = new StringBuilder(1024);
>
> // in my play() function
> // returns 266
> retval = mciSendString("open " + "\"" + SongFileName + "\"" + " alias
song",
> m_sb, 0, 0);
>
> // returns 263
> retval = mciSendString("play song", m_sb, 0, 0);
>
>
> "Michael J. Salamone [eMVP]" wrote:
>
> > Are the winmm calls returning an error code? What is it?
> > --
> >
> > Michael Salamone [eMVP]
> > Entrek Software, Inc.
> > www.entrek.com
> >
> >
> >
> > "chris" <chris@discussions.microsoft.com> wrote in message
> > news:A94CF4AA-DAC7-4910-840A-F8D9044A3E70@microsoft.com...
> > > My PocketPC app communicates with my desktop app via asychronous
sockets,
> > and
> > > I'm trying to have the desktop app play media files via winmm.dll.
Making
> > > calls to winmm.dll from the desktop app works fine, but when the ppc
sends
> > a
> > > message to the desktop app, making the same winmm.dll call, nothing
> > happens.
> > > Could this be a thread/permissioning issue? Suggestions?
> >
> >
> >