|
Sorry, I cant really help much more. I dont have any other ideas.
Tatham Oddie (VB.NET/C#/ASP.NET/VB6/ASP/JavaScript)
tatham@e-oddie.com
+61 414 275 989
|
|
|
|
|
Uh, I am sorta new at this toolbar thing. Can someone give me the syntax of how to make the toolbar buttons do something? It has to do with toolbar_buttonclick () I am pretty sure. Please help
|
|
|
|
|
If it is VB6...
When you set the properties for your toolbar, you have to set the key for each button, for example, "IDX_NEW","IDX_OPEN", etc.
Then
<br />
Private Sub toolbar_ButtonClick(ByVal Button as MSComctlLib.Button)<br />
Select Case Button.Key<br />
Case "IDX_NEW"<br />
coding<br />
Case "IDX_OPEN"<br />
coding<br />
........<br />
<br />
Notorious SMC
The difference between the almost-right word & the right word is a really large matter - it's the difference between the lightning bug and the Lightning
Mark Twain
Get your facts first, and then you can distort them as much as you please
Mark Twain
|
|
|
|
|
hi
my name is rachel and I need help.
I don't know how to use the controls:LabelArray and MenuItemArray
|
|
|
|
|
Both these object are from the vb6.compatibility namespace and are used to represent control array when upgrading a project from vb6 to .net. Microsoft does not recommend the use of these objects for new .net projects sinse they will not support it in later versions. However, if you still want to use them...
First add the controls to the form, say lblArray,lbl_0,lbl_1,lbl_2
then
<br />
Public Sub Form_Load()<br />
lblArray.SetIndex(lbl_0,Ctype(0,Short)<br />
lblArray.SetIndex(lbl_1,Ctype(1,Short)<br />
lblArray.SetIndex(lbl_2,Ctype(2,Short)<br />
End Sub<br />
You can then reference these controls as lblArray(i), where i = 0,1,2
though IMHO, it's better than you not use them. Instead just declare an array of labels and assign each control to it
Notorious SMC
The difference between the almost-right word & the right word is a really large matter - it's the difference between the lightning bug and the Lightning
Mark Twain
Get your facts first, and then you can distort them as much as you please
Mark Twain
|
|
|
|
|
Dear All,
I am having difficulty in running the following code: -
Basically, i am writing this code in Window XP and it run well. But, when i changed to
Window 98, it run the notepad.exe, but also pup-up the message box. May i know what is the problem here. The followings are the exact code that i used in XP and 98.
Thank in advance. Merry Xmas n happy new year...
Dim x As Integer
Private Sub Form_Load()
On Error GoTo Err
x = Shell("Notepad.exe", vbHide)
Unload Me
Exit Sub
Err:
MsgBox "File Not Found", vbCritical
Unload Me
End Sub
|
|
|
|
|
in the error handler take a look at the error message and error number to give an indication as to why your handler is being called.
Paul Watson wrote:
"At the end of the day it is what you produce that counts, not how many doctorates you have on the wall."
George Carlin wrote:
"Don't sweat the petty things, and don't pet the sweaty things."
|
|
|
|
|
I defined a function like this:
func(byref x as ADODB.Connection)
then i :
Dim conn as New ADODB.Connection
afterwards i:
func(conn)
but when i compiled it, i met a error. How to write correctly?thanks much
|
|
|
|
|
What does the error say? what about the error code?
Notorious SMC
The difference between the almost-right word & the right word is a really large matter - it's the difference between the lightning bug and the Lightning
Mark Twain
Get your facts first, and then you can distort them as much as you please
Mark Twain
|
|
|
|
|
type mismatch
|
|
|
|
|
Try this:-
<br />
call func(conn)<br />
or
<br />
func conn<br />
Notorious SMC
The difference between the almost-right word & the right word is a really large matter - it's the difference between the lightning bug and the Lightning
Mark Twain
Get your facts first, and then you can distort them as much as you please
Mark Twain
|
|
|
|
|
thanks,i solved the type mismatch by your advice.
|
|
|
|
|
But do you understand WHY this worked? I think that is more important.
Using parens in VB mandates that your function RETURN something.
For example:
Public Function AddNumbers(numOne As Integer, numTwo As Integer) As Ineteger
Dim retVal as Integer
retVal = numOne + numTwo
AddNumbers = retVal
End Function
This function would be called like so:
Dim answer As Integer
answer = AddNumbers(1, 2)
If you have a Subroutine they generally don't return anything. This is afterall the main difference between a Function and a Subroutine. Functions do soemthing AND return something.
Given a Subroutine as such:
Public Sub DisplaySomething(something As String)
Debug.Print something
End Sub
Because this does not return anything it has to be called one of the following ways:
DisplaySomething "Hello World."
-or-
Call DisplaySomething("Hello World.")
This is one of the reasons that alot of people don't like VB. They feel confused by needing to rememebr if they have to use parens or not.
Generally speaking i think that using the Call keyword is bad form though. Simply don't use parens and all is fine.
Paul Watson wrote:
"At the end of the day it is what you produce that counts, not how many doctorates you have on the wall."
George Carlin wrote:
"Don't sweat the petty things, and don't pet the sweaty things."
|
|
|
|
|
Ray Cassick wrote:
rememebr if they have to use parens or not.
Tell me about it !
And for someone like me who alternates between .net and vb6, it can get even more confusing! Thank god for .net's intellisense. I just don't bother with parens at all.
Notorious SMC
The difference between the almost-right word & the right word is a really large matter - it's the difference between the lightning bug and the Lightning
Mark Twain
Get your facts first, and then you can distort them as much as you please
Mark Twain
|
|
|
|
|
Ray Cassick wrote:
Generally speaking i think that using the Call keyword is bad form though. Simply don't use parens and all is fine.
Really, humm, I prefer to use the parens because, I like to make it more blatently obvious that I am calling a function ( the keyword "call" helps with that blatentness)
With default functions sometimes it is not immeadly obvious what one was thinking when they wrote their code.
|
|
|
|
|
Hi !!
I want to obtain pointer to function using GetProcAddress() API and then want to use this pointer to function in order to call that function. How can i achieve this in VB.
|
|
|
|
|
Try here... This seems liek a decent example:
Google Clickety[^]
Paul Watson wrote:
"At the end of the day it is what you produce that counts, not how many doctorates you have on the wall."
George Carlin wrote:
"Don't sweat the petty things, and don't pet the sweaty things."
|
|
|
|
|
I launch a dos program inside my program and then capture the command line output to my VB program. How to do this? Thanks!
|
|
|
|
|
When you shell out to your DOS application, pipe the output to a file using the '>' directive, then reed the file in after the program is done.
Paul Watson wrote:
"At the end of the day it is what you produce that counts, not how many doctorates you have on the wall."
George Carlin wrote:
"Don't sweat the petty things, and don't pet the sweaty things."
|
|
|
|
|
This is a very inefficient way to do this and will only return the complete result after the program has finished executing.
Providing you've left the caves and moved into .NET, the more efficient way is to:
Dim myProc As New System.Diagnostics.Process<br />
myProc.StartInfo.UseShellExecute = False<br />
myProc.StartInfo.RedirectStandardOutput = True<br />
myProc.StartInfo.FileName = "ping"<br />
myProc.StartInfo.Arguments = "www.google.com"<br />
myProc.Start()
You have now taken control of the process and have access to the output AND input streams. You could even write your own version of command.com if you wanted.
The output stream is located at: myProc.StandardOutput
Im sure you'll find the rest.
Tatham Oddie (VB.NET/C#/ASP.NET/VB6/ASP/JavaScript)
tatham@e-oddie.com
+61 414 275 989
|
|
|
|
|
Well that seems very elegant. I have to admit that I was unaware of how to do that.
It does only work for VB.NET however. I am not sure what Teir was working in (.NET or VB6).
Thanks.
Paul Watson wrote:
"At the end of the day it is what you produce that counts, not how many doctorates you have on the wall."
George Carlin wrote:
"Don't sweat the petty things, and don't pet the sweaty things."
|
|
|
|
|
I have implemented this code in a WebForm which basically gives me a remote command line into the server.
I never thought I would tunnel DOS over the internet.
This does make a few holes in the security of shared hosting as it effectively bypasses all permissions. While you may not by able to use System.IO to delete say C:\Autoexec.bat - you can upload a console app and execute that from the machines system account.
Tatham Oddie (VB.NET/C#/ASP.NET/VB6/ASP/JavaScript)
tatham@e-oddie.com
+61 414 275 989
|
|
|
|
|
|
I'm trying to create an ActiveX DLL control in VB but I'm running into one snag. I want a simple form in the ActiveX control that has a scrollbar and a few buttons. This is working except that my form/dialog is popping up outside of IE. I want it to show up in IE (using the OBJECT tag) like a control embeded in the web page. Any suggestions?
It seems like I just need to make the form a child of the main class or IE somehow.
' MainClass
Private TheForm As TimeAdjustForm
Private Sub Class_Initialize()
Set TheForm = New TimeAdjustForm
TheForm.Visible = True
End Sub
Private Sub Class_Terminate()
Set TheForm = Nothing
End Sub
Todd Smith
|
|
|
|
|
As far as I know there is no way to directly display a VB form on a web page. You would have to build your form as a visual OCX control.
Paul Watson wrote:
"At the end of the day it is what you produce that counts, not how many doctorates you have on the wall."
George Carlin wrote:
"Don't sweat the petty things, and don't pet the sweaty things."
|
|
|
|