Error choosepixelformat failed

Getting Error "ChoosePixelFormat failed" - solution of problems, Open CASCADE Technology.

Hi Mikael,

Thanks for your advice, i found that i was not passing the actual object of HDC ( Handle of Device Context, but was passing the CDC object, so it was giving me error at that time…) But it has been resolved but at the same time i m also getting the error with SetPixelFormat function just next call of that function. Because SetPixelFormat function allows only one time Pixel Formatting, it’s returning error#1 ( which is Invalid Functino call in Windows). Still i m facing the problem in it.. If you can help me out, it will be gr8..

This is the some code from my application:

void MyAppView::OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo)
{
pInfo->SetMaxPage(1);
Invalidate(TRUE);

// Intially, I was using this code to get the picture of the View in a bitmap and
// print that bitmap in my code. But as it is taking snap of the view, I m not
// gettting the perfect result. But on some computer it’s taking Snap of view,
// while on some, it’s taking snap of whole Frame including ToolBar and MenuBar..
// So i decided to use print function of the OpenCascade
/*
Handle(Aspect_Window) anAspectWindow = myView->Window();
Handle(WNT_Window) aWNTWindow = Handle(WNT_Window)::DownCast(anAspectWindow);
HWND hWindow = (HWND)aWNTWindow->HWindow();
CBitmap mybitmap;

RECT r;
::GetClientRect(hWindow,&r);

int WindowWidth=r.right;
int WindowHeight=r.bottom;
HDC hDCWindow=::GetDC(hWindow);
CDC* dcWindow = CDC::FromHandle( hDCWindow);
m_CDC.CreateCompatibleDC( dcWindow);
mybitmap.CreateCompatibleBitmap(dcWindow,WindowWidth,WindowHeight);
m_CDC.SelectObject(&mybitmap);
dcWindow->SelectObject(CBitmap::FromHandle((HBITMAP)aWNTWindow->HPixmap()));
m_CDC.BitBlt( r.left, r.top,WindowWidth,WindowHeight,dcWindow,0,0,SRCCOPY);
::ReleaseDC(hWindow,hDCWindow);
*/

// m_CDC is a memeber variable of MyAppView — object of CDC
CRect r;
GetClientRect( &r);

m_CDC.CreateCompatibleDC( pDC);
CBitmap l_bitmap;

l_bitmap.CreateCompatibleBitmap( pDC, r.Width(), r.Height());
m_CDC.SelectObject( &l_bitmap);

// myView is object of V3d_View
myView->View()->Print( m_CDC.m_hDC, true, NULL);
}

void MyAppView::OnEndPrinting(CDC* pDC, CPrintInfo* pInfo)
{
m_CDC.DeleteDC();
}

void MyAppView::OnPrint(CDC* pDC, CPrintInfo* pInfo)
{
ASSERT(pDC) ;
ASSERT(pInfo) ;
CRect l_Rect;
GetWindowRect( &l_Rect);

CRect& l_DrawRect = pInfo->m_rectDraw;
double l_Wratio = l_Rect.Width() / ( double) l_DrawRect.Width();
double l_Hratio = l_Rect.Height() / ( double) l_DrawRect.Height();

if( l_Wratio > l_Hratio )
pDC->StretchBlt(0, 0, l_DrawRect.Width(), (int)(l_Rect.Height() / l_Wratio), &m_CDC, 0, 0, l_Rect.Width(), l_Rect.Height(), SRCCOPY);
else
pDC->StretchBlt(0, 0, (int)( l_Rect.Width() / l_Hratio), l_DrawRect.Height(), &m_CDC, 0, 0, l_Rect.Width(), l_Rect.Height(), SRCCOPY);
}

Help me if you can..
Thank you for your reply…

Ashesh

BAK

Posts: 1
Joined: Mon Mar 13, 2017 4:18 am
Model of CNC Machine: Axiom AR8 PRO

ChoosePixelFormat failed

I googled error message and found a fix worth a try in the vectric forum by accident. The user didn’t name his help forum correctly. I will post and name it with the error so that other users can find the thread when they type in the error. It really made since especially with it happening on all of my computers running VCarve Pro. I’m sure others may have this same problem with windows 10. I have attached the screen shots below.


User avatar

Adrian

Vectric Archimage
Posts: 13587
Joined: Thu Nov 23, 2006 2:19 pm
Model of CNC Machine: ShopBot PRS Alpha 96×48
Location: Surrey, UK

Re: ChoosePixelFormat failed

Post

by Adrian » Thu Jun 01, 2017 8:26 pm

How old are the computers? I would only expect to see that error with outdated graphic drivers. It’s not a Windows 10 error as it’s been reported right back to Windows Vista.


Проблема с wine (ChoosePixelFormat failed :(()

Модератор: Модераторы разделов

Dreamslayer

Сообщения: 13

Проблема с wine

Пытаюсь под wine запустить Another World — штука не особо известная, конечно :) Дык вылетает с сообщением «ChoosePixelFormat failed». Сам wine в консоль пишет:

err:opengl:X11DRV_ChoosePixelFormat glXChooseFBConfig returns NULL (glError: 0)
err:opengl:X11DRV_ChoosePixelFormat glXChooseFBConfig returns NULL (glError: 0)
Покопался немного в сети (насколько позволяет стоимость трафика :)), но ничего путного не нашёл. Поколдовал с настройками — тоже безрезультатно. Не подскажете, что можно сделать?..
(Linux Fedora Core 4, wine 20050524)

The only thing to fear
Is running out of beer!

Аватара пользователя

AlexeyAL

Сообщения: 71

Re: Проблема с wine

Сообщение

AlexeyAL » 14.11.2005 19:10

Копаться следует не в настройкой wine, а с настройкой openGL. ChoosePixelFormat-одна из базовых функций, одна из первых в любой проге

Когда я вырасту и стану крутым программистом, я напишу свое ядро и подарю его Ричарду Столлмену

Dreamslayer

Сообщения: 13

Re: Проблема с wine

Сообщение

Dreamslayer » 14.11.2005 20:34

AlexeyAL писал(а): ↑

14.11.2005 19:10

Копаться следует не в настройкой wine, а с настройкой openGL. ChoosePixelFormat-одна из базовых функций, одна из первых в любой проге

Спасибо, но это в целом понятно. Неясно — почему гадский ChoosePixelFormat упорно 0 возвращает?.. Не подскажете, в какую сторону копать?.. Я недавно из-под форточек вылез, поэтому не очень хорошо в настройках ориентируюсь :(

The only thing to fear
Is running out of beer!

YagMort

Сообщения: 323

Re: Проблема с wine

Сообщение

YagMort » 16.11.2005 09:32

Кривая сборка Wine. У меня такое было с официальным релизом в SuSE 9.3. Поставил самосборный с сурсфорджа — все нормально заработало. Именно это сообщение — причем — во всех играх.
Ищи другую версию — желательно, сурсфорджевской сборки, а не сборки твоего дистроклепателя.

Athlon64-3000+/nForce4/1Gb/GF 6600-256Mb/HDD200Gb, 80Gb/SB Live! 5.1.
SuSE Linux 10.0_i586 DVD/Windows XP 64-bit SP1 eng.

Dreamslayer

Сообщения: 13

Re: Проблема с wine

Сообщение

Dreamslayer » 17.11.2005 16:23

Простите меня пожалуйста, я — дурак :( Случайно влез в xorg.conf, а там по дефолту 16-битный режим стоял. Исправил на 24 бита — всё работает :)

The only thing to fear
Is running out of beer!

  • Home
  • Forum
  • The Ubuntu Forum Community
  • Ubuntu Specialised Support
  • Wine
  • OpenGL: ChoosePixelFormat failed

  1. OpenGL: ChoosePixelFormat failed

    I’m trying to run Sketchup7 under WINE 1.1.34 and Ubuntu Karmic. I’m getting a diagnostic on startup which says;

    Sketchup was unable to initialize OpenGL!
    Please make sure you have installed the correct drivers for your graphics card.

    Error: ChoosePixelFormat failed.

    What does this error mean?
    How do I fix it?
    Where does OpenGL come from?
    Is there a specific version I’m supposed to use?
    Do I need Python to make OpenGL work?


  2. Re: OpenGL: ChoosePixelFormat failed

    This post is a little old but I decided to add some input to it since it might help some else trying to run Sketchup7 on Karmic Koala 9.10.

    It is always better to download the last version of wine from their site since the Ubuntu repository is a little outdated.

    The version wine version that is working for me is 1.1.43.

    The fix is real simple:

    Fix:
    Open your wine menu and open the C drive (/home/user/.Wine)
    Open the Windows Folder
    Find Regedit.exe and run it with Wine
    Find: HKEY_CURRENT_USERSoftwareGoogleSketchUp6GLConf igDisplay
    There are three entries — Look at the bottom one, name ‘HW_OK»
    Double click it and change the data from a 0 to a 1
    Run Sketchup7

    that should do it. I read some postings mentioning problems with black screens, which are related to compiz; in that case just disable compiz.

    I hope this can help someone. I’ve been trying get Sketchup running for the longest time, I finally got it working with this little trick.

    good luck


  3. Re: OpenGL: ChoosePixelFormat failed

    I have Wine version 1.2 rc6 with karmic 9.10 and your regedit solution worked great. I too got the OpenGL error along with the «choosePixelFormat» until I put in your fix. THANKS!
    (though also have a print problem — the picture is totally black when printed but on the screen it looks great — another problem to investigate…)


  4. Talking Re: OpenGL: ChoosePixelFormat failed

    Woohoo

    thanks so much noriegafam, working perfectly

    I love Sketchup, another reason I don’t have to turn my windows box back on.

    I tried this with Ubuntu 10.04 with Google Sketchup 7.1.

    also wine from the Ubuntu Software center version 1.1.42

    Last edited by gazm81; July 19th, 2010 at 12:42 AM.

    Reason: Left out information


  5. Re: OpenGL: ChoosePixelFormat failed

    Your fix worked for me — brilliant. Now all I have to do is work out how to use Sketchup


  6. Re: OpenGL: ChoosePixelFormat failed

    Thanks noriegafam! I’ve been trying everything to try get this working


  7. Re: OpenGL: ChoosePixelFormat failed

    I wish it worked for me

    I’m using a Dell 1545 running 10.04, wine 1.1.42.

    it still crashes with the same message

    maybe some day I get my dual boot working so I can run 9.04 or 9.10 and try it under that.

    -DaveKenny


  8. Re: OpenGL: ChoosePixelFormat failed

    Thanks noriegafam, that solved my problem running Sketchup8 in Meerkat.
    John

    It’s like doing jigsaw puzzles in the dark.


  9. Re: OpenGL: ChoosePixelFormat failed

    Excellent Fix.
    Worked with my current config of Ubuntu 10.10 running SketchUp version 7.1.6860 in Wine 1.2.1


  10. Re: OpenGL: ChoosePixelFormat failed

    Hi All,

    I’ve tried this fix but when i open the regedit.exe and work thru the menu I get only as far as ;
    HKEY_CURRENT_USERSoftwareGoogleSketchUp7

    GLConf igDisplay are missing.

    Can anyone suggest why? Is it something to do with the graphics card?

    Thanks


Tags for this Thread

Bookmarks

Bookmarks


Posting Permissions

View previous topic :: View next topic  
Author Message
01mf02
Veteran
Veteran

Joined: 21 Nov 2004
Posts: 1070
Location: Innsbruck, Austria

PostPosted: Mon Nov 28, 2005 11:42 am    Post subject: Counterstrike/Wine: ChoosePixelFormat failed / no D3D Reply with quote

I have tried running Counterstrike with Wine 0.9.2, but I cannot start a game.

When I choose:

— OpenGL graphics mode, there is a message «ChoosePixelFormat failed» and then a message saying that OpenGL is not supported by my graphics card

— Direct3D it also says it wasn’t supported by my card

— Software emulation, the screen simply becomes black when starting the Tutorial, but I can go back to the main menu with ESC

I have an AMD64 system with an nVIDIA GeForce 6600, and all Linux 3D apps work nicely. Maybe the Direct Rendering is messed up with Wine — do you have any idea how to check if you have accelerated 3D in Wine?

Do you know how to solve this problem?

Back to top

View user's profile Send private message

xaos5
Apprentice
Apprentice

Joined: 19 Apr 2005
Posts: 255
Location: Michigan

PostPosted: Mon Nov 28, 2005 9:39 pm    Post subject: Reply with quote

does glxgears work and have you installed nvidia-kernel and nvidia-glx packages?
Back to top

View user's profile Send private message

01mf02
Veteran
Veteran

Joined: 21 Nov 2004
Posts: 1070
Location: Innsbruck, Austria

PostPosted: Tue Nov 29, 2005 1:56 pm    Post subject: Reply with quote

Glxgears gives the following output:

michi@tux ~ $ glxgears

26043 frames in 5.0 seconds = 5208.600 FPS

31054 frames in 5.0 seconds = 6210.800 FPS

Nvidia-kernel and nvidia-glx are installed too:

michi@tux ~ $ emerge nvidia-glx nvidia-kernel -pv

These are the packages that I would merge, in order:

Calculating dependencies …done!

[ebuild R ] media-video/nvidia-glx-1.0.7676-r2 -dlloader 0 kB

[ebuild R ] media-video/nvidia-kernel-1.0.7676-r1 0 kB

As I said, all other Linux 3D apps are running. If you can suggest me a good tool to check if 3D acceleration works in Wine, then I could see if it’s a specific issue with Counterstrike or with Wine in general.

Back to top

View user's profile Send private message

01mf02
Veteran
Veteran

Joined: 21 Nov 2004
Posts: 1070
Location: Innsbruck, Austria

PostPosted: Wed Nov 30, 2005 3:18 pm    Post subject: Reply with quote

Bumpy.
Back to top

View user's profile Send private message

01mf02
Veteran
Veteran

Joined: 21 Nov 2004
Posts: 1070
Location: Innsbruck, Austria

PostPosted: Thu Dec 01, 2005 3:38 pm    Post subject: Reply with quote

I can bump long, you know …
Back to top

View user's profile Send private message

xaos5
Apprentice
Apprentice

Joined: 19 Apr 2005
Posts: 255
Location: Michigan

PostPosted: Fri Dec 02, 2005 4:25 am    Post subject: Reply with quote

Well I’m not sure if there is one for wine, I know cedega checks it with glxgears, and if that doesn’t load it fails. It could be something you did with your config file or something isn’t installed right with wine. only other thing you could try is a different version of wine also, look around and see which is the best version, some versions work better then others.
Back to top

View user's profile Send private message

killertux
Tux’s lil’ helper
Tux's lil' helper

Joined: 11 Dec 2003
Posts: 119

PostPosted: Fri Dec 02, 2005 4:29 pm    Post subject: Reply with quote

«ChoosePixelFormat failed» is know bug number 3277 and it’s over half-year old.
Back to top

View user's profile Send private message

01mf02
Veteran
Veteran

Joined: 21 Nov 2004
Posts: 1070
Location: Innsbruck, Austria

PostPosted: Fri Dec 02, 2005 9:19 pm    Post subject: Reply with quote

But I’ve heard of people playing Counterstrike with Wine … or maybe it was Cedega?

Anyway, my 3D performance in other Windows games is well, so it will be this bug! :?

Back to top

View user's profile Send private message

killertux
Tux’s lil’ helper
Tux's lil' helper

Joined: 11 Dec 2003
Posts: 119

PostPosted: Fri Dec 02, 2005 10:13 pm    Post subject: Reply with quote

Indeed Counter-Strike 1.5 works in Wine 20050310 but after that happens regression that caused «ChoosePixelFormat failed» error in all Wine newer than 20050310. This regression also affect Counter-Strike 1.6 and because that version need Steam and it do not work in old Wine you need to use Wine 20050310 and Counter-Strike 1.5. But this bug only affect some systems not all. What I can tell that no fix is available and it might be someting to do with glx versions greater than 1.2. I know this is not rare bug because many people including myself had this bug happening in Wine.
Back to top

View user's profile Send private message

xaos5
Apprentice
Apprentice

Joined: 19 Apr 2005
Posts: 255
Location: Michigan

PostPosted: Sat Dec 03, 2005 3:07 pm    Post subject: Reply with quote

cedega works almost perfect with steam, just to let you know.
Back to top

View user's profile Send private message

killertux
Tux’s lil’ helper
Tux's lil' helper

Joined: 11 Dec 2003
Posts: 119

PostPosted: Sun Dec 04, 2005 2:34 am    Post subject: Reply with quote

Seems like this bug 3277 is partly fixed because «ChoosePixelFormat failed» do not happen anymore if I run X in 24bit colors when running latest Wine CVS but still in 16 bit colors this bug happen.
Back to top

View user's profile Send private message

Display posts from previous:   

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Понравилась статья? Поделить с друзьями:

Читайте также:

  • Error checking type of the expression
  • Error checking tls connection host is not running
  • Error checking tls connection docker
  • Error checking storage configuration
  • Error checking mode

  • 0 0 голоса
    Рейтинг статьи
    Подписаться
    Уведомить о
    guest

    0 комментариев
    Старые
    Новые Популярные
    Межтекстовые Отзывы
    Посмотреть все комментарии