This error is caused by a void pointer. If it is another type, this error will not occur. My error is due to the offset operation on the void * pointer, to write data, the original code is as follows:
Void * halfbi;
Int M = n = I = 0;
Halfbi = globalalloc (ghnd, dwbmbitssize/2 );
While (I <1024*768)
{
Memcpy (halfbi + M, lpbi + sizeof (bitmapinfoheader) + dwpalettesize + N, 32 );
M = m + 32;
N = N + 64;
}
In this case, error c2036: 'void * ': Unknown size occurs. Why?
Next, let me talk about my opinion: Because the variable defined by my portal is void *, void is not fixed to the number of bytes as a unit (INT type is 4 bytes (on C ++ )), so if halfbi increment or decrease the offset operation, the system will not know how many bytes your pointer should offset by adding 1, which leads to address uncertainty, of course, the problem can be solved after the problem is found. The problem can be completely solved by forced conversion of excitation types. The modified code is as follows:
Char * halfbi;
Int M = n = I = 0;
Halfbi = (char *) globalalloc (ghnd, dwbmbitssize/2 );
While (I <1024*768)
{
Memcpy (void *) halfbi + M, lpbi + sizeof (bitmapinfoheader) + dwpalettesize + N, 32 );
M = m + 32;
N = N + 64;
}