|
Thanks,
I did the following and it worked like a charm:
Dim strMode As String = Microsoft.VisualBasic.Command()
If strMode = "Report" Then
MsgBox("Print Report")
Else
MsgBox("Display Form")
End If
The program is executed:
program.exe Report
Thanks again!! Kevin
|
|
|
|
|
The problem was that you didn't have the signature of your Main correct, rather than using the Microsoft.VisualBasic compatibility namespace you could do the following:
Public Shared Sub Main(ByVal args() As String)
Dim strMode As String
If args.Length > 0 Then
strMode = args(0)
End If
If strMode = "Report" Then
MsgBox("Print Report")
Else
MsgBox("Display Form")
End If
End Sub
|
|
|
|
|
I tested your suggestion and it also worked very well.
Thanks!!
|
|
|
|
|
Hi Kevin, Ben here,
I guess you will be proud to know that you can at least help me on this 'Sub Main' issue. I have just started doing my first project in VB.NET. When I try running my project i get an error code indicating that 'Sub Main ' is missing . Could you please explain to me what this 'Sub Main' is all about, and how I can include it in my project.
Regards,
Ben
|
|
|
|
|
With VB you can designate where you want your application to start. For example you might want it to start with a form, a class or a module. If you start with a class or module VB is looking for Sub Main by default.
When you look at your project in Solution Explorer you'll see a list like the one shown below:
Solution test (1 project)
test
References
AssemblyInfo.vb
Class1.vb
Form1.vb
Right click on the second line (which is test above) and left click on properties.
You'll see a drop-down menu called "Startup object". Pull that menu down and select what sub routine or form you would like your application to start with.
Instructors of VB intro courses always seem to code in the form. This is fine for small financial calculator projects that they have you create while training, but when you start coding larger projects and have multiple forms and sub procedures you can start the application with a "Sub Main" in a class or a module to control all your forms.
Hope this helps. I've been coding in COBOL for 14 years and just recently started working with VB .NET because the company is going from a mainframe environment to a PC environment. I'm only on my 4th or 5th project and definitely consider myself a beginner. Hang in there... With .NET there is so much to learn that information overload can become a problem. Eventually the concepts will fall into place for you.
Kevin
|
|
|
|
|
A quick one,
thanks mate for your contribution. Will be trying it now. Will get back to you soon. Well, I thought of beginning programming using VB.NET because there seems to be a lot of useful knowledge to be gained from it.
Regards,
Ben
|
|
|
|
|
I want to create a Help file for an application, and is currently using Help Development Studio. The program expired a couple of days ago. Are there any other Help developing software (that is free) and is easy to use?
Another thing: How do I include the help.hlp file in the project? The user must click on a "Help" Menu Item, and the Help file must open!?!?!?
Desperate...
|
|
|
|
|
hallo. I want to draw bspline in vb .net. I see that the visual studio .net has a method called spline probably to draw spline curves. Does anyone know how can i draw bspline in vb .net? Can i use this method(spline?)any freesource code for drawing bsplines k-th degree in vb .net?
Thanks anyway
kjoshoua@hotmail.com
|
|
|
|
|
Hi,
I know how to make a VB ActiveX DLL and then use that in VC++, but how can I access all the function in the VB module from VC++?
Ehsan Behboudi
|
|
|
|
|
In some of our larger applications (VB.NET), we keep getting an application exception as the program is shutting down. This seems to be untraceable, but maybe I'm missing something. Here's what the message says:
[ProgramName.exe - Common Language Runtime Debugging Services]<br />
Application has generated an exception that could not be handled.<br />
Process id=0xa6c (2668), Thread id=0x9f8 (2552)<br />
Click OK to terminate the application.<br />
Click CANCEL to debug the application.
Here are the facts we know:
1. Never happens in development mode (when debugging in the IDE).
2. The process ID and thread ID's I mentioned above vary.
3. Is somewhat random, but occurs more often than not.
4. Always occurs during the shutdown of the application.
5. When I place tracing statements in the code to write out messages to a text file so I can determine which line of code is blowing, it's always on or after the END statement.
6. There appears to be NO negative result on the data or the operating system after we acknowledge the error.
7. The error is definitely NOT coming from any error handler I've got in place; I'm assuming it's generated by the .NET framework.
8. It usually seems to happen on machines that don't have any debugging tools, so clicking on CANCEL doesn't really do anything. I got it once on a machine that had the .NET IDE loaded on it; clicking cancel just told me there was no code at that point that could be debugged.
The other day, the application that does this the most did something slightly different when it ended, but the effect was the same. This occurred once and has never duplicated, so it might be a red herring. This time the message box said:
[WindowsFormsParkingWindow: ProgramName.exe - Application Error]<br />
The instruction at "0x77fcc813" referenced memory at "0x00000010". The memory could not be "read".<br />
Click on OK to terminate the program.
Does anyone have any ideas or clues on how to start finding and eliminating this? While it doesn't seem to hurt anything, it sure does make it look like my app is broken to the customer.
Thanks for any help.
Mike Mestemaker
|
|
|
|
|
I'm going to make a book recommendation: John Robbins' Debugging Applications for Microsoft .NET and Microsoft Windows[^].
He covers a great deal of information about how to debug the trickiest problems. (Note for VB6 users: I recommend the previous edition of this book, if you can find it - this edition doesn't cover VB6).
At a guess, you possibly need to turn on Native Debugging, or use WinDbg with the Son-of-Strike (SOS) debugger extension, for debugging .NET programs.
Perhaps you have a finalizer that's causing an exception?
You could also try using the CLR SPY Debug Probes tool[^] to see if there's anything odd going on, if you're doing any interop.
--
Mike Dimmick
|
|
|
|
|
Any subclassing going on? You must always release any subclassed windows before ending your application...
'--8<------------------------
Ex Datis:
Duncan Jones
Merrion Computing Ltd
|
|
|
|
|
I was wondering how to do basic commands for the MMControl 6.0. Any info would be helpful!
Thanks
The Jazz Master 6000
DJ Badknees
Parma Grind Crew - www.geocities.com/parmagrindcrew
|
|
|
|
|
Try
Private Sub Command1_Click()<br />
MMControl1.Command "Play"<br />
End Sub
Hope it helps - shout (virtually) if you need more help
Paul
I don't think anyone should write their autobiography until after they're dead. - Samuel Goldwyn
modified 18-Jul-18 11:59am.
|
|
|
|
|
I wish to develop a small application in VB6 which makes it possible to publish files in a webdav server. I seek a ActiveX control or a component which makes it possible to write in a webdav server.
Vincent
|
|
|
|
|
Can anyone help? I am new to programming and am looking for a data bound grid control that can have the background colour of the rows set independantly.
Scuggins
|
|
|
|
|
Try MSFlexGrid
"It was when I found out I could make mistakes that I knew I was on to something."
-Ornette Coleman
|
|
|
|
|
I am going to built in a bitmap along left side of menu...
but I cannot find that tools in VB.NET...I only find some win32 source code
on web, can anyone teach me to do so?
|
|
|
|
|
Actually, there are some free controls that let you do this in .NET - the Magic Library[^], among others.
"Blessed are the peacemakers, for they shall be called sons of God." - Jesus
"You must be the change you wish to see in the world." - Mahatma Gandhi
|
|
|
|
|
I have a MDI application that I have created that is an Editor with special functionality. I am now being asked to create this application as a an ActiveX control to be used from within another application. I have made several ActiveX DLLs before but have only played around with a couple ActiveX Control tutorials.
Now that I am actually starting to recreate my application as a control I don't see exactly how I should do this. My Editor application has a MDI form that contains a menu control and uses another form to create a blank document each time the user selects file|new. Other forms are basically dialogs that get called from other menu options.
I understand that I can create a UserControl Object and add other ActiveX controls to it (such as my menu control) but how do I emulate the same effects as a MDI form? Can this even be done as a control? Any help would be greatly appreciated.
Debi
|
|
|
|
|
Hi,
I wrote a UserControl in VB6, and i used PropertyPages to set the control's Property.
I want to wrtite this UserControl in VB.NET but i could not find how to make PropertyPages (or similar).
I also need to put a ProgressBar within a ListView column but i don't know how to make that.
Can someone help me please?
Thank you very much
Sindebad from France
|
|
|
|
|
I'm trying to write a program that will convert minutes to hours. For example, say a user inputs that they had 1,256 minutes logged on somewhere and they wanted to know how much that would be in hours (20.93 hours, but I need it to be displayed as 21 Hours and 55 Minutes.) Is there any built in method or function that .NET can use to calculate values on hourly or minutely fashion?
I've tried the dynamic help, but the time functions in there display dates and such.
I fear I may have to do it the old fashioned way with many mathimatical hijinx!
The Jazz Master 6000
DJ Badknees
Parma Grind Crew - www.geocities.com/parmagrindcrew
|
|
|
|
|
this may help :
VbCode:
<font color="blue">Private</font><font color="blue"></font> <font color="blue">Sub</font> Button1_Click(<font color="blue">ByVal</font> sender <font color="blue">As</font> System.Object,<font color="blue"></font> <font color="blue">ByVal</font> e <font color="blue">As</font> System.EventArgs) <font color="blue">Handles</font> Button1.Click <br> <font color="blue"></font><font color="blue"></font> <font color="#0000FF">Try</font> <br> <font color="blue"></font><font color="blue"></font> <font color="blue">Dim</font> x <font color="blue">As</font> DateTime = <font color="blue">New</font> DateTime() <br> <font color="blue"></font><font color="blue"></font> <font color="blue">Dim</font> mins <font color="blue">As</font> <font color="#0000FF">Double</font> = 120 <font color="DarkGreen">'/// minutes <br></font><br> <font color="blue"></font><font color="blue"></font> MessageBox.Show(x.AddMinutes(mins)) <font color="DarkGreen">'
Vb:
<font color="blue">Public Function</font> TwinsOnWay(<font color="blue">ByVal</font> twins <font color="blue">As String</font>) <font color="blue">As String <br> Select Case</font> twins<br> <font color="blue">Case</font> "Gender" <br> <font color="blue">Return</font> "Two Girls" <br> <font color="blue">End Select <br> End Function</font> <br>
|
|
|
|
|
Hey!
Thanks a lot! This is just what I was looking for! Would I have to use the Format Function in able to just return a single value? Such as "2" being the number of hours? Or would I have to use some tricky string functions?
:-DCongradulations on the two girls!!!
The Jazz Master 6000
DJ Badknees
Parma Grind Crew - www.geocities.com/parmagrindcrew
|
|
|
|
|
Does VB (v6) have an equivalent to MFC's OnIdle? If not, is there a way for me to detect when my application is idle?
Dylan
|
|
|
|