|
I've managed to get the vfw codec enabled ( didn't realise there were Configuration options you could set ), I can get the first frame of the avi ( index 0 ), when I attempt to get the second frame ( index 1 ), my program gets an exception.
Any ideas what's going on now?
|
|
|
|
|
Hello, Thomas
To say the truth I don't know what is the problem now. May be there is something wrong with VfW. You know, it's very tricky. It's much better to use DX if it is possible. It's hard say what is the problem without the code.
By the way. I was using VfW too. You can look at my article at CodeProject "Motion Detection Algorithms". But it was written on C# and all VfW functions was interoped and then I've created two classes: AVIReader and AVIWriter. If you are familiar with C# you can try my library. If it will work with your file, I can send you the code of it in C#.
With best regards,
Andrew
|
|
|
|
|
I am starting to learn c++, and have managed to get hold of a copy of Visual stutio 6. I looked into .net and found that if somebody does not have the .net environment, the apps will not work. Is an MFC app compiled with all the necessary classes to run under its own steam, or does it rely on other files? In other words, if I create an MFC app, will it run on a standard install of win 98,2000, xp. I know mfc adds a little overhead to the finnished app, but at this stage my apps will be tiny anyway.
Regards
Paul
|
|
|
|
|
Stirfie wrote:
...and have managed to get hold of a copy of Visual stutio 6.
How much is it being sold for these days?
Stirfie wrote:
In other words, if I create an MFC app, will it run on a standard install of win 98,2000, xp.
Most likely it will. The two main files that are required are mfc42.dll and msvcrt.dll, both of which are probably on the target machine.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
DavidCrow wrote:
How much is it being sold for these days?
Less than 2 US dollar at Nehru place, New delhi, India.....
http://www.priyank.in/
|
|
|
|
|
Priyank Bolia wrote:
Less than 2 US dollar at Nehru place, New delhi, India.....
Priacy , what about CD Borrowing from Friend
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
No, I borrow from my company, and about my friends, they borrow from others who ultimately get from the same source "The great Nehru Place". And by the way, if you have the original 800US$ edition of VS.NET, please lend me the CDs .;)
http://www.priyank.in/
|
|
|
|
|
Priyank Bolia wrote:
if you have the original 800US$ edition of VS.NET, please lend me the CDs
If I do that, My Company certainly going to ............ me
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
Stirfie wrote:
if somebody does not have the .net environment, the apps will not work
The .net runtime is redistributable free of charge with your app. other main interest is that large part of .net is open standard and supported on other platforms also. And .net runtime will comes with the OS, now-a-days or in near future......I guess so.
http://www.priyank.in/
|
|
|
|
|
.NET will probably NEVER come with Windows 98...
|
|
|
|
|
Blake Miller wrote:
.NET will probably NEVER come with Windows 98...
Ya, I also think so, but the point is WIN98 is 7 years old OS, and technology changes every day. I am talking about future releases of MS OS.
http://www.priyank.in/
|
|
|
|
|
Stirfie wrote:
if I create an MFC app, will it run on a standard install of win 98,2000, xp.
My apps are tested on Windows NT 4.0 to Windows Server 2003, provided I distribute mfc*.dll and msvcrt.dll with the app, as Mr. David says. Or you link MFC as static library in the project options.
http://www.priyank.in/
|
|
|
|
|
Is intellisense helpful for u?
What's the good one you think?
|
|
|
|
|
|
I don't rely upon it, but it is very handy when it does work.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
I am a fan of Visual Assist. I have been using it for a couple years now and I can stand when I get on a computer without it.
|
|
|
|
|
I need to insert text to Listbox with tab
Exemple
Text1 "TAB" Text2 "TAB" Text3
How can I do that?
|
|
|
|
|
Check the 'Use Tabstops' checkbox in the style tab of the list box properties.
Then give the text as "Text1\tText2\Text3"
« Superman »
|
|
|
|
|
No I have try that and it dont work.
|
|
|
|
|
What results are you getting?
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
I use ATL Com AppWizard(in embedded Visual C++) to create a signature capturing DLL, i successfully let user to sign on a given rectangle square box.
However,
i have a big problem when coming to capture the signature inside the rectangle and save it to bmp (or jpg) file. i get the following attached code and trying to compile it inside embedded Visual C++ 4.0, and it comes out this error:
"GetDIBits: undeclared identifier" ...
it seems like eVC++(or Pocket PC 2003 SDK) doesn't have this library or doesn't support this function...
is there anyway i can do it ? this problem has been struggling me for few days ...
thanks
int WindowToBmpFile(LPCTSTR szFName, HWND hWnd)
{
HDC hDC, hMemDC;
HANDLE hBits, hFile;
HBITMAP hBitmap, hTmpBmp;
RGBQUAD RGBQuad;
DWORD ImgSize, plSize, dwWritten;
int i, CRes, Height, Width;
BITMAPFILEHEADER bmFH = {0x4d42, 0, 0,0};
LPBITMAPINFO pBmInfo, pBmInfoMem;
if((hFile = CreateFile(szFName, GENERIC_WRITE,0,NULL,CREATE_ALWAYS,FILE_ATTRIBUTE_NORMAL,NULL)) == NULL) return 1;
SetCursor(LoadCursor(NULL, IDC_WAIT));
if(hWnd==HWND_DESKTOP)
{
Width = GetSystemMetrics(SM_CXSCREEN);
Height = GetSystemMetrics(SM_CYSCREEN);
}
else
{
RECT rc;
::GetClientRect(hWnd,&rc);
Width = rc.right-rc.left;
Height = rc.bottom-rc.top;
}
hDC = ::GetDC(hWnd);
hMemDC = CreateCompatibleDC(hDC);
hBitmap= CreateCompatibleBitmap(hDC, Width, Height);
pBmInfoMem = (LPBITMAPINFO)GlobalAlloc(GHND, sizeof(BITMAPINFO)+256*sizeof(RGBQUAD));
pBmInfo = (LPBITMAPINFO)GlobalLock(pBmInfoMem);
ZeroMemory(pBmInfo, sizeof(BITMAPINFO)+256*sizeof(RGBQUAD));
SelectObject(hMemDC, hBitmap);
BitBlt(hMemDC,0,0,Width,Height,hDC,0,0,SRCCOPY);
pBmInfo->bmiHeader.biSize = (DWORD)sizeof(BITMAPINFOHEADER);
pBmInfo->bmiHeader.biWidth = Width;
pBmInfo->bmiHeader.biHeight = Height;
pBmInfo->bmiHeader.biPlanes = 1;
pBmInfo->bmiHeader.biBitCount = (WORD)GetDeviceCaps(hDC, BITSPIXEL);
pBmInfo->bmiHeader.biCompression = BI_RGB;
pBmInfo->bmiHeader.biClrUsed = 256;
GetDIBits(hDC, hBitmap, 0,Height, NULL, pBmInfo, DIB_RGB_COLORS);
if(!pBmInfo->bmiHeader.biSizeImage)
pBmInfo->bmiHeader.biSizeImage = ((((pBmInfo->bmiHeader.biWidth * pBmInfo->bmiHeader.biBitCount) + 31) & ~31) /
* pBmInfo->bmiHeader.biHeight;
CRes = GetDeviceCaps(hDC, SIZEPALETTE);
plSize = CRes*sizeof(RGBQUAD);
ImgSize= pBmInfo->bmiHeader.biSizeImage;
bmFH.bfOffBits = plSize + sizeof(BITMAPINFOHEADER) + sizeof(BITMAPFILEHEADER);
bmFH.bfSize = ImgSize + bmFH.bfOffBits;
WriteFile(hFile, &bmFH, sizeof(BITMAPFILEHEADER), &dwWritten, NULL);
WriteFile(hFile, &(pBmInfo->bmiHeader), sizeof(BITMAPINFOHEADER), &dwWritten, NULL);
hBits = GlobalAlloc(GHND, pBmInfo->bmiHeader.biSizeImage);
LPVOID lpBits = (LPVOID)GlobalLock(hBits);
ZeroMemory(lpBits, pBmInfo->bmiHeader.biSizeImage);
GetDIBits(hDC, hBitmap, 0,Height, lpBits, pBmInfo, DIB_RGB_COLORS);
WriteFile(hFile,lpBits,ImgSize,&dwWritten,NULL);
GlobalUnlock(lpBits);
GlobalUnlock(hBits);
GlobalFree(hBits);
GlobalUnlock(pBmInfo);
GlobalFree(pBmInfoMem);
DeleteObject(hBitmap);
DeleteDC(hMemDC);
::ReleaseDC(hWnd,hDC);
CloseHandle(hFile);
SetCursor(LoadCursor(NULL,IDC_ARROW));
return 0;
}
|
|
|
|
|
Hi,
I have to convert a string which is representating a hex number (e.g. "FE34") into a string which displays the decimal number ("65076"). Because the length of number may be upto 1000 (byte array) I cannot use a sscanf/sprintf methods.
Any ideas how I can solve the problem?
Best Regards
Heiko
|
|
|
|
|
char *s = "FE34", ch;
double dwNUM = 0;
while(*s != NULL)
{
ch = (char)*s;
dwNUM *= 16;
switch(ch) {
case '0':
dwNUM += 0;
break;
case '1':
dwNUM += 1;
break;
case '2':
dwNUM += 2;
break;
case '3':
dwNUM += 3;
break;
case '4':
dwNUM += 4;
break;
case '5':
dwNUM += 5;
break;
case '6':
dwNUM += 6;
break;
case '7':
dwNUM += 7;
break;
case '8':
dwNUM += 8;
break;
case '9':
dwNUM += 9;
break;
case 'A':
dwNUM += 10;
break;
case 'B':
dwNUM += 11;
break;
case 'C':
dwNUM += 12;
break;
case 'D':
dwNUM += 13;
break;
case 'E':
dwNUM += 14;
break;
case 'F':
dwNUM += 15;
break;
default:
break;
}
s++;
}
|
|
|
|
|
Don't forget to uppercase the string or check for lowercase 'a' to 'f'
"An education isn't how much you have committed to memory, or even how much you know. It's being able to differentiate between what you do know and what you don't." - Anatole France
|
|
|
|
|
|