|
Just another thought... Are these machines setup in a domain (Active Directory) environment or is everything Workgroup?
If everything is workgroup, that would cause a problem like this. Other than that, NTFS and Share permissions are the most common cause of this problem.
|
|
|
|
|
It is a domain environment. The Windows Vista Home clients are not connected to the domain, but they are authenticated with the fileserver. I am able to access files on the file server from those machines using explorer, just not with my application at the present time.
|
|
|
|
|
Hi, dear all
I need to create a text file with each control at a line, in this line, it include control value, control name and description, the output should be as the following:
False Print - XXXXXXXXXXXXXXXXXXXXXXXXXX
2 Contrl 1 - XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
3.6 Control 2 - XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
23.8 Control 3 - XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
0.005 Control 4 - XXXXXXXXXXXXXXXXXXXXXX
The problem is align the column 1, how can I align the decimal point at same position at each line, and prefix the heading as space? and the heading space number is changed according the value?
For example, for contrl 1 and control 2, the heading space is 3, but for control 3, it's 2.
I use something like:
value = Format(Contrl1, " 0")
Writer.WriteLine(value.PadRight(ValueFieldLen) & _
"Contrl 1".PadRight(ContrlFieldLen) & _
"- XXXXXXXXXXXXXXXXXXXXXXXXXX")
value = Format(Contrl3, " 0.0")
Writer.WriteLine(value.PadRight(ValueFieldLen) & _
"Control 3".PadRight(ContrlFieldLen) & _
"- XXXXXXXXXXXXXXXXXXXXXXXXXX")
In this way, the prefix spacing is fixed, this isnot I want.
Thanks!
|
|
|
|
|
Andraw Tang wrote: how can I align the decimal point at same position at each line, and prefix the heading as space? and the heading space number is changed according the value?
You're going to have to show examples of this. Your examples would have to be posted inside PRE tags, otherwise HTML formatting will remove all spaces and wreck the formatting.
If you have a variable number of numbers before and after the decimal point, you'd have to either:
1) Pad both sides of the decimal point with spaces, making the column a fixed width that can contain the maximum number of digits for BOTH sides of the decimal point,
2) Keep track of the number of numbers on both sides of the decimal point and recalculate the fixed width of the column, the position of the decimal point inside the column, and what the maximum padding values show be for both sides of the decimal to keep the decimal point in the same place. This would require that you know all of the values in the column before you write event a single line to the text file.
|
|
|
|
|
|
Eddy,
Thank you very much, that what I did right now.
|
|
|
|
|
I have a text box and a timer and a button "stop"
Is it possible that when "Fire" string is in textbox then t1_timer() event fire.
Actually I have to send repeatedly a message when "Fire" is in Text box.and when stop button is clicked it stops fire event.
How it can be????
|
|
|
|
|
Handle the Change event of the TextBox and check for the string you want. IF the string you want is there, enable the Timer at whatever interval you want. In the Click even tof the Button, disable the timer.
This is very easy to do, and shows that you have no experience in VB at all. If this is the case, I seriously suggest dropping VB6 and picking up VB.NET before you waste a bunch of time on a lanugage that's been dead for quite some time now.
|
|
|
|
|
Dave Kreskowiak wrote: that's been dead for quite some time now.
It's not completely dead, from time to time it pops it's ugly head up and gives me head ache's. (Damn I hate maintaining legacy projects )
|
|
|
|
|
Phoenix the bird for programming.
|
|
|
|
|
So do I. But, from MS' point of view, it's dead, buried and decaying.
|
|
|
|
|
I am new in Thread and want to use two functions in diff. thread.
My functions are-
sendData() and sendInfo()
How can i start that these two functions call in diff. thread and can run at same time.
Plz explain in detail..
Thanks in adv..
|
|
|
|
|
VB6 doesn't support threading. There are work arounds to do this, but you better know what you're doing and why. Also, the debugger does not support debugging multithreaded code. Try it and you'll crash the IDE.
If you really want to do threading, drop VB6 and pickup VB.NET.
|
|
|
|
|
As Dave already mentioned, you don't want to call CreateThread from VB6. You can find example-implementations on the internet, but most aren't complete and it seldom a good idea. For an in-depth explanation, check this[^] article.
There are some alternatives, like encapsulating your thread in a complete executable. The best option to add multithreading to an existing VB6 application, is by using VB.NET; you can use the InterOp Toolkit[^] to extend your VB6 application with VB.NET specific code. You could create a new form in VB.NET, add as much threading as you like, and load that form from VB6.
If it's a new project then you'd best move on to VB.NET.
I are Troll
|
|
|
|
|
hi to all..
I have two dynamic array bOdt and bodtEntry byte arrays. which are declared as follow-
Dim bOdt() As Byte
Dim bOdtzentry() As Byte
and I am passing BOdt in a function as two dimension array but still it is dynamic.Now I want to store this bOdt array in another array bOdtEntry and change size of the array.
My code is as follow-
Public Function fOdtEntry(count As Integer, bOdt() As Byte) As Variant
Dim FlagRem As Integer
Dim FlagDiv As Integer
Dim RefCntr As Byte
ReDim bOdtEntry(0 To count, 0 To 9) As Byte
bOdtEntry = bOdt
bOdtEntry(count, 0) = bGet(8)
bOdtEntry(count, 1) = bGet(9)
and so on..
On compilation it is giving an error."Subscribe out of range"
Plz help what may be the problemmmmm??
Thanks in adv.
|
|
|
|
|
If you are using Option Base 0 then count will be 1 higher than the upperbound index.
you should not use fixed values, but use Ubound and if you do use count then subtract 1 for the highest index.
|
|
|
|
|
thanks for replay..
But i am not getting it.
I am using base 0 and count is the ubound of array....
Can u explained in detail..
Thanks
|
|
|
|
|
If you are using Base 0 then look at the following example for an array called Names;
Index - Item
-------------
0 - Fred
1 - Jim
2 - Bob
3 - Frank
4 - Jack
Count = 5, LBound = 0, UBound = 4
So,
Names(0) = Fred
Names(4) = Jack
Names(Count-1) = Jack
Names(Count) = Out Of Limits Error
Does that explain it better?
|
|
|
|
|
thanks for ur reply..
I got the solution..
|
|
|
|
|
Hi Guys,
I have a Crystal report with a sub report.
i need to set the subreport to use paper from an alt. tray from the printer.
any ideas?
rptMain.Subreports(0).PrintOptions.CustomPaperSource = GetSelectedPaperSource(Me.cbDft.Text.Trim)
Private Function GetSelectedPaperSource(ByVal paper As String) As System.Drawing.Printing.PaperSource
Try
Dim selectedPaperSource As System.Drawing.Printing.PaperSource = New System.Drawing.Printing.PaperSource
Dim myPrinterSettings As System.Drawing.Printing.PrinterSettings = New System.Drawing.Printing.PrinterSettings()
myPrinterSettings.PrinterName = Me.lblPrinter.Text.Trim
For Each myPaperSource As System.Drawing.Printing.PaperSource In myPrinterSettings.PaperSources
If myPaperSource.SourceName = paper Then
Return myPaperSource
End If
Next
Catch ex As Exception
Throw New Exception(ex.Message & vbCrLf)
End Try
End Function
thanks
|
|
|
|
|
Hi
if you placed (almost) any control on the form (textbox,combo,datetimepicker,groubbox) and set the property "Enable" to "false" you can notice that there color has changed to light-grey color, but if you set "Enabled = false" for the datagridview I cannot distinguish any changes from "Enabled = true".
I want the ability of telling that this datagridview is enabled or disabled by looking to it, not by moving the mouse over it and test if it will take focus or no.
Thanks.
modified on Tuesday, September 7, 2010 5:06 AM
|
|
|
|
|
For a datagridview it is better to use the read-only property.
If you disable the control everything inside the control is disabled so if there are any scroll bars (horizontal or vertical) your user won't be able to scroll.
With read-only the user will still be able to scroll.
As for a visual clue, you'll have to write something yourself to do that.
You can use the 'enabledchanged' and/or 'readyonlychanged' events for that.
|
|
|
|
|
I have a VB application that updates one database using input from another database. The code looks like:
Dim InputDC as OldDatabaseConnection
Dim OutputDC As ...
InputDC.Open
OutputDC.Open
For each table in Input Database
Read data from old table
Copy data to new table
Write new table to Output database
...
InputDC.Close
OutputDC.Close
Sometimes [often] the Output database does not close, that is the Output.ldb file is left hanging around for an indefinite time period. Sometimes the program runs fine e.g. 50 times in a row; then suddenly it will hang. I've been programming for 45 years and have done consulting and know the first rule is that "Users lie about no changes"; however in this case there ARE no changes to the code. The program wants to rename the data bases so that Input.mdb becomes Input_Old.mdb and Output.mdb becomes Input.mdb. With the control file (Output.ldb) hanging around, the Rename causes an exception. It is [almost] always the Output.ldb file that is still around implying that Output.MDB is still open...
I have taken the code apart line by line; there is only one open and close per database. There are closes within Catch paragraphs. But, there is only one .Open per database.
I've tried a variety of loops testing for the .ldb to go away, but this usually just results in the program running for a very long time doing nothing. When the program is terminated thru its main form's Exit button, the .ldb files go away almost immediately. I can watch the history of file creation, etc. in Windows Explorer as the program runs.
Has anyone experienced this "feature"? If so have you figured out how to solve it?
Charles Wolfe
C. Wolfe Software Engineering
|
|
|
|
|
I've seen this a few times before with other files on windows system. (Windows Server 2003) If I had to guess, the OS is doing some caching or something and the operation is not finished. My solution to this was to use a Try-Catch block and sleep for a few seconds before trying to access the file again. I put a counter in the loop so that if it tries more than 100 times, it finally aborts the operation. Not the best solution, but at least my program no longer crashes because Windows didn't finish renaming the file.
I'm an old VAX/VMS guy and the crap you have to deal with Windows is just awful. (getting off my soapbox now ...)
Give the Try-catch loop thing a try and see if it works for you.
|
|
|
|
|
Maybe, just maybe, your newly created/modified file is in use by another program, e.g. an anti-virus or an indexer (such as Google Desktop Search). What you could do is provide a loop that tries 5 times, with 1 second interval. It is what Windows Explorer does when you tell it to delete a file!
|
|
|
|