|
Anonymous wrote:
thanks i hadn't seen my left arm for years
Arthur, there's an infinite number of monkeys here that want to talk to us about this script for Hamlet they've worked out.
Do you want to know more?
Not getting the response you want from a question asked in an online forum: How to Ask Questions the Smart Way!
|
|
|
|
|
Hi,
I've got a windows service that connect to a database. all is working except when I restart the computer 'cause my service start before SQL Server.
So my question is : how can I do to make my service dependent of MS-SQL ?
I want it to run only when MS-SQL is running.
Thx
Sybux
|
|
|
|
|
If your service is going to be deployed to another server WITHOUT an SQL server, it's best if your service is not dependent on the start of the SQL server. Rather, it should just throw appropriate exceptions back to the caller when appropriate. Just because the SQL server is running doesn't mean that the database will be available.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I would like to add a running time in a text box or label and I am not sure how to go about it. I was thinking of creating a timer function that reloads the textbox with the time every one second. Would that be too much for the app while the user is doing other things in the app? Is there another way?
Also, I would need to display the current running time from other time zones depending on the state the user is working with. Any ideas?
Thanks
|
|
|
|
|
A simple Timer will do the trick. Just set its .Interval property to 1000 for every 1 second. Then just fill in the current time in the TextBox.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hello
Please tell me how to create an instance of a class in an ActiveX Dll, when runtime in VB.NET
In VB6 I simply used
Set obj = CreateObject(ServerName.ClassName)
to create an instance of class ClassName.
But I couldn't find such CreateObject function in VB.NET
Please help me. I do need to access these classes at runtime.
Thanks in advance.
|
|
|
|
|
Make sure you include this line at the top of your code:
Imports Microsoft.VisualBasic
Then you can use the CreateObject function to create a COM registered object. Docs on CreateObject can be found here[^] on MSDN.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thanks Dave!
Yes I had forgot to import Microsoft.VisualBasic !!!
|
|
|
|
|
In Excel, is it possible to either A) add an overline to footer information, or B) find the last row on a page? Not the last row with data, but the last row, empty or not, just above where the footer would be printed. I've found a bazillion examples online about finding the last row with data, but none that show how to find the last physical row on a page.
Thanks in advance.
Kyosa Jamie Nordmeyer - Yi Dan
Portland, Oregon, USA
|
|
|
|
|
I’m creating a .Net component and console app which utilizes the component. When the console app calls a function from within the component I want to return one of three options, a populated property class possible as an array, an integer of 1 for success or an integer of 0 failed. If I return my results as an object how do I determine what is being return on the console app side.
Here is a look at the code on the component side.
Public Function SetLine(ByVal EntryArray() As LineEntry) As Object <br />
''
Dim LineError() As LineEntry = uVal.CheckLineEntry(EntryArray)<br />
If Not LineError Is Nothing Then Return LineError<br />
''
Return 1<br />
Catch Ex As Exception<br />
''
Return 0<br />
End Try<br />
End Function
Thanks,
Jason
|
|
|
|
|
The following code seems to resolve the problem but I’m wondering if there is a better way to handle this?
Function SetUpLine() as boolean<br />
Dim Ret as Object<br />
Dim Ret2() As App.LineEntry<br />
Dim iRet as integer<br />
Ret = App.SetLine(Entry)<br />
''
Try<br />
Ret2 = CType(Ret, App.LineEntry())<br />
Catch<br />
Try<br />
iRet = CType(Ret, Integer)<br />
Catch<br />
''
End Try<br />
End Try<br />
end function
Thanks,
Jason
|
|
|
|
|
You could recode your function to take 2 parameters, instead of one, and return a boolean result signaling sucess of failure. The first parameter would be your LineEntry array passed ByVal, the second would be another array, supplied by the caller, passed ByRef.
Public Function SetLine(ByVal EntryArray() As LineEntry, ByRef LineError() As LineEntry) As Boolean
LineError = uVal.CheckLineEntry(EntryArray)
If LineError ... whatever you use to check if LineError has anything in it... Then
' SUCCESS
Return True
Else
' FAILURE
Return False
End If
End Function
Now, if LineError gets something back, you can return True, signalling the caller that the array in LineError() holds values that need to be checked, or False if LineError can be ignored.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
That’s a great idea, it’s so easy. Thanks
Jason
|
|
|
|
|
Hi there -
has anyone ever used the function BlockInput from the user32 library?
i used this and it works. but only one way.
i call BlockInput(0&) to lock keyboard and mouse.
as soon as i call BlockInput(1&) to release the keyboard and mouse lock, nothing happens and the lock stays alive.
i do this call by remoting under vb.net and .net remoting. everything else in the function works. only the block call doesn't. has anyone any idea what the problem could be?
thx for all hints.
tom
|
|
|
|
|
You might want to try checking the return value from the BlockInput function. If it returns 0, then call the Win32 API function GetLastError to see what the problem was. You might also want to try calling the function with -1 as the parameter instead of 1.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
the return value is always unequal to zero. thats not the problem. -1 did not work. maybe it is a problem with windows xp ???
but why it locks the input, but not dislocks it? really strange ...
|
|
|
|
|
Your not Blocking input on one thread and trying to Unblock it on another, are you? If so, it's not going to work.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
this might be the problem!!!
well, then i have an idea. when i call the function, that includes the blockinput function, i open a form dialog. maybe i call the blockinput function in the "show" and "hide" function of this form...
|
|
|
|
|
Hi,
when converting a string to double value i am losing
my comma:
<br />
Dim str as string<br />
Dim value as double<br />
<br />
set str = "123.451"<br />
<br />
value = CDbl(str)<br />
<br />
output: 123451
anybody has a solution?
happy coding,
-mark
os win2000 vba office 2003, vc++ 6.0
|
|
|
|
|
I would guess that this behaviour is by design. A Double datatype is only capable of storing a NUMBERIC value. A comma is not a number, and hence it cannot be stored.
Only way to represent the comma is to store it in a string
"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
|
|
|
|
|
Now,
I put two winsock controls in Form.
Here is my Form Load code:
Dim cnt, cnt1
cnt = 0
For i = 1 To List1.ListCount
Load Winsock1(i)
Winsock1(i).LocalPort = List1.List(cnt)
Winsock1(i).Listen
For j = 1 To List1.ListCount
cnt1 = cnt + 1
Winsock2(j).LocalPort = List1.List(cnt1)
Winsock2(j).Listen
Next
MsgBox List1.List(cnt)
cnt = cnt + 1
Next
Error is:
Run-time Error "438"
Object doesn't support this Property and Method.
Mybe Problem is Index Value of Both winsock1 and winsock2 controls.
I want to First Port Number Open and Listen by winsock1(i) then second Port Number open and Listen by Winsock2(j).
Please send me Reply soon
Mohan
Mohan Balal
|
|
|
|
|
You didn't say what line the error occured on. But, I'll take a guess and say that .List() is not a member of List1 . You don't say what List1 is so I really can't tell you what to do to correct it.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I create control array of Winsock control, while compile it Gives an Error:
This is my code in Form Load event
rs.Open "select * from port_table", cn, adOpenKeyset, adLockOptimistic
While Not rs.EOF
List1.AddItem rs!portno
rs.MoveNext
Wend
rs.Close
Dim cnt
cnt = 0
For i = 1 To List1.ListCount
Load Winsock1(i)
Winsock1(i).LocalPort = List1.List(cnt)
Winsock1(i).Listen
MsgBox List1.List(cnt)
cnt = cnt + 1
Next
In this line It gives Error:
Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
Error:
Compile Error:
Procedure declaration error as type doesn't match description of event or procedure having the same name
-------------------------
I want to open and Listen all the Ports which are store in the (Port_table) table. Then communicate with all the Ports.
Please Help me as soon as Possible.
Thanks
Mohan
Mohan Balal
|
|
|
|
|
Set the index property of your winsock control to 0 then modify the function delaration with this one:
Private Sub Winsock1_DataArrival(Index As Integer, ByVal bytesTotal As Long)
|
|
|
|
|
Hi,
I am developing a custom control in VB.net. For that i am using MsFlexGrid in Windows form.
I added the rows in the FlexGrid at run time and at the same time added checkboxes in 0th column of each row.
But when the number of rows increases more than size of FlexGrid the scroll Bar appears. When i scroll the vertical scroll bar,the rows scroll accordingly but the check boxes are fixed. They don not move along with the cells they are placed in.
Please help.
Lata
|
|
|
|