|
That's understandable, i tried googling around some too but didn't really find anything readymade either. I can think of two alternatives to writing your own source filter:
1. Extract your videos into some temporary files and play those from the file system, this can be a bit costy in both time and resource wise (you need time to extract the videos to temp files and you will need extra disk space for the videos) but i supose this is quite a straightforward solution. Alternatively you might try using a named pipe and specifying that as the source for the file reader filter, no idea if that would work or not, never tried, but i kinda suspect it wouldn't work.
2. Implement a "small" HTTP server in your application that can stream the video from your big file and try to render the stream with DirectShow like "http:\\localhost:12345\a.avi" or somesuch. This might be more work than just writing the filter though.
Good luck.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> If it doesn't matter, it's antimatter.<
|
|
|
|
|
Thanks for the reply.
I already thought both of your solutions you suggest. The 1st is abandoned from the very beggining since the archive file is delivered in retail-DVD and as you can imagine the time needed to extract it in the hard disk is critical. The 2nd solution is also rejected, since this is a retail product and the configuration of end computer is unknown, any anti-virus or general other protection software may block my application to work as it expected. So I think a custom filter in my case is more than imperative.
Thanks anyway,
sdancer75
|
|
|
|
|
I want to display my image on window without saving it.
When data is received window size changes but there is no display
on window.
My Code is:
int iBufferLength;
int iEnd;
int iSpaceRemaining;
int i;
iBufferLength = iSpaceRemaining = sizeof(chIncomingDataBuffer);
iEnd = 0;
iSpaceRemaining -= iEnd;
iBytesRead = recv(Socket, chIncomingDataBuffer+iEnd, iSpaceRemaining, 0);
iEnd+=iBytesRead;
if (iBytesRead == SOCKET_ERROR)
MessageBox(hWnd,
"Socket Error",
"Connection strt",
MB_ICONINFORMATION|MB_OK);
chIncomingDataBuffer[iEnd] = '\0';
if (lstrlen(chIncomingDataBuffer) != 0)
{
GetWindowRect(hWnd, &rect);
SetWindowPos(hWnd, NULL, rect.left, rect.top, cBitmap.bmWidth, cBitmap.bmHeight, 0);
HDC ThisDC = GetDC(hWnd);
DeleteDC(RemoteDC);
RemoteDC = CreateCompatibleDC(ThisDC);
DeleteObject(hbitmap);
hbitmap= CreateCompatibleBitmap(ThisDC, cBitmap.bmWidth, cBitmap.bmHeight);
SelectObject(RemoteDC, hbitmap);
ReleaseDC(hWnd, ThisDC);
BITMAPINFO bi;
HBITMAP hbmap;
int bisize = sizeof(BITMAPINFO);
memcpy(&bi, chIncomingDataBuffer+iEnd, bisize );
SetDIBits(RemoteDC, hbitmap, 0, cBitmap.bmHeight, chIncomingDataBuffer+iEnd+bisize, &bi, DIB_RGB_COLORS);
InvalidateRect(hWnd, NULL, false);
can anyone tell me..where I am wrong?
|
|
|
|
|
Quote: memcpy(&bi, chIncomingDataBuffer+iEnd, bisize );
for instance, what are you doing in the above line?
Veni, vidi, vici.
|
|
|
|
|
toms from newdelhi wrote: can anyone tell me..where I am wrong? Yes, the same as I told you before. You are not checking that you have read all the data from the client so you have no way of being sure that you have a valid image. You are using sizeof and lstrlen to find the length of the data, neither of which will give you a valid answer.
|
|
|
|
|
Hi all,
i am set icon on button and display the caption in front of icon.
but in XP the icon not displayed if icon and text both are using,if only icon i want to display its working fine.
i dont wahts going wrong here
please help me.
|
|
|
|
|
VCProgrammer wrote: i dont wahts going wrong here Neither do we. Please give some proper detail, including a copy of the code that is not working.
|
|
|
|
|
Is the problem XP-specific or does it act the same on other OSs?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
i am using this to set icon on button
only on xp i found this problem.
HICON hIcon = AfxGetApp()->LoadIcon(IDI_ICON1);
m_btn2.SetIcon(hIcon);
HICON icon =NULL;
HINSTANCE hInstResource = NULL;
hInstResource = AfxFindResourceHandle(MAKEINTRESOURCE(IDI_ICON2), RT_GROUP_ICON);
icon = (HICON) LoadImage(hInstResource,
MAKEINTRESOURCE(IDI_ICON2),
IMAGE_ICON,
16,
16,
LR_DEFAULTCOLOR);
m_btn3.SetIcon(icon);
on other os like Vista and Windows 7 the icon on button with button caption display properly,
but in case of XP the icon not display only the button caption is visible.
|
|
|
|
|
From where is this code being used? Do the icon handles have function-level scope?
You are not checking the return value from any of the function calls. If one of them is failing, how would you know? Check out GetLastError() .
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
i am checking GetLastError for LoadIcon and LoadImage, both are return 6 (The Handle is invalid).
i dont understand why this fails only on xp otherwise its working fine.
even if i set Button style BS_ICON ,than its also working on XP,but my requirement to display both icon and text on button.
please help me how can i resolve this.
thanks.
modified 8-Feb-13 2:01am.
|
|
|
|
|
VCProgrammer wrote: both are return 6 (The Handle is invalid). That suggests the your resource ids are also invalid. Check that all the values match up with their target resources and are correctly loaded into your final application.
|
|
|
|
|
but when i set Button style BS_ICON ,than its also working on XP.it means ids are not invalid,i think so...
i really cant get it whats going wrong here,
is there any other method to display icon on button with text.
|
|
|
|
|
VCProgrammer wrote: i really cant get it whats going wrong here, Without a lot more information I don't think we can either.
|
|
|
|
|
please sir tell me what other information you required to help me.
|
|
|
|
|
You need to show some more of the failing code and the error messages or codes that you receive. Remember, we cannot see your system and are not familiar with your program.
|
|
|
|
|
Richard MacCutchan wrote: Remember, we cannot see your system... Atlantic ocean in your way, Richard?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
Yes, and the fact that you people will insist on hiding below the horizon.
|
|
|
|
|
in my test application for button icon:
i have 2 Icon,load them in resource with id IDI_ICON1,and IDI_ICON2
2 buttons :CButton m_btn;
CButton m_btn2; on which i wan to set the icon
if i set the icon style true for buth buttons its working fine and display the icon on button in XP.
but when i FALSE the ICON style for button and run this application,only text of button is display not the icon on button.
now please help,if want something more please tel me what information i provide you to better assist me...
BOOL CBtnIconDlg::OnInitDialog()
{
HICON hIcon = AfxGetApp()->LoadIcon(IDI_ICON1);
AfxMessageBox(ErrorMsg());
if(hIcon)
{
}
else
{
AfxMessageBox(_T("NULL hIcon"));
}
m_btn.SetIcon(hIcon);
AfxMessageBox(ErrorMsg());
HICON icon =NULL;
HINSTANCE hInstResource = NULL;
hInstResource = AfxFindResourceHandle(MAKEINTRESOURCE(IDI_ICON2), RT_GROUP_ICON);
AfxMessageBox(ErrorMsg());
if(hInstResource)
{
}
else
{
AfxMessageBox(_T("hInstResource null"));
}
icon = (HICON) LoadImage(hInstResource,
MAKEINTRESOURCE(IDI_ICON2),
IMAGE_ICON,
16,
16,
LR_DEFAULTCOLOR);
AfxMessageBox(ErrorMsg());
if(icon )
{
}
else
{
AfxMessageBox(_T("NULL icon "));
}
m_btn2.SetIcon(icon);
AfxMessageBox(ErrorMsg());
return TRUE;
}
CString CBtnIconDlg::ErrorMsg()
{
CString ret_msg=_T("");
LPVOID lpMsgBuf;
HRESULT hr;
hr = GetLastError();
ret_msg.Format(_T("%d :: "),GetLastError());
FormatMessage(
FORMAT_MESSAGE_ALLOCATE_BUFFER |
FORMAT_MESSAGE_FROM_SYSTEM |
FORMAT_MESSAGE_IGNORE_INSERTS,
NULL,
hr,
0,
(LPTSTR) &lpMsgBuf,
0,
NULL
);
ret_msg+=(LPCTSTR)lpMsgBuf;
LocalFree( lpMsgBuf);
return ret_msg;
}
|
|
|
|
|
I suspect the error 87 should be ignored as you have not checked if the previous function was successful or not. You can validate that by calling SetLastError(0) before the SetIcon() call. You also say that when you set icon style to FALSE it does not display the icon; isn't that what it should do?
|
|
|
|
|
i set icon style to FALSE,coz i dont want only icon on button is display
i want icon and text both are display on button....
|
|
|
|
|
|
thanks for your guidance and support ,but please help me what function use to display text and icon on button....
|
|
|
|
|
|
according to the documentationt set icon on button use CButton:SetIcon method,that have i already used...as you know also is not working fine...
|
|
|
|