thanks
Redeemer dk
Posts
-
How do i draw 4:2:0 YUV data on the screen? -
How do i create a random number?Is there a function for retreiving a random integer lying in the range from one integer to another? I'm using Win32... THanks in advance.
-
What is wrong with this way of displaying a bitmap on a window?I'm trying to display a bitmap on my window. Here's my code:
BITMAPINFO biBitmap = {0};
BITMAPINFOHEADER bihBitmap = {0};bihBitmap.biSize = sizeof(BITMAPINFOHEADER);
bihBitmap.biWidth = 16;
bihBitmap.biHeight = 16;
bihBitmap.biPlanes = 1;
bihBitmap.biBitCount = 24;
bihBitmap.biCompression = BI_RGB;
bihBitmap.biSizeImage = 0;
bihBitmap.biClrUsed = 0;
bihBitmap.biClrImportant = 0;biBitmap.bmiHeader = bihBitmap;
PAINTSTRUCT ps;
HDC hdc = BeginPaint(ghWnd, &ps);
HDC hdcMem = CreateCompatibleDC(NULL);HBITMAP hbm = CreateDIBitmap(hdcMem, &bihBitmap, CBM_INIT, finalrgb, &biBitmap, NULL);
HBITMAP hbmT = (HBITMAP)SelectObject(hdcMem, (HBITMAP)hbm);BitBlt(hdc,60,60,16,16,hdcMem,0,0,SRCCOPY);
SelectBitmap(hdcMem,hbmT);
DeleteDC(hdcMem);EndPaint(ghWnd,&ps);
finalrgb
is a pointer to an array of unsigned chars containing RGB values for a 16 by 16 pixels picture. What am i doing wrong? Thankyou! -
Is it possible to make Visual Studio break whenever a given variable gets a specific value?Hey all. Just wanted to ask if it is possible to make Visual Studio break whenever a given variable gets a specific value? Thanks in advance. -Rune Svendsen
-
What function should i use for displaying movies on a screen?It's an MPEG2 file, but i'm decoding the file myself.
-
What function should i use for displaying movies on a screen?I'm currently developing a program for displaying movie contents on a screen. This means that i could have to change the contents of the graphics up to 60 times per second. Which functions are best suited for this? Thanks in advance. -Rune SVendsen
-
How to resume the file downloadTo resume a download you need to use the REST command: REST The REST command will make the server start at a give byte offsett and not at the start of the file. When you send that command the server will reply with either a negative response, or the code 350, which means it will start at the byte offsett you've specified. NOTE: The REST command must be followed by a service command (RETR or STOR). -Rune SVendsen
-
Which API's do i need to get the hWnd of the control under the cursor?I'm making a program where i need the hWnd of the control that is currently under the cursor, but i'm in doubt of which API's i should use. I've tried checking around but i can't seem to find the answer. Thanks in advance
-
Error no. 87 when trying to read from a drive...I'm trying to open a drive, by specifying the lpFileName argument to be of the format "\\.\:" in CreateFile. But when i use ReadFile to read from the disk, i get an error, number 87 which means invalid parameter, anyone know what's wrong?
char test\[32\]; HANDLE hDrive = CreateFile("\\\\\\\\.\\\\H:", GENERIC\_READ, FILE\_SHARE\_WRITE /\* | FILE\_SHARE\_READ\*/ , NULL, OPEN\_EXISTING, FILE\_ATTRIBUTE\_NORMAL, NULL); DWORD dwBytesRead; ReadFile(hDrive, &test, 32, &dwBytesRead, NULL); CloseHandle(hDrive);
Thanks all! -Rune SVendsen
-
FTP without WininetI used this: cliky here
-
Ring upp ???So you want a program you can use as a phone that can dial up a normal phone, so you can talk with them for free?
-
Ring upp ???You mean your program has to dial up to itself via a phone line or what?
-
How do i automatically scroll to the bottom of a edit control when text gets added?I have an edit control working as a log, but when new text gets added to the control that makes the scrollbar active, it scrolls to the top so you can't see what has happened. Is it possible to set it to scroll to the bottom automatically, or is there a message you can send so it does it? I'm programming Win32 BTW. Thanks all.
-
Is there a way to translate your C++ code to assembly code in VS?then i get an exe - machine code. not assembly code...
-
Is there a way to translate your C++ code to assembly code in VS?thanks :)
-
Is there a function in C++ that will split a char array delimited by a specific character?If i for example have this string: "192,168,135,97,51,156" is it possible to split that into 6 integers containing the values delimited by the comma? thanks all :)
-
Is there something wrong with my DirectX SDK?When i try to use the
RenderFile
function on anIGraphBuilder
i get a ton of errors. I've also tried downloading a sample file that is guaranteed to work, but i still get the errors. Here's the code from the sample:#include <windows.h>
#include <objbase.h>
#include <dShow.h>int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
HRESULT hr;
IGraphBuilder* pGraphBuilder;
IMediaControl* pMediaControl;
WCHAR MediaFile[MAX_PATH];CoInitialize(NULL); hr = CoCreateInstance(CLSID\_FilterGraph, NULL, CLSCTX\_ALL, IID\_IGraphBuilder, (void\*\*)&pGraphBuilder); if (FAILED(hr)) return -1; MultiByteToWideChar(CP\_ACP, 0, lpCmdLine, -1, MediaFile, MAX\_PATH); hr = pGraphBuilder->RenderFile(MediaFile, NULL); if (FAILED(hr)) return -2; hr = pGraphBuilder->QueryInterface(IID\_IMediaControl, (void\*\*)&pMediaControl); if (FAILED(hr)) return -3; hr = pMediaControl->Run(); if (FAILED(hr)) return -4; Sleep(10000); pMediaControl->Stop(); pMediaControl->Release(); pGraphBuilder->Release(); CoUninitialize(); return 0;
}
I set up VS .NET so the commandline contains a valid media file. When it performs the RenderFile function it loads in a sec or so and comes with a bunch of erros like these:
ASSERT failed.
g_cFGObjects == 0
At line 6002 d:\xpclient\multimedia\dshow\filters\core\filgraph\filgraph\filgraph.cpp
Continue? (Cancel to debug)ASSERT failed.
Executable: DShowTut1.exe Pid 720 Tid 2cc. Module quartz.dll, 26 objects left active!
At line 317 of d:\xpclient\multimedia\published\dxmdev\dshowdev\base\dllentry.cpp
Continue? (Cancel to debug)sometimes it also pops up with additional erros like:
m_dwRecursionCount == 0 && m_dwOwnerThreadId == 0
At line 58 of d:\xpclient\multimedia\dshow\filters\core\filgraph\filgraph\msgmutex.cpp
Continue? (Cancel to Debug)And then exits. Anyone know what could be wrong? Thanks all! -Rune Svendsen
-
Is it possible to enumrate all the system's DirectShow filters?Thankyou. Do you know how i add a filter to IFilterGraph if i only know the name of the filter? -Rune Svendsen
-
Window being minimizedTake a look at the
WM_SYSCOMMAND
message. If the wParam parameter isSC_MINIMIZE
, then the window is about to be minimized. -
Is it possible to enumrate all the system's DirectShow filters?I've tried the code on MSDN but that doesen't give me any filters. I was told it may be because i hadn't performed a
RenderFile
action on the IGraphBuilder. But isn't there another way of just enumerating all the available filters on the system? Here's my code, when it comes to thepEnum->Next
procedure for the first time, it returns S_FALSE which means that the number of filters requested couldn't be found.IGraphBuilder *pGraph = NULL;
IEnumFilters *pEnum = NULL;
IBaseFilter *pFilter = NULL;
ULONG cFetched;CoInitialize(NULL);
CoCreateInstance(CLSID_FilterGraph, NULL, CLSCTX_INPROC_SERVER, IID_IGraphBuilder,(void**)&pGraph);
pGraph->EnumFilters(&pEnum);while((err = pEnum->Next(1, &pFilter, &cFetched)) == S_OK)
{
FILTER_INFO fiFilterInfo;
char szFilterName[256];pFilter->QueryFilterInfo(&fiFilterInfo); WideCharToMultiByte(CP\_ACP, 0, fiFilterInfo.achName, -1, szFilterName, 256, 0, 0); SendMessage(GetDlgItem(ghWnd, IDC\_FILTERS), LB\_INSERTSTRING, -1, (LPARAM)szFilterName); fiFilterInfo.pGraph->Release(); pFilter->Release();
}
pEnum->Release();
pGraph->Release();
CoUninitialize();So i'm asking if there's a way to enumerate all the available filters on the system. All help appreciated :) -Rune Svendsen