Post Reply

Forums -> Multiple monitors -> Problem when using Independent Displayers
loveless   2008-07-23 20:07
Hi,
I use two PCI Graphics cards, NVIDIA Quadro FX3700 and NVIDIA Quadro NVS 290, the first one is configured as the primary displayer. I try to use the them as independent displayers and using the sample codes:
DEVMODE dm; ZeroMemory(&dm, sizeof(dm)); dm.dmSize = sizeof(dm); EnumDisplaySettingsEx(_T("\\\\.\\DISPLAY2"), ENUM_REGISTRY_SETTINGS, &dm, 0); HDC dc = CreateDC(_T("\\\\.\\DISPLAY2"), 0, 0, &dm); HBRUSH oldBrush = static_cast<HBRUSH>(SelectObject(dc, GetStockObject(WHITE_BRUSH))); Rectangle(dc, 0, 0, dm.dmPelsWidth, dm.dmPelsHeight); MoveToEx(dc, 0, 0, 0); LineTo(dc, dm.dmPelsWidth, dm.dmPelsHeight); SelectObject(dc, oldBrush); DeleteDC(dc);
When debug the codes, CreateDC successed and all the GDI functions success, but there is nothing shown on the second display; only if I chose "extend windows destop" to the second monitor, the GDI drawing are shown. Anyone have ideas of this problem? Thanks a lot!


BR
loveless

loveless
loveless   2008-07-23 20:41
OK, I have to correct my descroption a little bit! The CreatDC sucess maybe is not the truth, when I reboot and run the sample again, the createDC failed and return the error code 1801:ERROR_INVALID_PRINTER_NAME; but if I select "Extend windowds desktop" to the second monitors and run the program, of course, all the things success; then I disable the "extend windows desktop" option and use it as independent displayers, this time, CreateDC successa and so do the other GDI function, but nothing shown on the monitors. So I think the latter CreateDC success maybe a fake.

loveless
Forums -> Multiple monitors -> Problem when using Independent Displayers

Post Reply