Thread: Access Violation Of Memory Buffer WHY??

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Carnivore ('-'v) Hunter2's Avatar
    Join Date
    May 2002
    Posts
    2,879
    >>You first need to get a pointer to the actual Surface interface.
    Isn't that what lpddsPrimary is? Or are you saying that he didn't initialize that?... Remember, this is DirectDraw (I think the latest was 7), not Direct3D 9.
    Just Google It. √

    (\ /)
    ( . .)
    c(")(") This is bunny. Copy and paste bunny into your signature to help him gain world domination.

  2. #2
    Registered User
    Join Date
    Feb 2003
    Posts
    76
    Right all the initializeation is done before the program enters the real time loop. Therefore everything is already defined.
    lpddsPrimary being the surface that is defined with the palette lpddp.
    I have fixed the problem it was to do with what some of you were saying.
    lpddsPrimary->Lock(NULL,&theSurface, DDLOCK_WAIT | DDLOCK_SURFACEMEMORYPTR , NULL);

    I simply put this in a if statement with a failed function, and now there is no error. I would be most grateful if something could explain why this results in solving the error.
    Code:
    		if (FAILED(lpddsPrimary->Lock(NULL,&theSurface, DDLOCK_WAIT | 
    			DDLOCK_SURFACEMEMORYPTR , NULL)))
    			return 0;

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Access violation... can't figure it out...
    By Raigne in forum C++ Programming
    Replies: 7
    Last Post: 10-11-2007, 10:52 AM
  2. access violation in int array
    By George2 in forum C Programming
    Replies: 2
    Last Post: 08-02-2007, 11:28 PM
  3. Access violation when reading a string.
    By Desolation in forum C++ Programming
    Replies: 16
    Last Post: 05-01-2007, 10:25 AM
  4. how to access memory
    By zhu_dave in forum Tech Board
    Replies: 7
    Last Post: 01-10-2007, 06:57 AM
  5. Strange access violation
    By jimmy_anttila in forum Windows Programming
    Replies: 2
    Last Post: 04-11-2004, 03:10 AM