# Cg shader problem when switching to fullscreen

This topic is 3229 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi, bit of a wierd one but my vert + frag shaders all work in windowed/fullscreen mode. Switching causes no problems. However, when ever I use the Win32 Common Dialogs (e.g. ChooseColour, GetOpenFileName etc) I get problems switching to fullscreen. Normal dialogs are fine (ones I've made in resource scripts and loaded programmatically). Using CG, OGL & Win32 compiled in VC++ Express on Vista machine. So, I can switch between windowed and fullscreen, no problem. However, it's as soon as one of the common dlgs get opened at any point in the app and I then try and switch to fullscreen I get this error:
CG ERROR: the file could not be read


The error occurs when trying to load the vert program. Running vert + frag programs on CG_PROFILE_ARBVP1 and CG_PROFILE_ARBFP1 profiles respectively. Any ideas? I'm really stumped myself

##### Share on other sites
This is a wild guess but I wonder if the current working directory is changed somehow when those dialogs open... I'm curious if you have the same problem if you give the full path to the cg file.

##### Share on other sites
Oh... my... GOD...

Thank you so much, Brad. You, sir, are one outside the box thinker! Not only did it solve the problem, but explained why I was getting such non sequitur errors in my code :D

Now all I gota do is find some way of preserving the working directory post CommonDlg, but at least the hardest part is out the way. Again, thank you, you pretty mich saved my skin there :D :D :D