Distributing is a PAIN...

genu

Well-known member
Joined
Jun 9, 2005
Messages
94
Programming Experience
1-3
ok I just finished a program, and when I try it on my laptop it doesnt work. I get some weird error. then I serach the forums instructions when distributing, and then I find a post that I have to get the Microsoft .NET Framework Version 1.1 Redistributable Package. SO I get that and install it and the target machine(laptop). I run the program AGAIN and it still doesnt work..this time with a different error;

THE SECOND ERROR:
"Application has generated an exception that could not be handled.
Process id=0xc10(3088), Thread id=0xf6c(3948).

Click OK to terminate the appication.
Click Cancel to debug the application.

I think its rediculous..that I havent able to distribute a single application to another computer....unless there is only like one command button and one textbox in the whole program.

on the targed machine I just transferred everything in the BIN folder

HERE IS THE PROGRAM and THE SORUCE..thanks...please clear my mind...because what use is a program that will only run on one computer........
 

Attachments

  • WindowsApplication5.zip
    76.2 KB · Views: 89
  • bin.zip
    65.7 KB · Views: 63
The most likely reason for this is that you are using a hardcoded reference to something like a file or a database that either doesn't exist or is in a different location on the target machine. You should always try to use relative references if possible. You can get the location of the app itself using Application.ExecutablePath (includes the executable file name) or Application.StartupPath (does not include the executable file name). Using this method if you want to access myFile.txt that you know is located in the Data subfolder of your program folder, you would use Application.StartupPath & "\Data\myFile.txt". This will work regardless of where your program is located.

I have made this post without looking at your code, so if it does not fix your problem I apologise. As I said, though, it is the most likely culprit.
 
I know what you mean...and I have used those methods to access one text file....but my program is only made up of textboxes listboxes, a progressbar..and thats it....what could be the problem?
 
If you have some idea of where the program is falling over, concentrate on that area first. I think you need to add some code that will display message boxes or write to a file to tell you where it is at. It may take some time but you will eventually be able to narrow it down and finally pinpoint the spot where the issue occurs. You might also want to consider using Try...Catch blocks in areas where exceptions might be thrown. When debugging, I usually use code like this:
VB.NET:
Try
	'Do something here that might throw an exception.
Catch ex As Exception
	MessageBox.Show(ex.ToString())
End Try
which will display a message box with the maximum information about the exception.
 
I downloaded your project and it won't compile on my machine. It says that there is no AxInetCtlsObjects.AxInet.OpenURL overload that accepts the provided number of arguments. It also says that I don't have a license to use that ActiveX control. I'd say that you are trying to use some ActiveX control that has been provided as part of some other software installed on your development machine and you cannot redistribute it. What is it that you are trying to do. If you want to display a web page there is a Microsoft Web Browser ActiveX control available from the COM Components tab that I believe you can distribute without issue.
 
When you say "as HTML", do you mean it displays the HTML code or it renders the page? If it is the former then any control that displays text will do. If it is the latter, which I suspect it is, then I'd suggest using the Microsoft Web Browser control instead. The fact that it won't work on my machine suggests that that is the reason it won't work on your machine too. Alternatively, there are probably browser controls written by various developers available on the Net, many of them freely distributable. Check developer sites like GotDotNet and the Code Project. A Google search should turn up possibilities too.
 
but I need to access the webpage to be able to get the html from it...the inet control I used takes the html from web pages and puts it in a textbox
 
Back
Top