Here is a weird one. I have 40+ VB6 apps, exes and dlls, running on a
Win2K Server. All the apps use App.LogEvent to record errors and
debugging info in the NT Log. Most of the dlls are being called from
ASP. Here is the problem, the event is logged under the name of the
last app that logged anything. Does anybody know where to start? I
tried to look, but I am running out of ideas.
Hello,
In one of my VB project, I'm sending PostMessage API function
to send character of my desired value to control. e.g. If I
need to send character J to the keyboard, I'm using
dim s as Long
s = PostMessage(Text1.hwnd, WM_CHAR, 99, 0)
where 99 is the ASCII value of character J in my font.
Now, in certain languages e.g. Japanese, Hindi and other
Asian languages, characters are made by combining 2 or
more different characters. e.g. character N of devnagiri in
some font will be made by combining ascii values 120
followed by 201.
So, I've to send 2 Postmessage calls
s = PostMessage(Text1.hwnd, WM_CHAR, 120, 0)
s = PostMessage(Text1.hwnd, WM_CHAR, 201, 0)
Now, here the real problem starts. I've to used delete /
backspace keys twice and it should be used once. This is my
client's requirement as well as rules suggested in MSDN by
Microsoft.
What I've found on Net / MSDN / Books, this solution is under
complex scripts and / or making ligatures.
1. Is there any way to send 2 characters in PostMessage function in 1 statement
e.g. using Bitwise And
120 to binary is 11110000
201 to binary is 110010011
2. Any freeware activex control / dll to make ligatures of TTF file?
I hope you've understoof my problem now. Please send me your
valuable suggestion, if you can.
Thanks
Hoping for early and positive reply.
With Best Wishes
Bye!
Gopal Krishan
[Non-text portions of this message have been removed]
Hi,
I would appreciate if someone could guide me with
suitable site/study material/books for VBA for Word. I
am designing Word templates and need to lock form
fields (disable ENTER Key)while users are entering
text in form fields, to prevent them from writing
anything outside the form fields.
Thanks;
=Jani=
__________________________________________________
Do You Yahoo!?
Yahoo! Sports - live college hoops coverage
http://sports.yahoo.com/
I don't have the whole answer, but this question got me thinking.
> If the computer should be shut down by accident or due to power
> failure, I need it to know the date it left off with and "append
file
> " rather than over-write.
>
> This all needs to be done automatically, no user interface.
How about writing the name of the file to the registry when it's
first opened. Then if there's a power outage, when it comes back on,
the program looks for the file named today's date. If it exists, it
will append, if not it will open a new file.
Hope this helps a little.
I am looking for a VB program to create log files at the end of each
night. What I need it to do:
The computer is turned on by me.
Windows 3.11 starts.
Terminal is opened.
Terminal goes into receive text file mode.
The name of the file needs to be the date, example : 012002.txt (Jan
20, 2002.
Every night at midnight, the file needs to close, thus saving the
days text log, and opening a new file with the next day as the
filename, in this example, 012102.txt.
If the computer should be shut down by accident or due to power
failure, I need it to know the date it left off with and "append file
" rather than over-write.
This all needs to be done automatically, no user interface.
Are there any programs like this out there? I've gone through
several books, and can't figure out how to do it!!! I'm more
confused than ever! If someone has a progam, I'd like a copy, even
just bits and pieces of a semi fucntioning example and info to help
get me started, though a running example would get me off to a good
start, I am not looking for others to do my work, I fully plan to
study it to increase my knowledge.
Kurt
Hi all,
Here is a good time for all who love Ebook.I can say these are really golden
collections. I got lot of ebooks both in html and pdf formats. Since it's a huge
collections i can't give it here. Rather i made a cd of all the Ebooks which u
will really worth buying it. The cost is Rs 200 only. I assure u will find your
money worth for the stuff in the cd .If any one wants to know about the cd and
the mode of payment feel free to mail me at smartguy_77in@.... Please
don't mail to any egroups id..Contact me directly..
The cd has huge collections. Chennai peoples perfered..
Thanking you,
Regards,
sanker
---------------------------------
Do You Yahoo!?
Send your FREE holiday greetings online at Yahoo! Greetings.
[Non-text portions of this message have been removed]
Hi Shawn,
I am fine tunning a word VBA application where there are customized
templates in MS WORD for sending company directives to different
branch offices located in various states. There are two problems/bugs:
(a)The signature(of the sender) is required to be on the same page as
the end of the last paragraph. Many times, the signature is singled
out and appears seperately on the next page, which is unacceptable. I
need to add code which will figure out that there is at least one
line of text above the signature on the same page.
(b) The "Find Next" / "Replace with" dialog box works, but keeps on
reappearing a couple of times even after hitting the "Cancel" button.
Lastly, could you please recommend a good site or a book for
mastering VBA as applied to MS Word?
Thanks;
=Kevin=
Hi Bob,
Sorry for the delay. I've been away from the internet for too
long. :(
Anyway,
> I have everything working, except when the program exits
> (suppose to) and I go and check the appropriate database
> and there is nothing there except the WMTR and TestLog.
> I get no error message.
>
> The grid is working fine. I can enter the measurements
> into each cell and the appropriate column headings, from
> the textboxes, are there.
Does it let you add more than one record in the grid? What are
you binding settings for the grid?
Have you explicitly defined the field associations? Right click
on the grid and select properties. You can then assign the fields
from your database into the columns of the grid. Let me know if
I'm offbase.
Regards,
Shawn K. Hall
http://ReliableAnswers.com
Just come up with an annoying little problem regarding this when the
original form is closed (destroying the tree in it) it empties my 'global
tree' also
Regards
Nigel
-----Original Message-----
From: Bachmann, Nigel [mailto:nbachmann@...]
Sent: 06 September 2001 14:45
To: 'vbra@yahoogroups.com'
Subject: RE: [VBra] Setting TreeView
As usual I reply to my own question, here's my solution so far - if anyone
can think of a more elegant way........
If global_tv Is Nothing Then
tree_load tv_main
Set global_tv = tv_main
Else
tv_main.Nodes.Clear
For Each nd In global_tv.Nodes
If nd.Parent Is Nothing Then
tv_main.Nodes.Add , , nd.key, nd.Text
Else
tv_main.Nodes.Add nd.Parent.key, tvwChild, nd.key, nd.Text
End If
Next nd
End If
Regards
Nigel
-----Original Message-----
From: Bachmann, Nigel [mailto:nbachmann@...]
Sent: 06 September 2001 13:54
To: 'vbra@yahoogroups.com'
Subject: [VBra] Setting TreeView
I have a complex tree view which is on a number of forms, it takes a while
to populate so I would like to store this information and then 'set'
existing treeview controls to it. Here is a summary of my code:
Public tv as TreeView
Private sub load_form()
if tv is nothing then
load_tree(tv_main)'populates treeview on form
set tv = tv_main ' this appears to work
else
set tv_main = tv ' this falls over
end if
End sub
If I can set tv to tv_main why can't I do the reverse? Any help appreciated
Regards
Nigel
'===========================================================
Archive : http://ReliableAnswers.com/YG/msg?vbra
Files : http://ReliableAnswers.com/YG/files?vbra
Group : http://ReliableAnswers.com/YG/group?vbra
Subscribe : http://ReliableAnswers.com/YG/sub?vbra
Unsubscribe : http://ReliableAnswers.com/YG/unsub?vbra
Attachments : Not Permitted
'===========================================================
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
'===========================================================
Archive : http://ReliableAnswers.com/YG/msg?vbra
Files : http://ReliableAnswers.com/YG/files?vbra
Group : http://ReliableAnswers.com/YG/group?vbra
Subscribe : http://ReliableAnswers.com/YG/sub?vbra
Unsubscribe : http://ReliableAnswers.com/YG/unsub?vbra
Attachments : Not Permitted
'===========================================================
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
As usual I reply to my own question, here's my solution so far - if anyone
can think of a more elegant way........
If global_tv Is Nothing Then
tree_load tv_main
Set global_tv = tv_main
Else
tv_main.Nodes.Clear
For Each nd In global_tv.Nodes
If nd.Parent Is Nothing Then
tv_main.Nodes.Add , , nd.key, nd.Text
Else
tv_main.Nodes.Add nd.Parent.key, tvwChild, nd.key, nd.Text
End If
Next nd
End If
Regards
Nigel
-----Original Message-----
From: Bachmann, Nigel [mailto:nbachmann@...]
Sent: 06 September 2001 13:54
To: 'vbra@yahoogroups.com'
Subject: [VBra] Setting TreeView
I have a complex tree view which is on a number of forms, it takes a while
to populate so I would like to store this information and then 'set'
existing treeview controls to it. Here is a summary of my code:
Public tv as TreeView
Private sub load_form()
if tv is nothing then
load_tree(tv_main)'populates treeview on form
set tv = tv_main ' this appears to work
else
set tv_main = tv ' this falls over
end if
End sub
If I can set tv to tv_main why can't I do the reverse? Any help appreciated
Regards
Nigel
'===========================================================
Archive : http://ReliableAnswers.com/YG/msg?vbra
Files : http://ReliableAnswers.com/YG/files?vbra
Group : http://ReliableAnswers.com/YG/group?vbra
Subscribe : http://ReliableAnswers.com/YG/sub?vbra
Unsubscribe : http://ReliableAnswers.com/YG/unsub?vbra
Attachments : Not Permitted
'===========================================================
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
I have a complex tree view which is on a number of forms, it takes a while
to populate so I would like to store this information and then 'set'
existing treeview controls to it. Here is a summary of my code:
Public tv as TreeView
Private sub load_form()
if tv is nothing then
load_tree(tv_main)'populates treeview on form
set tv = tv_main ' this appears to work
else
set tv_main = tv ' this falls over
end if
End sub
If I can set tv to tv_main why can't I do the reverse? Any help appreciated
Regards
Nigel
Sorry Shawn, I know you have already got this a couple of times from
other lists, but I just wanted to post a message on your list :)
If I have some COM components written for an ASP application that
actually reside on the WEB Server and I want to move them (COM
objects, business components) to their own Application Server, how do
I do that? Is there much work involved??
How do I make a COM object into a DCOM object? Is there much coding
or is it just a configuration issue?
Thanks
Cheers
Aaron
Hi, Shawn,
Thanks for getting back to me!!!!
I'm using MSGrid, the one that comes with VB6 I'm using DAO and
Access '97 and the table is already defined, with 2 of 18 fields
(WMTR & TestLog - #'s identifying the specimens being measured) with
data already supplied.
There are 6 cbo's and 12 textboxes on the first form besides the
labels identifying the customer. The 6 cbo's each contains a list of
10 measurement instruments (laser, caliper, profilometer, etc). Six
of the 12 textboxes contain the serial numbers of those measuring
devices.
The number of columns, after the first one, in the grid is
determined by the number of textboxes (a control array) (the other 6)
used (typed in) on the first form. The column headings, typed into
the textboxes could be "Width", "Height", "Length", etc.
The data in the first column is from an array, which is
populated by a field (TestLog) in Access. The user will enter the
measurements in a cell of a columns decided by the textboxes.
I'm almost done. I just need to get the data from the cells and
the textboxes and cbo into the specific records.
Ex of the database: WMTR | TestLog | ColumnName1 | Measurement1 |
Instrument1 | SerialNumber1 -to- ColumnName6 | Measurement6 |
Instrument6 | SerialNumber6.
I have everything working, except when the program exits
(suppose to) and I go and check the appropriate database and there is
nothing there except the WMTR and TestLog. I get no error message.
The grid is working fine. I can enter the measurements into
each cell and the appropriate column headings, from the textboxes,
are there.
I haven't attempted getting the measurement into the database.
I have no idea how to get the measurement data from the cell to the
appropriate fields in the database. The other fields get there data
from the textboxes and cbo. They don't even show up.
Any suggestions would be greatly appreciated.
Thanks in advance,
Bob
--- In vbra@y..., "Shawn K. Hall" <vb@r...> wrote:
> Hi Bob,
>
> > ... how to save the data grid to a table I
> > created in MSAccess.
>
> What kind of grid?
> ADO or DAO?
> What version of Access?
> Do you have a defined table layout in Access already?
> How is the current data getting into the grid?
> What have you done already?
>
> When asking questions please provide as much detail as possible in
> order to help those who may answer provide accurate and complete
> answers. :)
>
> Regards,
>
> Shawn K. Hall
> http://ReliableAnswers.com
Hi Bob,
> ... how to save the data grid to a table I
> created in MSAccess.
What kind of grid?
ADO or DAO?
What version of Access?
Do you have a defined table layout in Access already?
How is the current data getting into the grid?
What have you done already?
When asking questions please provide as much detail as possible in
order to help those who may answer provide accurate and complete
answers. :)
Regards,
Shawn K. Hall
http://ReliableAnswers.com
Hello
I just joined this list and have a question regarding a VB .OCX
file (it is a tree view). Ultimately, the goal is to place this
into a .ASP page to be on the web. Here are the problems I am
having. This is the first VB thing I have done, so I am as basic
as you can get. I know web-development pretty well and VBScript,
so I am familiar with some concepts, but not great by any stretch.
I will need to pass one value into the .OCX file from the web page
(I am assuming this is the same regardless of if it is a web page
or another VB component), but how would I set up the code to
accept one variable passed in, and how would I set it up to pass
back two variables?
In the .OCX code, I have two functions. One is
UserControl_Initialize() which connects to the database and gets
the data and creates the nodes and child nodes, then the other is
TreeView1_NodeClick(ByVal Node As MSComctlLib.Node) which displays
the information for the node I click.
I have the .OCX file working in VB, but now I am at a loss.
Any help you could share is greatly appreciated.
Thank you
Andy
When sending a file to the Mainframe using FTP, when the file gets to
the Mainframe It gets truncated from a 254 bytes file to 80 bytes.
Every 254 bytes record creates four 80 byte records on the output file.
I need help on how to set the attributes (LRECL) of the file to 254 in
my VB code.
This is a piece of the code that transfers the file.
Private Declare Function FtpPutFile Lib "wininet.dll" Alias
"FtpPutFileA" _
(ByVal hInet As Long, ByVal lpszLocalFile As String, ByVal
lpszNewRemoteFile As String, _
ByVal dwFlags As Long, ByVal dwContext As Long) As Boolean
'Open internet session
If ComboOpenFTP(HSESSION, HINTERNET, strservername) = False Then
GoTo Exit_Mfrm_Ftp
End If
'Sends the file to the mainframe
If FtpPutFile(HSESSION, strFilenameLocal, strFilenameServerIn, _
FTP_TRANSFER_TYPE_ASCII, lngContext) = False Then
MsgBox "Ftp Put Failed. Try again."
GoTo Exit_Put_FTP
End If
I appreciate your help!
Thanks,
Dalio H. Mercado
Hi Shawn,
I tried to open a program with the "shell" command. However, after
pushing the button (which execute "shell"), the program initiated
but never really ran (I can't see anything on the screen). I think
the program might be running in the background or somewhere because
later I got a fatal message when I tried to close up my windows.
Do you know what's causing this and how to fix it?
Also, if I want to check if a file exists or not, what command
should I use?
Please help. Thanks a lot!
Jaclyn
__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/
Shawn,
--- In vbra@y..., "Shawn K. Hall" <vb@r...> wrote:
> > Whenever the forms are opened, I query up a recordset and
> > then set the datagrid.datasource property to the recordset.
> > It works fine on my machine, but on another WIN2K machine
> > I get an error (cannot initialize data bindings).
> >
> Do you have any errors before this line:
> Set DataGrid1.DataSource = rs 'fails
No
>
> Have you checked that the same versions of ADO are on both
> computers?
Yes. They are one is WIN2K Pro, mine is WIN2K Server. Both are on
SP2. The ADO version is not the same, but mdac_typ.exe will not run
on WIN2K...it says it is already installed. Both machines have MDAC
2.5
>
> I'm guessing that either the actual "open" of the recordset is
> failing due to trying to use a connection that is not actually open
> (probably because of an unavailable provider),
The open (recordset and connection) is not failing. I can access the
recordset and set values into textboxes just fine.
JED
Hi Jed,
> Whenever the forms are opened, I query up a recordset and
> then set the datagrid.datasource property to the recordset.
> It works fine on my machine, but on another WIN2K machine
> I get an error (cannot initialize data bindings).
>
> Private Sub Form_Load()
> On Error GoTo err_trap2
What is the error number/source?
Do you have any errors before this line:
Set DataGrid1.DataSource = rs 'fails
Have you checked that the same versions of ADO are on both
computers?
I'm guessing that either the actual "open" of the recordset is
failing due to trying to use a connection that is not actually open
(probably because of an unavailable provider), or that the datagrid
is a different version.
Regards,
Shawn K. Hall
http://ReliableAnswers.com
Thanks for the info. I just removed the file from the install and
that seemed to make the installation work, now I am having a problem
with the datagrid controls on the forms.
Whenever the forms are opened, I query up a recordset and then set
the datagrid.datasource property to the recordset. It works fine on
my machine, but on another WIN2K machine I get an error (cannot
initialize data bindings).
Private Sub Form_Load()
On Error GoTo err_trap2
'Get Contact History Data
Set rs = New ADODB.Recordset
With rs
.CursorType = adOpenDynamic
.LockType = adLockOptimistic
.CursorLocation = adUseClient
.ActiveConnection = mconConnection
.Source = [I put a sql statement here]
.Open
End With
rs.Sort = "Call_Date DESC"
rs.MoveLast
Set DataGrid1.DataSource = rs 'fails
I know this must be easy, but for the life of me I can't figure it
out.
JED
--- In vbra@y..., "Shawn K. Hall" <vb@r...> wrote:
> Come on now Jed,
>
> Did you really have to send this to three groups? :(
>
> > package and deployment ... error registering
> > MSSTDFMT.DLL.
>
> Have you considered not including it in your package, or if you must
> include it, use one of the redistribution cabs from MS instead?
> http://support.microsoft.com/support/kb/articles/Q193/3/66.ASP
>
> Other possibly relevent material:
> http://support.microsoft.com/support/kb/articles/Q178/3/54.ASP
> http://support.microsoft.com/support/kb/articles/Q223/1/27.ASP
> http://support.microsoft.com/support/kb/articles/Q189/7/43.ASP
>
> Regards,
>
> Shawn K. Hall
> http://ReliableAnswers.com
OK - I'm trying something new, and I'm really sorry to burden you with it ;)
but I have a development server on which resides SQL Server. Networks have
kicked off MTS for me so that I can experiment with publishing com's on it.
My concern is that when I've finished developing a project how do I transfer
all this stuff to the live server? I can use DTS in SQL Server so that side
of things is ok but I don't really know what to do with the dll's - do I
just move them to the new server & then just recompile my VB front end? Or
have I got, completely the wrong end of the stick?
Regards
Nigel
I am a veteran at this, but I have never encountered this one
before. Any insight would be greatly appreciated.
The Problem:
I used package and deployment wizard to create a single-cab install
for my application. Since I used the format function, it
automatically included the MSSTDFMT.DLL file. The install runs fine
on my machine (Win2000 Server SP1), but when I try to install it on
another server (WIN2000 Server SP1) I get an error registering
MSSTDFMT.DLL. The rest of the application installs fine.
What I have tried:
-I have tried another WIN2000 server with the same results.
-I have tried using Regsvr32.exe to unregister (succeeds) and re-
register (fails) the MSSTDFMT.DLL.
-Microsoft knowledge base is devoid of info on this
Any help would be greatly appreciated!
JED
--- In vbra@y..., "Shawn K. Hall" <vb@r...> wrote:
Hi Shawn.
What you suggest for the first problem is a possible way arround.
Actually a clever idea, although I must first test if it is usefull
for the specific purpose - some graphic manipulations.
I already know about the Edanmo's sample. It requires adding of his
typelib, which I would rather avoid. Still, I am already decided to
go through his code ( a lot of interfaces there) and use it, if I
cannot find any other efficient solution.
Thank you very much for your help.
Sincerely,
Vaclav
> Hi Vaclav,
>
> > I am attempting slightly customise Microsoft WebBrowser
> > control. I got the easy stuff working (handles of its
> > windows etc.) but most problems resist. Specifically:
> >
> > 1. When the control navigates to a web page with a big
> > picture, it shows scrollbars. I need to resize the
> > control so its right margin will match the right margin
> > of the picture and the scrollbar disappear. In fact I
> > need to know the scollbars maximum. It is somehow
> > strange, since the GetScrollInfo fails with either of
> > the three WebBrowser sub-windows I was able to find.
> > This suggests that it has non-standart scrollbars. But
> > the control responds to WM_HScroll SendMessage. So I
> > am rather confused.
>
> You can wrap the image in an HTML document and have it display that
> way. Set the border of the body to zero. Here's a html wrapper you
> might use:
>
> <html>
> <body
> scroll="no"
> border="0"
> margin="0"
> style="border:0;margin:0;cursor:default;"
> onload="focus();"
> ondragstart="event.returnValue=false;"
> onselectstart="event.returnValue=false;"
> ncontextmenu="event.returnValue=false;"
>
> onkeydown="if(event.keyCode==27){try{window.opener.focus();}catch(x)
> {};setTimeout('window.close();',10);}event.returnValue=false;" >
> <img src="yourpicture.jpg" border="0" />
> </body>
> </html>
>
> > 2. I need the browser to find and highlight a specific
> > word in a html page without prompting user. I guess it
> > can be done by using Web1.ExecWB OLECMDID_FIND,
> > OLECMDEXECOPT_DONTPROMPTUSER, in, out but i do not
> > know how to pass correct in and out values to find
> > certain string.
>
> I think for the search to function correctly you've got to let the
> user supply the keyword first. I wouldn't bother with that though.
> There's a demo of manipulating the content of a webbrowser control
> located on Edanmo's VB Page. I believe it's in the tips area.
> http://www.domaindlx.com/e_morcillo/default.asp
>
> Regards,
>
> Shawn K. Hall
> http://ReliableAnswers.com
Hi Vaclav,
> I am attempting slightly customise Microsoft WebBrowser
> control. I got the easy stuff working (handles of its
> windows etc.) but most problems resist. Specifically:
>
> 1. When the control navigates to a web page with a big
> picture, it shows scrollbars. I need to resize the
> control so its right margin will match the right margin
> of the picture and the scrollbar disappear. In fact I
> need to know the scollbars maximum. It is somehow
> strange, since the GetScrollInfo fails with either of
> the three WebBrowser sub-windows I was able to find.
> This suggests that it has non-standart scrollbars. But
> the control responds to WM_HScroll SendMessage. So I
> am rather confused.
You can wrap the image in an HTML document and have it display that
way. Set the border of the body to zero. Here's a html wrapper you
might use:
<html>
<body
scroll="no"
border="0"
margin="0"
style="border:0;margin:0;cursor:default;"
onload="focus();"
ondragstart="event.returnValue=false;"
onselectstart="event.returnValue=false;"
ncontextmenu="event.returnValue=false;"
onkeydown="if(event.keyCode==27){try{window.opener.focus();}catch(x)
{};setTimeout('window.close();',10);}event.returnValue=false;" >
<img src="yourpicture.jpg" border="0" />
</body>
</html>
> 2. I need the browser to find and highlight a specific
> word in a html page without prompting user. I guess it
> can be done by using Web1.ExecWB OLECMDID_FIND,
> OLECMDEXECOPT_DONTPROMPTUSER, in, out but i do not
> know how to pass correct in and out values to find
> certain string.
I think for the search to function correctly you've got to let the
user supply the keyword first. I wouldn't bother with that though.
There's a demo of manipulating the content of a webbrowser control
located on Edanmo's VB Page. I believe it's in the tips area.
http://www.domaindlx.com/e_morcillo/default.asp
Regards,
Shawn K. Hall
http://ReliableAnswers.com
Hi there.
I am attempting slightly customise Microsoft WebBrowser control. I
got the easy stuff working (handles of its windows etc.) but most
problems resist. Specifically:
1. When the control navigates to a web page with a big picture, it
shows scrollbars. I need to resize the control so its right margin
will match the right margin of the picture and the scrollbar
disappear. In fact I need to know the scollbars maximum. It is
somehow strange, since the GetScrollInfo fails with either of the
three WebBrowser sub-windows I was able to find. This suggests that
it has non-standart scrollbars. But the control responds to
WM_HScroll SendMessage. So I am rather confused.
2. I need the browser to find and highlight a specific word in a html
page without prompting user. I guess it can be done by using
Web1.ExecWB OLECMDID_FIND, OLECMDEXECOPT_DONTPROMPTUSER, in, out but
i do not know how to pass correct in and out values to find certain
string.
I just hope that somebody there may be able to give me some advices.
Thank you.
Vaclav
Hi Marcos,
> You recently wrote on one of your feeds to another group:
>
> "...OTOH, if you're not using forms you might consider
> running a state loop checking to see if the main.exe is
> deleteable and replacing it after it is successfully
> removed..."
>
> What should I use to check if a file is deleteable?
> I assume it is not through error trapping.
You can do it several ways.
Something as simple as this could work:
(warning - vaporcode)
'// ============================================
Function ReallyKillFile(sFilename$)
On Error Resume Next
Dim dCancel as Date
' set a timeout value
dCancel = DateAdd("s", 10, Now)
While (Dir(sFilename)<>"") And (dCancel > Now)
Kill sFileName
Wend
ReallyKillFile = CBool(Dir(sFilename) = "")
End Function
'// ============================================
You could also use a more elaborate procedure in order to explicitly
trap for the error message (this is a good idea in order to prevent
read-only media errors).
I assume from your message that you would like to avoid raising an
error. Why?
You don't have to pass it up the chain, and without the ability to
trap for errors we would not be able to accomplish many of the
things we can within our applications. I think you'll find that most
developers use error trapping not as a "last resort" but as a
functional necessity for programming. Errors occur - and if you can
code for them correctly in the first place your code will be more
stable in the long run. Errors are an excellent way of determining
state of an application as well. And they are excellent sources for
events.
I'm dumbfounded when I see programmers trying diligently to "avoid
errors" by avoiding error trapping and error management, as though
that were a means of avoiding *coding* errors within their projects.
> Thanks a lot,
You're welcome.
> -Congrats for your new group and for your moderator
> "degree" in vbhelp
Thanks! :)
Regards,
Shawn K. Hall
http://ReliableAnswers.com
Hi, there
Shawn,
You recently wrote on one of your feeds to another group:
"...OTOH, if you're not using forms you might consider running a state
loop checking to see if the main.exe is deleteable and replacing it
after it is successfully removed..."
What should I use to check if a file is deleteable? I assume it is not
through error trapping.
Thanks a lot,
-Congrats for your new group and for your moderator "degree" in vbhelp
:)
Marcos
[Non-text portions of this message have been removed]