|
can provide any one out of this
thanks.
|
|
|
|
|
Le@rner wrote: i want its a valid zip file or not.
Are you using some sort of ZIP library or API?
"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
|
|
|
|
|
use the LiteZip and LiteUnZip article from code project.
LiteZip and LiteUnzip[^]
i am use its dll in my application.
|
|
|
|
|
So why not post your question to that article so the author will see it? Surely he has written some sort of "zip test" functionality to that library.
"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
|
|
|
|
|
Hello,
i googled a lot and and dont know what is the best way to messure the time that takes an execution of a function,is there some "stopwatch" in MFC?
Thanks
|
|
|
|
|
Just use QueryPerformanceCounterFrequency and QueryPerformanceCounter.
See here[^]
|
|
|
|
|
Hey,
Just to make sure i understood right
I query the count at the begining and at the end, then i devide it by the frequency and the result is the soconds?
Thanks
|
|
|
|
|
A thing to note: 'to measure' is the act of determining the value of a property. 'to mess (something up)' is somewhat synonym to 'meddle' or 'create chaos'. I'll assume that by 'messure' you mean the former, not the latter. 
|
|
|
|
|
To 'meddle' with the 'value of a property': messure
> 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.<
|
|
|
|
|
Hello,
I created owner drawn listbox and I used double buffering
for preventing flickering because I have a lot of data ,
the problem is that its don't present all the items and ,
whan I scroll it down and up its erases part of the items,
the code is:
void HistDlg::OnDrawItem(int nIDCtl, LPDRAWITEMSTRUCT lpDrawItemStruct)
{
if(IDC_LIST1 ==nIDCtl)
{
int width=lpDrawItemStruct->rcItem.right-lpDrawItemStruct->rcItem.left;
int height=lpDrawItemStruct->rcItem.bottom-lpDrawItemStruct->rcItem.top;
HDC memDC1 = CreateCompatibleDC(lpDrawItemStruct->hDC);
HBITMAP hMemBmp = CreateCompatibleBitmap(lpDrawItemStruct->hDC,width , height);
HBITMAP hOldBmp = (HBITMAP)SelectObject(memDC1, hMemBmp);
CDC *memDC=CDC::FromHandle(memDC1);
memDC->FillSolidRect(0,0, width, height,RGB(255,255,255));
int ODI_length =
1 + SendDlgItemMessage(IDC_LIST1,
LB_GETTEXTLEN,
lpDrawItemStruct->itemID,
0);
if (ODI_length)
{
wchar_t *ODI_wstr = NULL;
ODI_wstr = new wchar_t[ODI_length];
if (ODI_wstr)
{
COLORREF ODI_old_text_color;
SendDlgItemMessage(IDC_LIST1,
LB_GETTEXT,
lpDrawItemStruct->itemID,
(LPARAM)ODI_wstr);
memDC->DrawText(ODI_wstr,
ODI_length - 1,
&lpDrawItemStruct->rcItem,
DT_RIGHT);
}
}
BitBlt(lpDrawItemStruct->hDC, 0, 0, width,height, memDC1, 0, 0, SRCCOPY);
SelectObject(memDC1, hOldBmp);
DeleteObject(hMemBmp);
DeleteDC(memDC1);
}
}
What doe's I'm doing wrong?
thanks
|
|
|
|
|
aangerma wrote: BitBlt(lpDrawItemStruct->hDC, 0, 0, width,height, memDC1, 0, 0, SRCCOPY);
Shouldn't this be:
LONG left = lpDrawItemStruct->rcItem.left;
LONG top = lpDrawItemStruct->rcItem.top;
BitBlt(lpDrawItemStruct->hDC, left, top, width,height, memDC1, 0, 0, SRCCOPY);
?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hello,
I am writing an application that perform image acquisition frome a camera.
The image aqcuisition is done by a DLL Supplied by the camera manufactorer.
Basicaly im initializing the DLL and then i start capture,in my application i defened a function that is called by the DLL every captured frame,this "OnFrameCapturedHandler" function gets the frame as the parameter.
Then i perform some calculation on the frame and i display it on the GUI.
But the problem is that the grabbing is faster then my calculation so what happens is that a new frame comes in while the previous is still processed.So what i need is some way to block or to make "OnFrameCapturedHandler" not to do anything while previos frame is Processed.
I tried to put boolean at the begining of "OnFrameCapturedHandler" and set it to false while still processing and at the end set it to true.
And before entering the "OnFrameCapturedHandler" check it.but it freezes my app.
???
Thnaks.
|
|
|
|
|
I think the comments from Pete O'Hanlon in this thread[^] explain what is wrong and what you need to do.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
|
I just want to point out that if, as you say "the problem is that the grabbing is faster then my calculation" , then you are destined to lose frames. Threads and frame queues may help with the management of the arriving data but it is basic queueing, if your per-frame processing time exceeds the frame inter-arrival time, you will have problems. This basic tenet was masterfully demonstrated by the late Lucile Ball in the famous "chocolate candy factory" skit. Processing/interarrival mismatch[^]
Once you get the synchronization of the threads and queueing out of the way, you either need to make your processing faster or decide on how you choose which incoming frames to discard.
modified 13-Dec-11 10:46am.
|
|
|
|
|
|
Motion detection / Reverse Camera Software
I will like to create a motion detection application that displays/ previews a moving image on a windows machine when power is applied to a camera and removes the preview when the power is removed from the camera.
I was thinking a motion detection application would be best as when power is off there should be no motion, while the opposite applies when power is applied and the camera is receiving signal.
The app will need to poll the video feed all the time to ensure when power is applied the image is displayed very quickly.
Where do I start and can someone provide some advice.
|
|
|
|
|
Depending on the type of the camera you may 1) receive a signal from the driver when the video signal is lost or 2) receive wholly black images, or 3) receive a frozen image.
Case 1 is obvious to handle.
Case 2 is best solved by computing the average gray level on the whole image (will be exactly 0 or a small constant).
Case 3 is addressed by checking that consecutive images are exactly the same.
You can do this very quickly, say <1 microsecond, by considering a small sample of pixels, say 1000.
True motion detection is relevant only if you want to switch off the camera when the scene is still (but the camera plugged). Otherwise, it is overkill.
|
|
|
|
|
This is quite a wide subject and cannot be answered in a forum like this. I would suggest you start with Google.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
I insert flash player activex on the MFC application and write the code
my_flash.put_Movie("C:\file.flv");
my_flash.put_Playing(true)
but file is not playing . also I want to display the controls of flash player activex .
how can I do this
Trioum
|
|
|
|
|
Looks like a '\' is missing in the file path. Try "C:\\file.flv".
|
|
|
|
|
do it still not playing
Trioum
|
|
|
|
|
This is going to be a busy day, I have this ODBC parameter issue, MD5 password Hash, and encryption to tackle today.
After reading the OLEDB post by Microsoft, I decided to give ODBC a try, and so far so good. If I can use parameters to build my SQL Command like in asp.net, I will give the thumbs up for it.
I'm pretty sure I have the order right. But I think I'm missing a statement or handle. Or I should go back to the non W versions, and start again. I'm not really sure.
retcode = SQLAllocHandle(SQL_HANDLE_STMT, hdbc, &hstmt);
WCHAR pzSQLCommand[512];
swprintf_s(pzSQLCommand, 512,
L"INSERT INTO UserInfo(FirstName) "
L"VALUES(@FirstName)");
pzSQLCommand[wcslen(pzSQLCommand) + 1] = L'\0';
SQLHDESC hIpd = NULL;
retcode = SQLGetStmtAttrW(hstmt, SQL_ATTR_IMP_PARAM_DESC, &hIpd, 0, 0);
retcode = SQLSetDescFieldW(hIpd, 0, SQL_DESC_NAME, L"@FirstName\0", SQL_NTS );
retcode = SQLBindParameter(hstmt, 0, SQL_PARAM_INPUT, SQL_C_WCHAR, SQL_VARCHAR, 0, 0, pzFirstName, 25, &cbFirstName );
retcode = SQLPrepareW(hstmt, pzSQLCommand, wcslen(pzSQLCommand) );
retcode = SQLExecute(hstmt);
|
|
|
|
|
I got this to work, but I think the SQLGetStmtAttr and SQLSetDescField was skipped.
But I think the order is correct, and each statement returned a 0
retcode = SQLAllocHandle(SQL_HANDLE_STMT, hdbc, &hstmt);
WCHAR pzSQLCommand[512];
swprintf_s(pzSQLCommand, 512,
L"INSERT INTO UserInfo(FirstName) "
L"VALUES(?)");
pzSQLCommand[wcslen(pzSQLCommand) + 1] = L'\0';
retcode = SQLPrepare(hstmt, pzSQLCommand, SQL_NTS );
retcode = SQLBindParameter(hstmt, 1, SQL_PARAM_INPUT, SQL_C_WCHAR, SQL_VARCHAR, 25, 0, pzFirstName, wcslen(pzFirstName), NULL );
retcode = SQLGetStmtAttr(hstmt, SQL_ATTR_IMP_PARAM_DESC, &hIpd, 0, 0);
retcode = SQLSetDescField(hIpd, 1, SQL_DESC_NAME, L"@FirstName", SQL_NTS );
retcode = SQLExecute(hstmt);
|
|
|
|
|
I don't know what your question is.
And there is no way for SQLGetStmtAttr to be "skipped" in the code that you posted.
|
|
|
|
|