P PaulR Active Member Licensed User Longtime User Aug 4, 2012 #1 I am trying to move the MediaPlayer in my app into a service, but it is giving a compiliation error.... Code: Compiling code. Error Error compiling program. Error description: Object reference not set to an instance of an object. Occurred on line: 22 mediaPlayer1.Initialize("MP") Word: ( I am declaring it here.... Code: 'Service module Sub Process_Globals 'These global variables will be declared once when the application starts. 'These variables can be accessed from all modules. Dim mediaPlayer1 As MediaPlayer .... and trying to initialize it here.... Code: Sub Service_Create mediaPlayer1.Initialize("MP") End Sub What am I doing wrong?
I am trying to move the MediaPlayer in my app into a service, but it is giving a compiliation error.... Code: Compiling code. Error Error compiling program. Error description: Object reference not set to an instance of an object. Occurred on line: 22 mediaPlayer1.Initialize("MP") Word: ( I am declaring it here.... Code: 'Service module Sub Process_Globals 'These global variables will be declared once when the application starts. 'These variables can be accessed from all modules. Dim mediaPlayer1 As MediaPlayer .... and trying to initialize it here.... Code: Sub Service_Create mediaPlayer1.Initialize("MP") End Sub What am I doing wrong?
Erel B4X founder Staff member Licensed User Longtime User Aug 4, 2012 #2 Initialize doesn't expect any parameter. Only Initialize2. Upvote 0
P PaulR Active Member Licensed User Longtime User Aug 4, 2012 #3 :BangHead: OMG, that was a public brain fart. Sorry 'bout that. Upvote 0