Sign in to follow this  
Guest _ak

extra data provided to a gauge callback

Recommended Posts

This question is for C/C++ gauge developer.When the gauge callback is called with service_id PANEL_SERVICE_PRE_INSTALL or PANEL_SERVICE_POST_INSTALL, the value of the parameter "extra_data" is the resource_handle.Can someone tell me what this is? Is it the instance handle of the gauge file, which is a DLL? Is it another handle?Thanks for any info.Eric

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

I'm not 100% sure if it is the resource handle or a handle to a module a resource can be loaded of (maybe the same). However some sound modules for gauges (e.g. rfgutils.lib) can load a wav file embedded in the gauge itself (load it from the resource part of the gauge). Using ((HINSTANCE)extra_data) as the resource handle does the trick. Maybe even image loading is possible, e.g. with Gdi+ and Bitmap::FromResource((HINSTANCE)extra_data,bitmapName);Quite some time ago when I checked, but I think ((HINSTANCE)extra_data) is different to GetModuleHandle(NULL) (to get a handle to the .gau file).Arne Bartels

Share this post


Link to post
Share on other sites

GetModuleHandle(NULL) returns not handle of your gau file but handle of main executable. In FS9 it will return handle of fs9.exeGetModuleHandle("mygauge.gau") returns handle of given gauge file name.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this