could some1 have a look
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Thread: could some1 have a look

  1. #1
    Join Date
    Jul 2009
    Posts
    3

    could some1 have a look

    ok so i try compiling this and i get

    error C2036: 'void *' : unknown size

    on this peice of code

    Write_PATCH((void*)0xCFBE9C+0xBC, &MYCOORDPTR, sizeof(MYCOORDPTR));
    DWORD YCOORD2 = 0xCFBE9C+0xBC+0x8;//2

    can any1 tell me what i have wrong?

  2. #2
    Join Date
    Jul 2009
    Posts
    3

    Re: could some1 have a look

    sry didnt find how to edit my post....


    i know i can write it like this

    Write_PATCH((void*)0xCFBF58, &MYCOORDPTR, sizeof(MYCOORDPTR));
    DWORD YCOORD2 = 0xCFBE9C+0xBC+0x8;//2

    but for the sake of learning why cant i write it like this

    Write_PATCH((void*)0xCFBE9C+0xBC, &MYCOORDPTR, sizeof(MYCOORDPTR));
    DWORD YCOORD2 = 0xCFBE9C+0xBC+0x8;//2

  3. #3
    Join Date
    Jul 2002
    Posts
    2,505

    Re: could some1 have a look

    (char*)0xCFBE9C+0xBC
    Can be written as:
    0xCFBE9C+0xBC*sizeof(char)

    (short*)0xCFBE9C+0xBC
    Can be written as:
    0xCFBE9C+0xBC*sizeof(short)

    Your code:
    (void*)0xCFBE9C+0xBC
    Can be written as:
    0xCFBE9C+0xBC*sizeof(void) // ??

    sizeof(void) is not defined, you don't provide enough information to make pointer arithmetic. But you can write:
    (void*)(0xCFBE9C+0xBC)

  4. #4
    Join Date
    Jul 2009
    Posts
    3

    ty

    thank you very much

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center