Results 1 to 9 of 9

Thread: VB.NET 2005 -- "build" does not work as expected ...

  1. #1

    Thread Starter
    Member
    Join Date
    Feb 2009
    Posts
    34

    Question VB.NET 2005 -- "build" does not work as expected ...

    Hi, Folks.

    When I used VB 5.0, I had a handle on the "Build" process. I'd make an .exe and put it on the machine I wished it to run on. If it required copious data or reference files, I'd either build the directory I needed with a batch file, or put it all on a CD with an autorun.inf.

    Problem is...

    In VB.NET 2005, when I hit "Project" "build" I get an .exe file in the appropriate /bin/release folder, but if I copy the .exe to a CD or other drive, and try to run it on another machine, I get "The program failed to initialize properly." I've made sure that all of the files that are in the /bin/release folder are also on the CD, in case it's trying to refer to an external file.

    The project runs under debug in the IDE, and the .exe runs on the development PC with the IDE closed.

    One possible hypothesis that I haven't tested: The program uses a "RealPlayerG2" control to access sound file snippets. Is it possible that the target machine doesn't have RealPlayer, so the control won't work? Is that a likely cause of this error? Should I rewrite the program using a Windows Media Player control (which is .COM network instead of .NET)?

    Or should I be using the "Project" "Publish" menu item, and creating a "Setup" file that the user has to run before using the program proper?

    Any thoughts, comments, or war stories are welcome... I'm planning to send the completed CD to a user in Europe, so I'd like it to be bulletproof before I ship.

  2. #2
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,344

    Re: VB.NET 2005 -- "build" does not work as expected ...

    Yes, that could be a possibility and I don't think Real allow redistribution of dlls, ocx, etc so you probably need to install Real Player on the target machine in-order for your application to work correctly.
    when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
    If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
    https://get.cryptobrowser.site/30/4111672

  3. #3

    Thread Starter
    Member
    Join Date
    Feb 2009
    Posts
    34

    Re: VB.NET 2005 -- "build" does not work as expected ...

    I'll change it over to WMP. Argh.

  4. #4

    Thread Starter
    Member
    Join Date
    Feb 2009
    Posts
    34

    Question Re: VB.NET 2005 -- "build" still does not work as expected ...

    Okay, so I went to every form and deleted the RealPlayer control, which I was calling "Real1". Then I imported COM framework controls, and used the Windows Media Player control, which I called "WMP1."

    Next, I went to every code line that referred to "real1" and replaced "Real1.source =" with "WMP.URL ="

    Again, this works within the IDE, and on the development computer with the IDE closed. Burning to a CD and attempting to open it on another PC, however, yields to same error: "program failed to initialize, 0x0c0000135, ..."

    Same results for autorun or for manually clicking the EXE file.

    I did verify that the EXE file is the new build that I built today.

    Anyone got a clue, suggestion, war story?

  5. #5

    Thread Starter
    Member
    Join Date
    Feb 2009
    Posts
    34

    Re: VB.NET 2005 -- "build" does not work as expected ...

    possibly resolved. Tried a third machine, where it works as designed. My new theory is that the test computer did not have the. NET framework.

  6. #6
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,344

    Re: VB.NET 2005 -- "build" does not work as expected ...

    Why do you have the same control on each form? You just need to reuse your original instance.
    when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
    If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
    https://get.cryptobrowser.site/30/4111672

  7. #7

    Thread Starter
    Member
    Join Date
    Feb 2009
    Posts
    34

    Re: VB.NET 2005 -- "build" does not work as expected ...

    Well, it's the only method that has worked for me thus far. Is there a way to make a button in one form activate a control in another form?

  8. #8
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,344

    Re: VB.NET 2005 -- "build" does not work as expected ...

    Based on the Microsoft example here.

    Add 2 forms
    Add the Windows Media Player control to the first form along with a button
    Add a button to form2

    Use the code.

    Form1:
    vb Code:
    1. Public Class Form1
    2.  
    3.     Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
    4.         Form2.Show()
    5.     End Sub
    6. End Class

    Form2:
    vb Code:
    1. Public Class Form2
    2.     Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
    3.         Form1.AxWindowsMediaPlayer1.URL = "C:\Users\User\Desktop\Music\Goyte feat Kimbra - Somebody That I Used To Know.mp3" ' Replace the song with one of your choosing
    4.     End Sub
    5. End Class
    when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
    If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
    https://get.cryptobrowser.site/30/4111672

  9. #9

    Thread Starter
    Member
    Join Date
    Feb 2009
    Posts
    34

    Re: VB.NET 2005 -- "build" does not work as expected ...

    Simple and useful. I'll do that next time.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width