Search the web
Sign In
New User? Sign Up
vbra · Visual Basic - Reliable Answers
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Want your group to be featured on the Yahoo! Groups website? Add a group photo to Flickr.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Messages 1 - 32 of 42   Newest  |  < Newer  |  Older >  |  Oldest
Messages: Show Message Summaries   (Group by Topic) Sort by Date v  
#32 From: "Bachmann, Nigel" <nbachmann@...>
Date: Thu Sep 6, 2001 12:54 pm
Subject: Setting TreeView
nbachmann@...
Send Email Send Email
 
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

#31 From: acunnington@...
Date: Sun Aug 26, 2001 11:13 am
Subject: COM to DCOM
acunnington@...
Send Email Send Email
 
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

#30 From: vb_prog_wb@...
Date: Sat Aug 25, 2001 1:00 am
Subject: Re: Saving Grid Data To MSAccess
vb_prog_wb@...
Send Email Send Email
 
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

#29 From: "Shawn K. Hall" <vb@...>
Date: Fri Aug 24, 2001 7:03 am
Subject: RE: [VBra] Saving Grid Data To MSAccess
vb@...
Send Email Send Email
 
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

#27 From: "kamills" <kamills@...>
Date: Wed Aug 15, 2001 7:24 pm
Subject: VB Ocx file
kamills@...
Send Email Send Email
 
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

#26 From: Dalio.mercado@...
Date: Wed Aug 15, 2001 3:57 pm
Subject: File Transfer Protocol
Dalio.mercado@...
Send Email Send Email
 
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

#25 From: Jaclyn <jliuklein@...>
Date: Fri Aug 10, 2001 3:51 pm
Subject: RE: [VBra] How do I open files by pressing a button?
jliuklein@...
Send Email Send Email
 
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/

#24 From: djedziniak@...
Date: Thu Aug 2, 2001 3:53 pm
Subject: Re: Installation Help!
djedziniak@...
Send Email Send Email
 
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

#23 From: "Shawn K. Hall" <vb@...>
Date: Wed Aug 1, 2001 6:21 pm
Subject: RE: [VBra] Re: Installation Help!
vb@...
Send Email Send Email
 
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

#22 From: djedziniak@...
Date: Wed Aug 1, 2001 3:38 pm
Subject: Re: Installation Help!
djedziniak@...
Send Email Send Email
 
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

#21 From: djedziniak@...
Date: Wed Aug 1, 2001 3:31 pm
Subject: Re: Installation Help!
djedziniak@...
Send Email Send Email
 
Sorry...freaked out.

I think the pressure is getting to me.

(Actually I sent it to 10 groups, I guess you are subscribed to 3 of
them).

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

#20 From: "Bachmann, Nigel" <nbachmann@...>
Date: Mon Jul 30, 2001 4:17 pm
Subject: dll's, MTS, SQL Server and all that stuff ;)
nbachmann@...
Send Email Send Email
 
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

#19 From: "Shawn K. Hall" <vb@...>
Date: Fri Jul 27, 2001 7:17 pm
Subject: RE: [VBra] Installation Help!
vb@...
Send Email Send Email
 
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

#18 From: djedziniak@...
Date: Fri Jul 27, 2001 1:50 pm
Subject: Installation Help!!
djedziniak@...
Send Email Send Email
 
I'm begging, Shawn.  This is making me look like an idiot!

JED

#17 From: djedziniak@...
Date: Fri Jul 27, 2001 1:26 pm
Subject: Installation Help!
djedziniak@...
Send Email Send Email
 
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

#16 From: vaclav_mach@...
Date: Fri Jul 27, 2001 8:41 am
Subject: Re: webbrowser control
vaclav_mach@...
Send Email Send Email
 
--- 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

#14 From: "Shawn K. Hall" <vb@...>
Date: Thu Jul 26, 2001 7:39 pm
Subject: RE: [VBra] webbrowser control
vb@...
Send Email Send Email
 
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

#13 From: vaclav_mach@...
Date: Thu Jul 26, 2001 8:58 am
Subject: webbrowser control
vaclav_mach@...
Send Email Send Email
 
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

#12 From: "Shawn K. Hall" <vb@...>
Date: Thu Jul 26, 2001 6:43 am
Subject: RE: [VBra] Querying file state
vb@...
Send Email Send Email
 
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

#11 From: "Marcos" <astillax@...>
Date: Thu Jul 26, 2001 12:07 am
Subject: Querying file state
astillax@...
Send Email Send Email
 
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]

#10 From: "Shawn K. Hall" <vb@...>
Date: Wed Jul 25, 2001 12:23 am
Subject: RE: [VBra] Re: Package & Deployment Wizard
vb@...
Send Email Send Email
 
Hi Nigel,

> Once again I'm in your debt
> - hope I can repay you some day

Just keep me in mind if you ever hear of any programming contracts.
I'm always looking for more work.

Thanks,

Shawn K. Hall
http://ReliableAnswers.com/Profile.asp

#9 From: Jaclyn <jliuklein@...>
Date: Tue Jul 24, 2001 9:59 pm
Subject: RE: [VBra] How do I open files by pressing a button?
jliuklein@...
Send Email Send Email
 
Shawn,

Wow!  I didn't realize it requires so much effort.

Thanks for reminding me about the "default player" issue, I really
didn't think about that.  I'll study the code you gave me and put
some more thought into it.

Thank you so much for your kind help!  ^_^


Jaclyn


--- "Shawn K. Hall" <vb@...> wrote:
> Hi Jaclyn,
>
> > How do I open a quicktime movie (mymovie.mov) by pressing
> > a button? Can I use the Shell function or is there
> > something else I should use?
>
> You're making some assumptions that could be dangerous. Though
> Quicktime is the "typical" viewer for quicktime mov files, it's
> possible the users will either 1) not have quicktime installed or 2)
> have a different application registered as their "mov" player.
>
> You should use the ShellExecute API in order to open a file using
> its default application on the clients system when that option does
> not interfere with how your application must operate (for example,
> if your app requires IE in order to process an ActiveX).
>
> Here's a wrapper I use for ShellExecute:
> '// ========================================================
> Option Explicit
> '[Declares]
>   Private Declare Function ShellExecute _
>     Lib "shell32.dll" _
>     Alias "ShellExecuteA" ( _
>       ByVal hwnd As Long, _
>       ByVal lpOperation As String, _
>       ByVal lpFile As String, _
>       ByVal lpParameters As String, _
>       ByVal lpDirectory As String, _
>       ByVal nShowCmd As Long) _
>         As Long
> '[Constants]
>  'values to plug into the nShowCmd param for ShellExecute
>   Private Const SW_SHOWNORMAL = 1
> '  Private Const SW_SHOWDEFAULT = 10
> '  Private Const SW_SHOWMAXIMIZED = 3
> '  Private Const SW_SHOWMINIMIZED = 2
> '  Private Const SW_SHOWMINNOACTIVE = 7
> '  Private Const SW_SHOWNA = 8
> '  Private Const SW_SHOWNOACTIVATE = 4
>
> '[Code]
>   '*********************************************************
>   ' Sub FOpen
>   ' Inputs       : ByVal sFile$ = File to open
>   ' Returns      : Long = Result of ShellEx call
>   ' Description  : Opens files with their associated app
>   ' Samples      : FOpen "C:\Windows\desktop\myfile.xls"
>   '*********************************************************
>   Public Function FOpen&(ByVal sFile$)
>     FOpen = ShellExecute(0&, "open", sFile, "", "", SW_SHOWNORMAL)
>   End Function
> '// ========================================================
>
> To open the mov file you'd just pass the path to FOpen:
>   FOpen app.path & "\myfile.mov"
>
>
> So what do you do if the user doesn't have a mov association? That
> could be a problem right?
> Yeah. It could.
>
> But you can test for it using the FindExecutable API. It'll tell you
> if there is an application bound to the app or not.
>
> Regards,
>
> Shawn K. Hall
> http://ReliableAnswers.com
>
>
>


__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/

#8 From: "Shawn K. Hall" <vb@...>
Date: Tue Jul 24, 2001 7:08 pm
Subject: RE: [VBra] How do I open files by pressing a button?
vb@...
Send Email Send Email
 
Hi Jaclyn,

> How do I open a quicktime movie (mymovie.mov) by pressing
> a button? Can I use the Shell function or is there
> something else I should use?

You're making some assumptions that could be dangerous. Though
Quicktime is the "typical" viewer for quicktime mov files, it's
possible the users will either 1) not have quicktime installed or 2)
have a different application registered as their "mov" player.

You should use the ShellExecute API in order to open a file using
its default application on the clients system when that option does
not interfere with how your application must operate (for example,
if your app requires IE in order to process an ActiveX).

Here's a wrapper I use for ShellExecute:
'// ========================================================
Option Explicit
'[Declares]
   Private Declare Function ShellExecute _
     Lib "shell32.dll" _
     Alias "ShellExecuteA" ( _
       ByVal hwnd As Long, _
       ByVal lpOperation As String, _
       ByVal lpFile As String, _
       ByVal lpParameters As String, _
       ByVal lpDirectory As String, _
       ByVal nShowCmd As Long) _
         As Long
'[Constants]
  'values to plug into the nShowCmd param for ShellExecute
   Private Const SW_SHOWNORMAL = 1
'  Private Const SW_SHOWDEFAULT = 10
'  Private Const SW_SHOWMAXIMIZED = 3
'  Private Const SW_SHOWMINIMIZED = 2
'  Private Const SW_SHOWMINNOACTIVE = 7
'  Private Const SW_SHOWNA = 8
'  Private Const SW_SHOWNOACTIVATE = 4

'[Code]
   '*********************************************************
   ' Sub FOpen
   ' Inputs       : ByVal sFile$ = File to open
   ' Returns      : Long = Result of ShellEx call
   ' Description  : Opens files with their associated app
   ' Samples      : FOpen "C:\Windows\desktop\myfile.xls"
   '*********************************************************
   Public Function FOpen&(ByVal sFile$)
     FOpen = ShellExecute(0&, "open", sFile, "", "", SW_SHOWNORMAL)
   End Function
'// ========================================================

To open the mov file you'd just pass the path to FOpen:
   FOpen app.path & "\myfile.mov"


So what do you do if the user doesn't have a mov association? That
could be a problem right?
Yeah. It could.

But you can test for it using the FindExecutable API. It'll tell you
if there is an application bound to the app or not.

Regards,

Shawn K. Hall
http://ReliableAnswers.com

#7 From: jliuklein@...
Date: Tue Jul 24, 2001 5:34 pm
Subject: How to open files by pressing a button?
jliuklein@...
Send Email Send Email
 
Hi,

This may be a very easy question for most of you, but please help.
How do I open a quicktime movie (mymovie.mov) by pressing a button?
Can I use the Shell function or is there something else I should use?

Thanks a lot!


Jaclyn

#6 From: jliuklein@...
Date: Tue Jul 24, 2001 5:31 pm
Subject: How do I open files by pressing a button?
jliuklein@...
Send Email Send Email
 
Hi,

This may be a very easy question for most of you, but please help.
How do I open a quicktime movie (mymovie.mov) by pressing a button?
Can I use the Shell function or is there something else I should use?

Thanks a lot!


Jaclyn

#5 From: nbachmann@...
Date: Tue Jul 24, 2001 12:59 pm
Subject: Re: Package & Deployment Wizard
nbachmann@...
Send Email Send Email
 
Once again I'm in your debt - hope I can repay you some day - N

--- In vbra@y..., "Shawn K. Hall" <vb@r...> wrote:
> Hi Nigel,
>
>
> > C:\WINNT\System32\msvcrt.dll
> >
> > The destination file is in-use. Please ensure all other
> > applications are closed.
>
> This should do you:
> http://support.microsoft.com/support/kb/articles/Q216/3/68.ASP
>
> Regards,
>
> Shawn K. Hall
> http://ReliableAnswers.com

#4 From: "Shawn K. Hall" <vb@...>
Date: Tue Jul 24, 2001 3:48 am
Subject: RE: [VBra] Package & Deployment Wizard
vb@...
Send Email Send Email
 
Hi Nigel,


> C:\WINNT\System32\msvcrt.dll
>
> The destination file is in-use. Please ensure all other
> applications are closed.

This should do you:
http://support.microsoft.com/support/kb/articles/Q216/3/68.ASP

Regards,

Shawn K. Hall
http://ReliableAnswers.com

#3 From: nbachmann@...
Date: Mon Jul 23, 2001 1:50 pm
Subject: Package & Deployment Wizard
nbachmann@...
Send Email Send Email
 
Hi - a coleague has come to me with the following problem:

Having used the Package & Deployment Wizard to create a set-up
routine the following error occurs during set-up.

C:\WINNT\System32\msvcrt.dll

The destination file is in-use. Please ensure all other applications
are closed.


all other applications are closed & I'm sure I've run into this
before but can't for the life of me remember the fix.

Hope this becomes a succesful forum

Regards - Nigel

#2 From: "Shawn K. Hall" <vb@...>
Date: Fri Jul 20, 2001 7:36 pm
Subject: RE: [VBra] WOW
vb@...
Send Email Send Email
 
> Am I, like, the first person to post to this one?
> Coooool.  I have never been message #1 before

Congratulations Jed! You win!
Uh, you're prize is to recruit one thousand members by 5pm. <g>

Regards,

Shawn K. Hall
http://ReliableAnswers.com

#1 From: djedziniak@...
Date: Fri Jul 20, 2001 1:03 pm
Subject: WOW
djedziniak@...
Send Email Send Email
 
Am I, like, the first person to post to this one?

Coooool.  I have never been message #1 before
;-)

JED

Messages 1 - 32 of 42   Newest  |  < Newer  |  Older >  |  Oldest
Advanced
Add to My Yahoo!      XML What's This?

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help