David Adam wrote: > Hello > > >- devmode->dmSize = sizeof(DEVMODEW); > >- devmode->dmSpecVersion = MAKEWORD(1,4); > >- devmode->dmDriverVersion = MAKEWORD(1,4); > >+ devmode->dmSize = FIELD_OFFSET(DEVMODEW, dmICMMethod); > > >+ devmode->dmSpecVersion = DM_SPECVERSION; > >+ devmode->dmDriverVersion = DM_SPECVERSION; > Wouldn't it be better to write > *devmode->dmDeviceName=*dev_name > instead of > > > memcpy(devmode->dmDeviceName, dev_name, sizeof(dev_name)); >
You can't copy whole arrays using one dereference operator. The reason for this is that the dereference operator only returns the contents of the first element in the array. -- Rob Shearman