|
Yes it s a real one but i don´t have internet on week end. Sorry! I have just checked my mail on guillaume.arfaoui@eleves.ec-nantes.fr but i did not receive any mail from you. Just give me your mail so that i can send you a zip file.
Anyway thank you very much for your help!
|
|
|
|
|
Send that one to
deja
vu
nic
@
Gm ail
He's become a household word in the Lounge. A whole new phraseology has evolved. Post a link or reply with a smiley and rose, and you've made a "Satipsism". So what? It's an interesting thing about the Internet, the evolution (as in change, not progress) of tone, quality, terminology, etc.
-Marc Clifton.
Best wishes to Rexx[^
|
|
|
|
|
ok thank you very much! i would like to send it right now but i don´t catch your mail...
its dejavunic@Gmail.???
|
|
|
|
|
Hello,
I'd like to know if it's somehow possible to obtain a transparency effect for a control (let's say a button for example) placed over a video playing window in WinAPI/MFC without using advanced graphics programming (e.g DirectX, OpenGL).
To be more specific the first example that passes through my mind are the button controls in RadLight video player.
The WinAPI SetLayeredWindowAttributtes function does its job quite ok but the result contains an ugly flicker effect.
Many thanks in advance for any answer
|
|
|
|
|
I think you got it all in the question: Yes it is possible, but not without the ugly flickering.
|
|
|
|
|
It can be done if you have control over your video rendering.
Some ways to eliminate flicker are double buffering (or drawing on each video frame before it's
rendered) and using clipping regions.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
garfaoui wrote: lead to the following error: <;146 C:\Documents and Settings\garfaoui\Ambiente de trabalho\test\clippr\main.cpp no matching function for call to `strcmp(std::string&, std::string&)' >
perfecty normal to me :p
|
|
|
|
|
oh yes? ... why? what should I type?
|
|
|
|
|
string s1 = "shilpi";
string s2 = "shilpi";
if(strcmp(s1.c_str(),s2.c_str())==0)
{
printf("Hi");
}
what i wanna say is this ,try it
Yes U Can ...If U Can ,Dream it , U can do it ...ICAN
|
|
|
|
|
that's crap. why in hell do you cast the strings objects to C-style strings to use the C runtime to compare them, when the string class provide various comparison operators ?
|
|
|
|
|
It is up to you ..i m just giving u one solution
Yes U Can ...If U Can ,Dream it , U can do it ...ICAN
|
|
|
|
|
i'm not the guy who was asking. and me too is trying to give best answers...
so please read the other posts when you have answers to see if it has not already been submitted, or if someone gave a better answer
|
|
|
|
|
Hello,
how to check if an object has a valid adress or is valid pointer?
I got errors when i try to clear CMapStringToOb!
tanks for help!
termal
|
|
|
|
|
I have the same problem.Trying to check a pointer validity i get Access Violation
void CMainFrame::OnSize(UINT nType, int cx, int cy)
{
CFrameWnd::OnSize(nType, cx, cy);
if ( (m_hWnd != NULL) && (m_pRightPaneFrame !=NULL) )
{
------------->if (m_pRightPaneFrame->m_pSplitterView != NULL) ----> I get Unhandled exception in XXXXX : Access Violation
{
}
}
}
Is there anyway to check an unallocated pointer for validity without getting errors ? What seems to be wrong here ?
Regards,
sdancer75
|
|
|
|
|
In practice, you can't. The only way to know whether an address is valid is to try it; if not valid you'll get an access violation. That still won't tell you whether the pointer value actually points to what you expect it to.
The only answer is to be disciplined. Avoid pointer arithmetic whenever possible. Prefer using classes to raw data structures, so that bounds can be checked. Ensure all variables are initialised. Use smart pointers. Do these, and the chances of random memory corruption are much reduced.
|
|
|
|
|
As stated by Mike Dimmick, be disciplined.
However, IMHO, you don't need avoid pointer usage: you have only to handle pointers with care. For instance, always initialise pointers, either with NULL or with a valid memory area. Remember also to set to NULL a pointer immediately after you've released the pointed area.
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.
|
|
|
|
|
Hello,
thanks for answers!
regards
termal
|
|
|
|
|
As Mike Dimmick said there are no 100% sure methods to verify a pointer. Nevertheless here are some basic techniques that could be used to increase the odds.
Some basic check that works on all pointers:
<br />
VERIFY(NULL != lpSomePointer)<br />
VERIFY(0 == (lpSomePointer & 3));<br />
At this point it *might* be a pointer because the number is an even number which is not NULL.
Microsoft supplies the functions IsBadCodePtr() and IsBadWritePtr() for checking the memory location. An example of using it on a function pointer might be:
if(FALSE == IsBadCodePtr((FARPROC)(LPVOID)pInstructions))<br />
{<br />
}
While using it on a pointer to a writable address might look like:
if(FALSE== IsBadWritePtr((LPVOID)pInstructions,1))<br />
{<br />
}
If you wanted to create your own verification to check if the pointer is pointing to a memory address which is executable... for a function pointer you might do something like:
MEMORY_BASIC_INFORMATION mbi;<br />
if(VirtualQueryEx(GetCurrentProcess(),(LPVOID)pInstructions,&mbi,sizeof(MEMORY_BASIC_INFORMATION)))<br />
{<br />
if(mbi.Protect & PAGE_EXECUTE_READ && mbi.State & MEM_COMMIT && mbi.AllocationProtect & PAGE_EXECUTE_WRITECOPY && mbi.Type & MEM_IMAGE)<br />
{<br />
(*this.*MyMemberFunction)(someval);<br />
}<br />
}
If you wanted to write some extremely hacked-up NON-PORTABLE and compiler specific code to do some additional checking on a C++ member function you might look for some prologue asm instructions:
For example:
push esi
push edi
<br />
unsigned char ASM[] = "\x56\x57\x8B\x7C\x24\x0C";<br />
PDWORD pAddress = (PDWORD)&SomeFucntion;<br />
DWORD_PTR pInstructions = *pAddress;<br />
if(memcmp((LPVOID)pInstructions,ASM,sizeof(ASM))<br />
{<br />
}<br />
There is no guarantee that your compiler will produce a specific asm prologue... or the function may become _inline in which case this technique would fail.
I cant really think of anymore methods... and to be honest the ones listed above do not make any guarantees.
Best Wishes,
-Randor (David Delaune)
|
|
|
|
|
Hello Randor,
thanks for your info!
regards
termal!
|
|
|
|
|
Don't use IsBadXxxPtr() , they don't actually do what their names say. Check out Raymond Chen's and Larry Osterman's blogs as they have talked about why you should avoid them.
|
|
|
|
|
Don't use IsBadXxxPtr() , they don't actually do what their names say. Check out Raymond Chen's and Larry Osterman's blogs as they have talked about why you should avoid them.
|
|
|
|
|
The client connect to the sever but a exceptions ocurr in this funtcion.
CAsyncSocket::DoCallBack(WPARAM wParam, LPARAM lParam)
{
pSocket = CAsyncSocket::LookupHandle((SOCKET)wParam, FALSE);
if (pSocket == NULL)
{
// Must be in the middle of an Accept call
pSocket = CAsyncSocket::LookupHandle(INVALID_SOCKET, FALSE);
/***************************************************/
ASSERT(pSocket != NULL);// in this statement
//why the pSocket is NULL
/***************************************************************/
pSocket->m_hSocket = (SOCKET)wParam;
CAsyncSocket::DetachHandle(INVALID_SOCKET, FALSE);
CAsyncSocket::AttachHandle(pSocket->m_hSocket, pSocket, FALSE);
}
}
msn:xxblinux@hotmail.com
|
|
|
|
|
|
|
the diff b/w long pointer to string and pointer to string and where each one is used
|
|
|
|