tags:

views:

3241

answers:

3

I have developed a Ribbon application on Vista using VS 2008. It works fine on Vista. I statically link MFC so that I can run it on XP too.

But when I run it on XP, it puts up a dialog box saying "A required resource was unavailble". Later if I press OK on this dialog, it puts up another one saying "Encountered an improper argument". Many such("Encountered an....") dialogs follow(one after another) until I terminate it from the task manager.

Interesting thing I noticed is that this scenario occurs when I just place the mouse pointer over the Ribbon bar. I do nothing else. Then I open the Task manager and see that the memory used is increasing by 8 bytes with every second. Eventually followed by the above scenario.

?????

A: 

What does the stack trace reveal?

Ash
I tried installing MFC feature pack on XP system, but it failed thrice. So I could not debug.
Ron
A: 

It may well be that the ribbon is part of the Win32 common controls in Vista (hence not available under XP). In other words, though you have statically linked MFC, it may not be MFC that holds the resource you're looking for.

Making community wiki, since I really have no idea if this is right :-).

paxdiablo
I install "MFC feature pack" to get the Ribbon UI features. I think that does mean Ribbon comes in MFC dll. ..?
Ron
Fair enough but if, as you say in the comment to @Ash, it didn't install (thrice!), how do you expect your code to run without it? You should first ask the question: why won't MFC FP install on XP?
paxdiablo
A: 

There was a resource leak in my code that was causing this problem.

I had called GetDC() while updating the ribbon bar controls(ON_UPDATE_COMMAND_UI), but had not released it. Releasing it using ReleaseDC(..) fixed the issue.

Thanks for all replies.

Ron