->必须指向类/结构/联合/泛型类型错误
-> must point to class/struct/union/generic type error
typedef struct{
IMAGE *fuente;
IMAGE *destino;
int saltos;
} ARGTHREAD;
ARGTHREAD values;
DWORD WINAPI ProcessThread(LPVOID arg){
int i,j,imageRows,imageCols,C,R;
PIXEL *pfte,*pdst;
PIXEL *v0,*v1,*v2,*v3,*v4,*v5,*v6,*v7;
//memcpy(arg->destino, arg->fuente,sizeof(IMAGE)-sizeof(PIXEL *));
imageRows = arg->fuente->infoheader.rows;//error here ->
imageCols = arg->fuente->infoheader.cols;//error here ->
//arg->destino->pixel=(PIXEL *)malloc(sizeof(PIXEL)*imageRows*imageCols);
i=arg->saltos;//error here ->
R=imageRows-1;
C=imageCols-1;
while(i<R){
j=1;
while(j<C){
pfte=arg->fuente->pixel+imageCols*i+j;//error here ->
v0=pfte-imageCols-1;
v1=pfte-imageCols;
v2=pfte-imageCols+1;
v3=pfte-1;
v4=pfte+1;
v5=pfte+imageCols-1;
v6=pfte+imageCols;
v7=pfte+imageCols+1;
pdst=arg->destino->pixel+imageCols*i+j;//error here ->
if(abs(blackandwhite(*pfte)-blackandwhite(*v0))>DIF ||
abs(blackandwhite(*pfte)-blackandwhite(*v1))>DIF ||
abs(blackandwhite(*pfte)-blackandwhite(*v2))>DIF ||
abs(blackandwhite(*pfte)-blackandwhite(*v3))>DIF ||
abs(blackandwhite(*pfte)-blackandwhite(*v4))>DIF ||
abs(blackandwhite(*pfte)-blackandwhite(*v5))>DIF ||
abs(blackandwhite(*pfte)-blackandwhite(*v6))>DIF ||
abs(blackandwhite(*pfte)-blackandwhite(*v7))>DIF){
pdst->red=0;
pdst->green=0;
pdst->blue=0;
}
else{
pdst->red=255;
pdst->green=255;
pdst->blue=255;
}
j++;
}
i = i+numProc;
}
}
这就是我创建胎面的方式:
myThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE(进程线程, &值, 0, 空(;
我收到很多这些错误,我不知道为什么?
错误8 错误 C2228:".cols"左侧必须具有类/结构/联合
arg
是一个void*
指针,如果不先将其转换回适当的类型,您将无法从中获取任何内容:
ARGTHREAD* arg_values = static_cast<ARGTHREAD*>(arg);
// use arg_values->...
您的程序请求 void*
的元素,该元素不是类型(带有成员(。首先将其转换为已传递的类型(ARGTHREAD
(,然后您可以将void*
视为ARGTHREAD*
。
相关文章:
- 如何将结构/联合数组的成员传递到函数中
- 错误 C2228 左侧'.setDay'必须具有类/结构/联合
- 在C++中为结构(联合)创建构造函数
- '.expression'左边必须有类/结构/联合
- C++错误 C2227:'->looseHealth'左侧必须指向类/结构/联合/泛型类型
- C 结构/联合到C#结构
- C++ 使用比较 - '.compare'左侧必须具有类/结构/联合
- 表达式必须具有类类型,'.x'左侧必须具有类/结构/联合
- 错误c++visual studio c2227左侧'->;Init';必须指向类/结构/联合/泛型类型
- .BEGIN的左侧必须具有类/结构/联合
- 我的测试用例错误类/结构/联合
- C++ 异常情况下的错误 C2228(".val"的左侧必须具有类/结构/联合)
- 错误 C2228:".x"的左侧必须具有类/结构/联合
- 错误:C2228:左侧必须具有类/结构/联合
- 错误 C2228:".printStats"的左侧必须具有类/结构/联合
- '.getDrinkPrice'左边必须有类/结构/联合
- 通过反射在XML中的C/C++头文件中定义的可视化嵌套结构/联合
- 错误 C228:"必须多次具有类/结构/联合"的左侧
- 正在分析XML中C/C++头文件中定义的嵌套结构/联合
- 错误 C2228:'.Alloc'左侧必须具有类/结构/联合