Skip to content
View in the app

A better way to browse. Learn more.

The AVSIM Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Retrieving gauge handle

Featured Replies

Hi,I'm trying to load a resource BITMAP (defined in the .rc file) from my gauge by using a handle to the gauge itself, but have been unsucessful in retrieving the handle. I've tried several variations of the following, all unsuccessful:h_gauge = GetModuleHandle(NULL);h_gauge = GetModuleHandle("MYGAUGE.gau");h_gauge = GetModuleHandle("MYGAUGE.gau.");h_gauge = GetModuleHandle("GaugesMYGAUGE.gau.");If I can get the module handle then I'd use it with the Bitmap constructor, Bitmap::Bitmap(HINSTANCE,WCHAR*), like this:Bitmap my_image(h_gauge, L"BMP_PITCH_MARKS");Does anyone know how to retrieve the module handle for the gauge?Thanks,- Jeff

Do you need the module handle or the resource handle (is there a difference?). The resource handle is extra_data while PANEL_SERVICE_PRE_INSTALL.e.g.HINSTANCE res_handle=NULL;..case PANEL_SERVICE_PRE_INSTALL: res_handle=(HINSTANCE)extra_data); break;...I use this handle for loading resources e.g. with "LoadString".For the module handle throw out the DLLMain definition in the GAUGE_TABLE_BEGIN macro and define your own:BOOL WINAPI DllMain (HINSTANCE hDLL, DWORD dwReason, LPVOID lpReserved) { ....//something with hDLL } I have never tried if these handles are the same or lead to the same results though.Arne Bartels

P.S.both methods do give the same. For gauges you should use "res_handle=(HINSTANCE)extra_data;", you can use DllMain, but it's a bit more work, for FS DLL modules the only way, though.Arne Bartels

Arne,I tried both methods you outlined and came up with the same result...I was able to get the module handle I needed. Works great! Thank you so much.By the way, I've learned a lot by reading your responses to other people's questions on this forum. Much appreciated and keep up the good work.- Jeff

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.