|
eddieangel wrote: Thoughts?
Lots of them. I could ask one hundred questions, but I won't.
It is up to you to provide more information about your app, the problem frequency, the value of strImage, the history of that file, etc.
BTW: don't swallow exceptions, have Exception.ToString() logged and study it!
|
|
|
|
|
I thought there might be a quick answer that I was not aware of. This process in this application has worked indefinitely. The value of the strImage is UNC path (\\fileserver-01\images\201001010001_00000001.jpg)
If I type the UNC path into the run window it pops up. As you can see I specifically catch the file not found exception. I had a message box pop up that printed the value of strImage, and I ran that value through the run window and got the file to pop up, but it will not come up in the picture box.
I do have a logging function, I just took it out of this particular example to try and simplify and isolate the error.
I can't duplicate the issue on my development machine
|
|
|
|
|
so it could be an access privilege problem, your app not being allowed to handle UNC filepaths. Not sure what the right solution is; maybe you could map a drive letter and use that instead?
|
|
|
|
|
I mapped the network drive and am still unable to access anything with the application. My first guess was permissions as well and I am sure that there is something to it, but I can't figure out what. I can access network resources via UNC path or mapped drive using the run dialog, but the same path, UNC or map, does not work within the application. File.Exists(strImage) produces a false result.
It is truly bizzare because it still works on my machine, and another machine that I just loaded yesterday, but it does not work on several other machines. Environmentally speaking, they are all over the board with operating system and patch level, and there is no commonality between the machines that do work. One is Windows Vista Home and one is Windows 7 Professional. However, six other machines with Windows Vista Home do not work.
Beyond that, if it were a straight permissions issues I would expect an IO exception as opposed to a FileNotFound. It is all very vexing seeing as how this application has worked and been stable using these same parameters for more than a year only to start freaking out now.
I want to blame Microsoft, but I doubt that I can.
|
|
|
|
|
Just an idea, without any guarantee:
there is a tool called " .NET Framework XXX Configuration Tool " (file: Mscorcfg.msc) where XXX is the .NET version;
the tool came installed with 1.0 and 1.1; for later versions it would be part of the SDK (which you need to install separately).
Not sure there is one configuration common for all Framework versions (i.e. only the tools evolve), or configs are individual (tools and data are separate).
Functionality includes:
- security (adjust zone security, increase assembly trust)
- configure individual applications (?)
More here[^]
|
|
|
|
|
I configured the application using the tool as outlined. I increased the assembly trust for the application to full trust but it yielded no results.
The crux of the issue appears to be that the application just doesn't even see that the file exists. It worked fine up until two days ago with no changes, I am wondering if it got zapped with an update. Either way it is crippling my application and making me crazy.
Thanks for all of your insight, hopefully I will be able to isolate the issue on other computers.
|
|
|
|
|
You're welcome. I'll throw in one more suggestion:
you might try and correlate the failing machines with the four categories you get answering these two questions:
- is it Windows Vista/7 or something older?
- has the user administrative rights?
|
|
|
|
|
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?
|
|
|
|