ran into yet another prob.
your code works and assigns all the strings into 1 string, but when you put
(long)hwnd, (long)WS_CHILD
all that outputs from those is
%l %l
the function needs the hWnd of the parent, and the WS_CHILD to open the video properly. the mcisendstring is returning 0 which means its the function is being called succesfully, but that doesn't neccesarly mean that its opening the way i want it too. here is the code i have done.
Code:
char szFileName[MAX_PATH];
long szAviName[255];
long lenShort;
char szCmdToDo[255];
GetFileName(hwnd, szFileName, FALSE); //here is the function for the open dialog
lenShort = GetShortPathName(szFileName, szAviName, 255);
char *szShortPathAndFile = new char[lenShort];
int x;
for(x = 0; x<lenShort; x++)
szShortPathAndFile[x] = szAviName[x];
sprintf(szCmdToDo, "open %s type %s Alias %s parent %s Style %l",
szShortPathAndFile,
"MPEGVideo",
"movie",
(long)hwnd,
(long)WS_CHILD);
dwreturn == mciSendString(szCmdToDo, 0, 0, 0);
sprintf(szCmdToDo, "play %s%s%s%s%s", "movie", " from ", "0", " to ", "1500");
SetWindowText(txtpass, itoa(dwreturn, buffer, 10));
delete [] szShortPathAndFile;
thats it. it runs without error, and returns 0. but i get no playback because of the 'hwnd', and the WS_CHILD.
yea :) Got another question though.
ok, i need to know the function for the InStr function in c++.
in vb6 its
InStr(1, string, "searchphrase")
i thought it would be the same in c++ as its an API call i believe but it says InStr is not a recognized function. i need to do this in order to get the size of a movie thats being played. when i call the function to get the size of the movie it returns 0 0 320 240 for a movie thats 320x240. in vb6, i would do the following to seperate into 2 seperate parts from the string 'size'.
Code:
sz1 = InStr(1, size, " ") 'find the space after the first character
sz2 = InStr(sz1 + 1, size, " ") 'find the space after the second space
sz1 = InStr(sz2 + 1, size, " ") 'find the space after the third space
width = Mid(size, s2, s1 - s2) 'get the 320
height = Mid(size, s1, s1 + 1) 'get the 240
i believe thats right, i did it from my head, but i'm pretty good in vb so i'm pretty sure it works. thanx for the input.