OHM WebMFD

AssemblyLanguage

Donator
Donator
Joined
Jun 10, 2012
Messages
112
Reaction score
1
Points
0
What versions work?

Could those who have made WebMFD work please post your browser versions?

I've tried:
Chrome 19.0.1084.56 m
Firefox 13.0
Android 2.3 stock
Firefox Android Beta
Dolphin
Internet Explorer 10

I get the same results as reported here earlier. On Chrome, Firefox and Firefox Android Beta, I get a working Orbit MFD but no button labels and buttons that don't work. I'm using the WebMFD.dll and the Default HTML/Script from Orbit Hanger.

I've also tried the HTML/Script from github that uses the Ajax interface with the same results. I've looked at the source code and also tried my own simple HTML page.

What versions work?
 

AssemblyLanguage

Donator
Donator
Joined
Jun 10, 2012
Messages
112
Reaction score
1
Points
0
Hi,

Now I have a problem with atlimage.h but as far as I have found, it seems to be a problem with me using VS 2010 Express instead of a standard or pro. edition. I will download the trial of Pro. and try to compile it.

I did compile it without errors but Orbiter crashes when I start a browser with the WebMFD IP and Port.

Can you send me a DLL file that you have compiled successfully? I might have done something wrong throughout the process...

I also tried to compile WebMFD and I have the same problem with a missing atlimage.h.

Is there a solution without downloading a trial of VS 2010 Pro?

Has anyone had success with a recent compile? Could you supply a working .dll?

Thanks

---------- Post added 06-17-12 at 12:17 AM ---------- Previous post was 06-16-12 at 03:34 AM ----------

I am attempting to eliminate the dependence on include atlimage.h.

I think the only use is LoadImage to initialize a bitmap (I hope).

Here is the original code:

Code:
// Create the surface
	_surface = oapiCreateSurface(255, 255);

	// Load a compatible bitmap in order to get a compatible HBITMAP (...no comment...)
	_bmpFromSurface = (HBITMAP)LoadImage(NULL, _T("WebMFD\\_testimage.bmp"), IMAGE_BITMAP, 0,0, LR_LOADFROMFILE);

I attempted to initialize a bitmap using CreatCompatibleBitmap with this code:
Code:
// Create the surface
	_surface = oapiCreateSurface(255, 255);

	// Load a compatible bitmap in order to get a compatible HBITMAP (...no comment...)
	/// _bmpFromSurface = (HBITMAP)LoadImage(NULL, _T("WebMFD\\_testimage.bmp"), IMAGE_BITMAP, 0,0, LR_LOADFROMFILE);
	// Get the Device Context from the Surface
	HDC hDCsrc = oapiGetDC(_surface);
	_bmpFromSurface = (HBITMAP)CreateCompatibleBitmap ( hDCsrc, 255, 255 );

After a couple of substitutions of windows.h for afxres.h, it compiled OK.

However, as with others who have compiled this, where I had a working orbit MFD, I get a blank MFD and waiting for a response.

Does anyone have a working WebMFD.dll?
 

csanders

Addon Developer
Addon Developer
Joined
Jan 18, 2012
Messages
219
Reaction score
1
Points
0
Location
Plymouth
I downloaded his WebMFD Visual studios project, and got it to compile (I have VS2010 professional), but I haven't tested it out yet in Orbiter. I'll work on it tomorrow and let you know if I find anything out.

---------- Post added at 04:01 PM ---------- Previous post was at 05:58 AM ----------

I attempted to initialize a bitmap using CreatCompatibleBitmap with this code:
Code:
// Create the surface
	_surface = oapiCreateSurface(255, 255);

	// Load a compatible bitmap in order to get a compatible HBITMAP (...no comment...)
	/// _bmpFromSurface = (HBITMAP)LoadImage(NULL, _T("WebMFD\\_testimage.bmp"), IMAGE_BITMAP, 0,0, LR_LOADFROMFILE);
	// Get the Device Context from the Surface
	HDC hDCsrc = oapiGetDC(_surface);
	_bmpFromSurface = (HBITMAP)CreateCompatibleBitmap ( hDCsrc, 255, 255 );

Try this instead:

Code:
    // Load a compatible bitmap in order to get a compatible HBITMAP (...no comment...)
    _bmpFromSurface = CreateCompatibleBitmap(GetDC(0), 255, 255);
    //_bmpFromSurface = (HBITMAP)LoadImage(NULL, _T("WebMFD\\_testimage.bmp"), IMAGE_BITMAP, 0,0, LR_LOADFROMFILE);

NOTE on code: While this is a better way of getting an HBITMAP, than loading a ".bmp" file from disk, it might run into problems if orbiter is running in 16bits/color mode (or the every rare 24bits/color graphics mode. Do any video cards support that anymore?).

Note 2: The "WebMFD\\_testimage.bmp" file doesn't exist in the correct directory for this VC solution - which is why everyone was having problems.
 
Last edited:

AssemblyLanguage

Donator
Donator
Joined
Jun 10, 2012
Messages
112
Reaction score
1
Points
0
NOTE on code: While this is a better way of getting an HBITMAP, than loading a ".bmp" file from disk, it might run into problems if orbiter is running in 16bits/color mode (or the every rare 24bits/color graphics mode. Do any video cards support that anymore?).

Note 2: The "WebMFD\\_testimage.bmp" file doesn't exist in the correct directory for this VC solution - which is why everyone was having problems.

Thanks for your notes and attempting to make this work. I'm still learning about HBITMAP in the hope that I can avoid using VS Pro and loading from disk.

Does your comment about _testimage.bmp in the wrong directory mean it should be in a null directory under the WebMFD directory?
 

csanders

Addon Developer
Addon Developer
Joined
Jan 18, 2012
Messages
219
Reaction score
1
Points
0
Location
Plymouth
Thanks for your notes and attempting to make this work. I'm still learning about HBITMAP in the hope that I can avoid using VS Pro and loading from disk.

Does your comment about _testimage.bmp in the wrong directory mean it should be in a null directory under the WebMFD directory?

The "_testimage.bmp" file should be in the "[Orbiter root]\WebMFD\" directory.

FYI this line does produce a working version on my build:
_bmpFromSurface = CreateCompatibleBitmap(GetDC(0), 255, 255);

If _bmpFromSurface != NULL after that line, it should be fine.
 
Last edited:

kamaz

Unicorn hunter
Addon Developer
Joined
Mar 31, 2012
Messages
2,298
Reaction score
4
Points
0
Is there a solution without downloading a trial of VS 2010 Pro?

Yes. You have to obtain ATL headers form another source.

1. Download Windows Driver Kit 7.1.0 from http://www.microsoft.com/en-us/download/details.aspx?displaylang=en&id=11800 and install it. By default it installs to C:\WinDDK\<version>.

2. Add C:\WinDDK\<version>\inc\atl71 as include path in your project and you're set.

Has anyone had success with a recent compile? Could you supply a working .dll?

I have suceeded in building WebMFD, but it still does not work. In addition to inoperable buttons, I get a corrupted MFD screen. Looks like a messed up pointer somewhere.
 

kamaz

Unicorn hunter
Addon Developer
Joined
Mar 31, 2012
Messages
2,298
Reaction score
4
Points
0
FYI this line does produce a working version on my build:
_bmpFromSurface = CreateCompatibleBitmap(GetDC(0), 255, 255);

Wow! Thanks, now it works. Firefox 13.0.1 in AJAX mode.

The latest (?) version from git with the above hack applied is attached below -- compiled DLL and source.
 

Attachments

  • webmfd.zip
    2.7 MB · Views: 88
  • webmfd.png
    webmfd.png
    427.2 KB · Views: 79
Last edited:

AssemblyLanguage

Donator
Donator
Joined
Jun 10, 2012
Messages
112
Reaction score
1
Points
0
FYI this line does produce a working version on my build:
_bmpFromSurface = CreateCompatibleBitmap(GetDC(0), 255, 255);

Thank you for this fix. I was able to compile a working .dll.

Maybe someday I'll attempt to make WebMFD work with Websockets version 13. Since it works with Ajax and there isn't much traffic for button requests, it may not be worth it.

Thanks again.
 

n122vu

Addon Developer
Addon Developer
Donator
Joined
Nov 1, 2007
Messages
3,196
Reaction score
52
Points
73
Location
KDCY
Thanks kamaz for the latest version link. Worked flawlessly using Firefox for Android 10.0.5 in Ajax mode running on my DROID X2, Android 2.7 (Cyanogen Mod 7).
 

AssemblyLanguage

Donator
Donator
Joined
Jun 10, 2012
Messages
112
Reaction score
1
Points
0
Firefox does mpng

I've been modifying the javascript included with WebMFD and have found that newer versions of Firefox can handle mpng. As the original author said, it looks better than mjpeg.

FWIW, Internet Explorer on Windows 8 doesn't (yet?) support either mpng or mjpeg.
 
Last edited:

csanders

Addon Developer
Addon Developer
Joined
Jan 18, 2012
Messages
219
Reaction score
1
Points
0
Location
Plymouth
Wow! Thanks, now it works. Firefox 13.0.1 in AJAX mode.

The latest (?) version from git with the above hack applied is attached below -- compiled DLL and source.

I took that and improved it some.

I found out how to fix the "BitBlt" problem the original developer ran into (discussion here: http://www.orbiter-forum.com/showthread.php?t=19054 ).

On my machine, I don't have any problems with WebMFD using the D3D9Client. But the regular inline graphics client gets hit hard. If I have 4 "surface" MFDs open in another browser, my FPS would drop from around 60-FPS to around 5-FPS. With the fix I made, it only drops to around 50-FPS with the same test.
 

Attachments

  • WebMFD with acceleration.zip
    1 MB · Views: 183

McGalcri

New member
Joined
Feb 6, 2011
Messages
18
Reaction score
0
Points
1
Well... after read all posts here, im still cant use this awesome thing...

I have only Orbit MFD showing the data, but no buttons, only "." dots. PWR works for close a MFD... and the "+" for add another works... but nothing more here.

I have NO IDEA about programming these things. Why nobody can upload a full new version fixed? Just code and more code... hehehe, that is chinesse for me! HELP!!!:blink:

OS: Windows XP 32bits SP3
Chrome: 49.0.2623.112 (Build oficial) m (32 bits)
 

RacerX

Donator
Donator
Joined
Jan 3, 2012
Messages
303
Reaction score
9
Points
18
Location
in a field
Well... after read all posts here, im still cant use this awesome thing...

I have only Orbit MFD showing the data, but no buttons, only "." dots. PWR works for close a MFD... and the "+" for add another works... but nothing more here.

I have NO IDEA about programming these things. Why nobody can upload a full new version fixed? Just code and more code... hehehe, that is chinesse for me! HELP!!!:blink:

OS: Windows XP 32bits SP3
Chrome: 49.0.2623.112 (Build oficial) m (32 bits)
What version of orbiter are you using? 2010 or 2016?
Either way I rebuilt it for use in orbiter2016 for my own personal use. Its unmodified just pointed it at the Orbiter2016 lib's and built it. Drop it into the root directory of your orbiter2016 directory and don't forget to enable the module in orbiter launch pad.
 

Attachments

  • WebMFD.zip
    474 KB · Views: 63

Similar threads

Top