|
Good Morning,
I got a small problem...
I use 2 Picture Control boxes. the first box play a stream from my webcam, the second should be overlap the first, and show a grabbed edited frame.
I just use m_webcam.ShowWindow(0) and m_pic.ShowWindow(1).
The Problem is, after i called this, the Picturebox is empty. But when i minimize and maximize the window, the Picture is shown like i expected.
Is there a way to redraw the picturebox??
|
|
|
|
|
CWnd::Invalidate is used to force the redrawing ofa certain window or control. If that helps !
Our Philosophy, Mohammed Baqir Al Sadr
|
|
|
|
|
Thank you for your awnser. I tried it, but the problem is still the same
|
|
|
|
|
I am missing the details of your problem. But it is sure that you must take care in case for video streaming application where usually the redering window is asynchronously updated by a worker thread that fetches the video data, such that if a resize or a certain wm_paint happens on the main UI thread for the rendering window, the last picture is lost unles you do manually persist it each time the worker thread brings it, so to render it in the context of the ONPaint, or the OnDraw or any similar handler executing on the context of the main UI thread.
I encountered this case in many contexts, the first with Windows RTC (videoconferencing)..
Good luck !
Our Philosophy, Mohammed Baqir Al Sadr
|
|
|
|
|
Hello everyone,
I am searching information about the number of nodes which B+ tree update/delete/insert operation will modify (e.g. modify the link to the parent or sibling). The expected information I want is, for example, insert operation will change at least 2 but at most 3 nodes.
Unfortunately, I cannot find such proved information and only the basic implementations of B+ tree. Does anyone have any conclusions or reference materials?
thanks in advance,
George
|
|
|
|
|
George_George wrote: Does anyone have any conclusions or reference materials?
Have you seen here?
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Thanks DavidCrow,
I think the article only mentions the implementation details (in reference section) for insert/delete/update, not no prove or conclusion for the min/max number of nodes which will be changed (if they are still in the tree).
Any comments?
regards,
George
|
|
|
|
|
You could always step through the source code.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Thanks DavidCrow,
I just want to find some one sentence conclusion for the # of nodes changed (conclusion I mean somehting like, like # of external nodes are the # of internal nodes + 1 in a binary tree), and reading source code is slow.
regards,
George
|
|
|
|
|
George, if you need a formal proof you need to talk to this lady[^] who knows more about b+ trees than the bees themselves.
"The secret of happiness is freedom, and the secret of freedom, courage."
Thucydides (B.C. 460-400)
|
|
|
|
|
Thanks Matthew!
Why you refer her, she is the inventor for B+ Tree?
I just want to have some conclusion like the max/min time complexity of quick sort, I am surprised it is so hard to find and get an answer.
regards,
George
|
|
|
|
|
Hi all
What is wrong with my function? it keeps crashing when it gets to return.
bool CUpdateServiceModule::DoCheckForProductUpdates(ns1__Update oUpdateCode, RMproduct* prd)
{
iRet = m_pWebServiceSoap->__ns2__DoCheckForProductUpdates(pDoCheckForProductUpdates,pDoCheckForProductUpdatesResponse);
switch(iRet)
{
case SOAP_OK :
{
if(pDoCheckForProductUpdatesResponse->DoCheckForProductUpdatesResult)
{
pDoGetLatestProduct->productName = pDoCheckForProductUpdates->productName;
iRet = m_pWebServiceSoap->__ns2__DoGetLatestProduct(pDoGetLatestProduct,pDoGetLatestProductResponse);
switch(iRet)
{
case SOAP_OK :
{
RMUpdates* update = new RMUpdates;
break;
return true;
}
default:
{
Log(GetSoapError());
}
}
}
}
default:
{
Log(GetSoapError());
}
}
return false;
}
I am getting this error:
Unhandled exception at 0x004970b6 in UpdateService.exe: 0xC0000005:
Access violation reading location 0xcdcdcdd5.
Please Advise
thanks,
Jayjay
|
|
|
|
|
are you acquainted with the debugger! if not know it better. may be there is some uninitialized memory that you are using or you may be accessing some out-of-bounds variable.
what happens when you debug?
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Did you check the Call Stack?
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
By looking at code i cant tell you exactly why its crashing but i can point out few things.
1. Your function will never return true.
monsieur_jj wrote: break;
return true;
due to break following statement will never get executed.
2.
monsieur_jj wrote: RMUpdates* update = new RMUpdates;
You are just creating new instance and doing nothing with it?? How are you going to access this instance after your function returns. (If at all you need).
I hope it helps.
Regards,
Sandip.
|
|
|
|
|
This is the whole code I apologize
bool CUpdateServiceModule::DoCheckForProductUpdates(ns1__Update oUpdateCode, RMproduct* prd)
{
int iRet = SOAP_ERR;
_ns1__DoCheckForProductUpdates *pDoCheckForProductUpdates;
_ns1__DoCheckForProductUpdatesResponse *pDoCheckForProductUpdatesResponse;
pDoCheckForProductUpdates = InstantiateCheckUpdate();
pDoCheckForProductUpdatesResponse = InstantiateCheckUpdateResponse();
USES_CONVERSION;
pDoCheckForProductUpdates->productName = new std::string(W2A(prd->m_Name.c_str()));
pDoCheckForProductUpdates->productVersion = new std::string(W2A(prd->m_VersionNo.c_str()));
pDoCheckForProductUpdates->serialNumber = new std::string(W2A(prd->m_SerialNo.c_str()));
pDoCheckForProductUpdates->siteCode = new std::string(W2A(prd->m_SiteCode.c_str()));
_ns1__DoGetLatestProduct *pDoGetLatestProduct;
_ns1__DoGetLatestProductResponse *pDoGetLatestProductResponse;
pDoGetLatestProduct = InstantiateGetProduct();
pDoGetLatestProductResponse = InstantiateGetProductResponse();
iRet = m_pWebServiceSoap->__ns2__DoCheckForProductUpdates(pDoCheckForProductUpdates,pDoCheckForProductUpdatesResponse);
switch(iRet)
{
case SOAP_OK :
{
if(pDoCheckForProductUpdatesResponse->DoCheckForProductUpdatesResult)
{
pDoGetLatestProduct->productName = pDoCheckForProductUpdates->productName;
pDoGetLatestProduct->productVersion = pDoCheckForProductUpdates->productVersion;
pDoGetLatestProduct->serialNumber = pDoCheckForProductUpdates->serialNumber;
pDoGetLatestProduct->siteCode = pDoCheckForProductUpdates->siteCode;
iRet = m_pWebServiceSoap->__ns2__DoGetLatestProduct(pDoGetLatestProduct,pDoGetLatestProductResponse);
switch(iRet)
{
case SOAP_OK :
{
RMUpdates* update = new RMUpdates;
update->prdName = prd->m_Name.c_str();
update->nameVer = std::wstring(A2W(pDoGetLatestProductResponse->DoGetLatestProductResult->Version->c_str()));
update->link.append(DOWNLOADLINK);
update->link.append(std::wstring(A2W(pDoGetLatestProductResponse->DoGetLatestProductResult->Link->c_str())));
update->savePath = SetDestination(update->link.c_str());
prd->updateList->push_back(update);
return true;
}
default:
{
Log(GetSoapError());
}
}
}
}
case SOAP_CLI_FAULT :
{
return false;
}
case SOAP_SVR_FAULT :
{
return false;
}
case SOAP_TAG_MISMATCH :
{
return false;
}
case SOAP_TYPE :
{
return false;
}
case SOAP_SYNTAX_ERROR :
{
return false;
}
case SOAP_NO_TAG :
{
return false;
}
case SOAP_IOB :
{
return false;
}
case SOAP_MUSTUNDERSTAND :
{
return false;
}
default:
{
Log(GetSoapError());
}
}
return false;
}
|
|
|
|
|
I rechecked it and it seems that it crashes when i pushback
|
|
|
|
|
This is where i get the error:
void resize(size_type _Newsize, _Ty _Val)
{
if (size() < _Newsize)
_Insert_n(end(), _Newsize - size(), _Val);
else if (_Newsize < size())
erase(begin() + _Newsize, end());
}
size_type size() const
{
return (_Myfirst == 0 ? 0 : _Mylast - _Myfirst);
}
"Unhandled exception at 0x004970b6 in UpdateService.exe: 0xC0000005: Access violation reading location 0xcdcdcdd5."
any advise?
I apologize for not posting the whole code as i believe it was too long.
Thanks,
jayjay
|
|
|
|
|
monsieur_jj wrote: it keeps crashing when it gets to return.
As there are two, which return are you referring to?
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
DavidCrow wrote: As there are two, which return are you referring to?
Can only be the last one since the first is unreachable due to the break-statement.
This also means that the function always returns false...
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
Roger Stoltz wrote: Can only be the last one since the first is unreachable due to the break-statement.
This also means that the function always returns false...
I know. I couldn't think of any other way to say, "What's with this code?"
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
DavidCrow wrote: I know. I couldn't think of any other way to say, "What's with this code?"
Well, the answer could be "there's a lot with this code".
Memory leak, unreachable code....
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
Roger Stoltz wrote: unreachable code....
i like this type of coding [ ]
|
|
|
|
|
ThatsAlok like this type of coding
Well, if the code doesn't execute it certainly cannot do anything wrong.
Playing it safe, Alok?
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
Roger Stoltz wrote: Playing it safe, Alok? [Big Grin]
Life all about playing safe .. atleast no body find the bug there
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You/xml>
|
|
|
|