Home > Software engineering >  MFC McISendString specified location
MFC McISendString specified location

Time:11-10

MFC McISendString specified location play
With the function to send command control designated point location, the player now has a slider with the mouse point to where play
Have know master code
Himself wrote a cannot use
Int nPos=m_slider. GetPos ();
Cstrings step;
Long lPosition;
TCHAR szReturn [MAX_PATH]={0};
LPosition=nPos;
Step. The Format (_T (" seek movie to % ld "), lPosition);
_stprintf (szReturn, _T (" % d "), nPos);
McISendStringW (step, szReturn, MAX_PATH, 0);
Behind the three parameters to zero

CodePudding user response:

https://wenku.baidu.com/view/36d0031714791711cc7917c6.html

CodePudding user response:

I have seen countless times, this article use

CodePudding user response:

He didn't write the buf is stem what of, buf also not defined

CodePudding user response:



Void CMCIWnd: : SetPosition (DWORD p)
{
MCIWndSeek (m_hWnd, p);
}

DWORD CMCIWnd: : GetLength ()
{
Return MCIWndGetLength (m_hWnd);
}
I use the MCIWnd can play mp3 wav. Get the setting for length, the length of the
DWORD len=m_play. GetLength ();//the length is the whole play length unit: ms

CodePudding user response:

After the record, use

CodePudding user response:

Function is not wrong but I used the no effect, the m_hwnd seems not bound and music
Before I was made of the header file
#include
# pragma comment (lib, "winmm. Lib")


//step. The Format (_T (" seek waveaudio to % ld "), lPosition);
//_stprintf (szReturn, _T (" % d "), nPos);
//dwErr=McISendStringW (step, NULL, NULL, 0).
//TRACE (" strCmd=% ws \ n ", step);
NPos=m_slider. GetPos ();
LPosition=nPos;
MCIWndSeek (m_hWnd, lPosition);
TRACE (" lPosition1=% d \ n ", lPosition);

CodePudding user response:

This is the code for the music play
StrCmd. The Format (_T (open "% s"), m_szShortName);
//open the music
DwErr=McISendString (strCmd, NULL, NULL, NULL);
If (dwErr!=0)
{
ErrBox (dwErr);
return;
}
//play music
StrCmd. The Format (_T (play "% s"), m_szShortName);
DwErr=McISendString (strCmd, NULL, NULL, NULL);
If (dwErr!=0)
{
ErrBox (dwErr);
return;
}
M_bPlaying=TRUE;
  • Related