Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

AssociateColorProfileWithDevice fails

52 views
Skip to first unread message

Kris Carron

unread,
Feb 3, 2004, 12:16:12 PM2/3/04
to
Hi,

I'm trying to setup a new ICC monitor profile. According to the API docs I should first install the profile calling InstallColorProfile and afterwards associate the installed profile with the monitor using AssociateColorProfileWithDevice. The InstallColorProfile returns successfully and seems to have done it's job. After installation of the profile the profile appears in the registry under \HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ICM\mntr as it should.

The call to AssociateColorProfileWithDevice however fails. It returns FALSE. The weird think is that GetLastError returns 0, indicating that everything went well. The profile was not associated with the monitor. It doesn't appear in the Display Properties | Advanced | Color Management tab. Associating the same profile using the Display Properties Control Panel applet works just fine.

The call to AssociateColorProfileWithDevice has only three parameters. I passed NULL for the first one, indicating the local machine. The second one is the fully qualified path of my profile. I'm ruling out these two as the cause of the failure; the first parameter is trivial and when passing an invalid path for the second parameter, GetLastError actually returns an error code indicating that it is invalid. So that leaves the third parameter which is a string specifying the device name. The API docs don't specify what that actually is in case of a monitor. I've used names like \\.\DISPLAY1, \\.\DISPLAY1\U0 , \\.DISPLAY1\Unit0 and several others probably not worth mentioning. All used names resulted in a failure with GetLastError equal to 0. I did pay attention to escaping the backslashes correctly, so that's not it - I think.

Does anyone have any ideas as to what is going wrong here? Am I using the correct sequence of calls? Is something else missing?

Just to be complete; I'm using Windows 2000 Professional with all latest updates and Visual Studio 6.0 (yeah, I know ;-) for building my C/C++ application.

Thanks for your help.

Louis Solomon [SteelBytes]

unread,
Feb 3, 2004, 8:46:32 PM2/3/04
to
maybe use EnumDisplayDevices to get the device name for the display.


--
Louis Solomon
www.steelbytes.com

"Kris Carron" <kris....@barco.com> wrote in message
news:D8945957-6E50-43A5...@microsoft.com...

gaj

unread,
May 9, 2013, 4:31:22 PM5/9/13
to
Kris Carron wrote on 02/03/2004 12:16 ET :
> Hi
>
> I'm trying to setup a new ICC monitor profile. According to the API docs I
> should first install the profile calling InstallColorProfile and afterwards
> associate the installed profile with the monitor using
> AssociateColorProfileWithDevice. The InstallColorProfile returns successfully
> and seems to have done it's job. After installation of the profile the
profile
> appears in the registry under HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindows
> NTCurrentVersionICMmntr as it should
>
> The call to AssociateColorProfileWithDevice however fails. It returns FALSE.
> The weird think is that GetLastError returns 0, indicating that everything
went
> well. The profile was not associated with the monitor. It doesn't appear in
> the Display Properties | Advanced | Color Management tab. Associating the
same
> profile using the Display Properties Control Panel applet works just fine
>
> The call to AssociateColorProfileWithDevice has only three parameters. I
> passed NULL for the first one, indicating the local machine. The second one
is
> the fully qualified path of my profile. I'm ruling out these two as the cause
> of the failure; the first parameter is trivial and when passing an invalid
path
> for the second parameter, GetLastError actually returns an error code
> indicating that it is invalid. So that leaves the third parameter which is a
> string specifying the device name. The API docs don't specify what that
> actually is in case of a monitor. I've used names like .DISPLAY1,
> .DISPLAY1U0 , .DISPLAY1Unit0 and several others probably not worth
> mentioning. All used names resulted in a failure with GetLastError equal to
0.
> I did pay attention to escaping the backslashes correctly, so that's not it -
> I think
>
> Does anyone have any ideas as to what is going wrong here? Am I using the
> correct sequence of calls? Is something else missing
>
> Just to be complete; I'm using Windows 2000 Professional with all latest
> updates and Visual Studio 6.0 (yeah, I know ;-) for building my C/C++
> application
>
> Thanks for your help
>
did you get any solution to your problem i am getting same problem, install is
working fine but my profile is not getting associated with //./Display1
0 new messages