NO

Author Topic: Programming Windows, 5th Edition (weird typecast requirement for x64)?  (Read 381 times)

Offline Abraham

  • Member
  • *
  • Posts: 10
Chapter 16

Project Dibble

Code: [Select]
case 24: * (RGBTRIPLE *) pPixel = * (RGBTRIPLE *) &dwPixel ;error #3114: [asm] Invalid combination of opcode and operand

Solution: cannot de-reference (RGBTRIPLE *) without typecasting to uintptr_t.
Code: [Select]
case 24: * (RGBTRIPLE *) pPixel = * (RGBTRIPLE *) (uintptr_t) (void *) &dwPixel ;

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 1798
Re: Programming Windows, 5th Edition (weird typecast requirement for x64)?
« Reply #1 on: October 27, 2018, 08:29:06 am »
PellesC 9 issue.
A short example for that:
Code: [Select]
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
PellesC 9 issue.
A short example for that:
void __cdecl WinMainCRTStartup(void)
{

DWORD dwPix, dwPixel = 0x123456;
void *pPixel;
//pPixel = &dwPix; // test
* (RGBTRIPLE *) pPixel = * (RGBTRIPLE *) &dwPixel ;
* (RGBTRIPLE *) pPixel = * (RGBTRIPLE *) (void*) &dwPixel ;
ExitProcess(0);
}
May the source be with you