Re: memcpy

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Steve Russell (srussell_at_removethisinnernet.net)
Date: 05/31/04


Date: Sun, 30 May 2004 21:36:41 -0400

Actually, BitBlt is completely acceptable for this task. I just wanted to
understand memcpy by using it successfully, not to mention clean up the dc
and bitmap code that is required with BitBlt. Furthermore, there will be
times when I want to copy one or more pixels from one DIBSection to another,
and I didn't think BitBlt was a good choice for that. Am I wrong?

As for single-stepping, I am just doing a regular execute. Any other ideas
on that?
----------------
> You have tried to single-step into memcpy in the debugger. The debugger is
looking for the
> source code so it can single step. Don't single-step into memcpy and you
will avoid this
> message. Otherwise, ignore it, but you'll have to single-step through
assembly code,
> except that you won't have comments displayed (if you want the source, you
can install the
> C Runtime source; just go to control panel, add/remove programs, click on
your Visual
> Studio installation, I think the next dialog is an option to add or remove
components;
> check that; then drill down in the various options until you come to the
one to install C
> runtime source code. Check this. Don't uncheck anything you still want.
When you click the
> final OK or whatever box, you will be asked to put your various CDs in,
and the source
> code (or other options you've selected) will be installed..
>
> Note that memcpy only works if the source and destination do not overlap.
If they overlap
> in any way, you must use memmove, not memcpy.
>
> Is performance so critical that BitBlt is unacceptable? Unless you know
this for certain,
> your memcpy/memmove will probably be as bad.
> joe
>
>
> On Sun, 30 May 2004 17:57:26 -0400, "Steve Russell"
<srussell@removethisinnernet.net>
> wrote:
>
> >Is there anything special to know about using memcpy in MFC? I am
> >attempting to replace a Bitblt operation between two DIBSections. It's
my
> >first crack at memcpy, and I keep getting this popup: Please enter the
path
> >for MEMCPY.ASM.
> >
> >debugger:
> >memcpy(unsigned char * 0x003fcb60, unsigned char * 0x00c0cb60, unsigned
long
> >3) line 353
> >
> >int stride = (m_nWidth * 3 + 3) & (~3);
> >for (int y = 0; y < m_nHeight; y++)
> > for (int x = 0; x < m_nWidth; x++)
> > {
> > int pxImage = stride * (m_nHeight - y - 1) + 3 * x;
> > int pxRestore = stride * (m_nHeight - y - 1) + 3 * x;
> > memcpy((LPVOID *)m_dibsImage[0]->m_pBits + pxImage,
> > (LPVOID *)m_dibsRestore[0]->m_pBits + pxRestore, 3);
> > }
> >
>
> Joseph M. Newcomer [MVP]
> email: newcomer@flounder.com
> Web: http://www.flounder.com
> MVP Tips: http://www.flounder.com/mvp_tips.htm



Relevant Pages

  • Re: memcpy
    ... You have tried to single-step into memcpy in the debugger. ... source code so it can single step. ... except that you won't have comments displayed (if you want the source, you can install the ...
    (microsoft.public.vc.mfc)
  • Re: memcpy
    ... > memcpy isn't all that exciting as these things go; I tend to use BitBlt ... > behavior is not specified when regions overlap, ...
    (microsoft.public.vc.mfc)
  • Re: memcpy
    ... I've never seen that dialog pop up unless I'm single-stepping into a C runtime routine ... memcpy isn't all that exciting as these things go; I tend to use BitBlt because that way I ... behavior is not specified when regions overlap, and is allowed to be platform-dependent. ...
    (microsoft.public.vc.mfc)
  • Re: memcpy and bitblt
    ... BitBlt or MemCpy and it does not depend of graphics card. ... > From one DIBSection to another, how does the speed of memcpy compare with ...
    (microsoft.public.win32.programmer.gdi)
  • Re: Source Code for memcpy()
    ... smnoff wrote: ... [Not that there aren't reasons, but I'm curious as to what they are.] ... Note that there is no "the" source code for memcpy. ...
    (comp.lang.c)