Jump to content



Photo
- - - - -

"Object reference not set" from B2S


  • Please log in to reply
10 replies to this topic

#1 Scrooby

Scrooby

    Hobbyist

  • Silver Supporter
  • 30 posts
  • Location:Baltimore, MD

  • Flag: ---------

  • Favorite Pinball: Funhouse

Posted 16 September 2016 - 02:20 PM

Problem: When I am running a FS table using dB2S for my backglass, I get a pop-up from he B2S Backglass Server saying "Object reference not set to and instance of an object." and get no backglass on my backglass monitor.

 

I'm rebuilding my 3 screen table that was originally built in 2010 and an starting from scratch with a fresh Windows 7 install. I had been using UVP for my backglasses on my previous build and am switching to dB2S at the recommendation of some of the friendly people on this board. I installed VP using the "mega" installer which installs VP8, VP9, VPX, VPMame, and dB2S. Single screen tables (landscape and FS) work fine on the main monitor. So I started trying to get d2S working. I downloaded jpsalas' Eight Ball Deluxe full screen table for VP9 (Eight_Ball_Deluxe_VP91x_1.2FS) and put it into the 'tables' folder (where B2S is installed.) The ROM (eballdlx.zip) is in the VPMame/roms folder. The table runs fine on my main monitor at this point. I then downloaded the EBDeluxe dB2S file (Eight Ball Deluxe (Bally 1984).directB2S) and put it into the 'table' folder as well. Next,  I changed the VPMame line in the table script to "Set Controller = CreateObject("B2S.Server")" so the table calls dB2S instead of VPMame. My backglass monitor is monitor #2 according to Windows display properties.  I used the 'B2S_SetUp' application to set the the backglass monitor to #2 with the correct resolution. The ScreenRes file reflects these changes. When I run the table in VP9, I get the error that I detailed at the beginning of the post. I even tried rerunning the 'B2SBackglassServerRegisterApp' as administrator just in case there was a registration error on the initial install. This did not fix the problem.

 

Since I'm new to the world of dB2S, I'm at a loss. I dearch for an answer and there are no answers that I can find. Can anyone point me in the right direction?

 

Brian

 

PS How does the VP table know which directb2s file to use for a table? I'm thinking that this might be the problem, but I do not see a place to define what directb2s file to use when running a particular table.


Edited by Scrooby, 16 September 2016 - 02:47 PM.


#2 sliderpoint

sliderpoint

    Pinball Fan

  • Members
  • PipPipPipPip
  • 760 posts
  • Location:Spokane, WA

  • Flag: United States of America

  • Favorite Pinball: Metallica

Posted 16 September 2016 - 03:17 PM

Try renaming the directb2s file to have the same name as the table file (just different extensions)

-Mike

#3 Scrooby

Scrooby

    Hobbyist

  • Silver Supporter
  • 30 posts
  • Location:Baltimore, MD

  • Flag: ---------

  • Favorite Pinball: Funhouse

Posted 16 September 2016 - 03:21 PM

Got it! Here's the fix for the people that might run into the same problem. The file names of the table and dB2S must match. i.e. If your Taxi table file is names taxi_full_screen.vpt, your dB2S name must be named taxi_full_screen.directB2S. It's that simple.

 

Brian


Thanks for the reply, slider. You posted your reply as I was posting mine.



#4 doogie2301

doogie2301

    Enthusiast

  • Members
  • PipPipPip
  • 97 posts

  • Flag: United States of America

  • Favorite Pinball: Funhouse

Posted 16 September 2016 - 06:46 PM

PS How does the VP table know which directb2s file to use for a table?

 

I can probably answer this question, since I have been studying the B2SBackglassServer code and monitoring its activity while attempting to figure out a related issue.  So the logic to locate a directb2s file goes through a series of checks until it finds it, something like this:

 

1) Look for file named with same name as table file (which is determined by looking for the process name that starts with 'Visual Pinball - ' and pulls it from the text in square brackets)

2) Look for file named with description from hyperpin/pinballX configuration (if it can locate the config file and find an entry matching the table file name)

3) Look for .directb2s files that match the first 6 characters of the table file name, or if none found remove any spaces and search again.  For any files found, use either the one that matches the value of the <MatchingFileName> node in the B2STableSettings.xml file, or just use the last one in the list.


Edited by doogie2301, 16 September 2016 - 06:54 PM.


#5 arngrim

arngrim

    DJ Force Feedback

  • VIP
  • 2,188 posts
  • Location:Charleroi, Belgium

  • Flag: Belgium

  • Favorite Pinball: Monster bash



Posted 16 September 2016 - 08:31 PM

you have the code of b2s.server??

#6 doogie2301

doogie2301

    Enthusiast

  • Members
  • PipPipPip
  • 97 posts

  • Flag: United States of America

  • Favorite Pinball: Funhouse

Posted 16 September 2016 - 09:11 PM

Well... it is a .NET library, and the compiled output contains the IL code, so with the right tools it doesn't take too much effort to get back to readable C#/VB.NET code...



#7 arngrim

arngrim

    DJ Force Feedback

  • VIP
  • 2,188 posts
  • Location:Charleroi, Belgium

  • Flag: Belgium

  • Favorite Pinball: Monster bash



Posted 16 September 2016 - 11:18 PM

excellent, we want to check and surely update the source code, so can you rebuild the whole source code?

#8 doogie2301

doogie2301

    Enthusiast

  • Members
  • PipPipPip
  • 97 posts

  • Flag: United States of America

  • Favorite Pinball: Funhouse

Posted 17 September 2016 - 12:40 AM

unfortunately, no.  the de-compilation process is not perfect and some parts did not work in this case, but I can try some other tools to see if I get better results.



#9 arngrim

arngrim

    DJ Force Feedback

  • VIP
  • 2,188 posts
  • Location:Charleroi, Belgium

  • Flag: Belgium

  • Favorite Pinball: Monster bash



Posted 17 September 2016 - 01:44 AM

ok thanks :)

#10 Greynurse

Greynurse

    Enthusiast

  • Members
  • PipPipPip
  • 321 posts
  • Location:Australia

  • Flag: Australia

  • Favorite Pinball: DOOM by Bigus1

Posted 13 April 2020 - 09:10 PM

Doogie2301 has the best answer. I solved my issue when I found an xml file called B2Sserver setup.xml. It was empty but it's presence was preventing the B2S backglasses loading. Deleted the file and evrything is now running as it should.

 

Cheers,

 

Nursie



#11 doogie2301

doogie2301

    Enthusiast

  • Members
  • PipPipPip
  • 97 posts

  • Flag: United States of America

  • Favorite Pinball: Funhouse

Posted 18 April 2020 - 11:20 AM

wow, glad my post from several years back could still be of some use.  for anyone else coming to this thread, keep in mind a newer version was released since then that updated this logic to also support exact filename matching, and the source code has been made available here: https://sourceforge..../b2s-backglass/