Results 1 to 30 of 30

Thread: [RESOLVED] Select all/Find/Open with?

Hybrid View

  1. #1
    No place like 127.0.0.1 eyeRmonkey's Avatar
    Join Date
    Jul 2005
    Location
    Blissful Oblivion
    Posts
    2,306

    Re: Select all/Find/Open with?

    Quote Originally Posted by Hack
    If you are creating a Notepad like program why are you opening a text file for Binary Access Read?

    If you are going to read a text file into a textbox you should be opening the file for Input.
    Opening a text file for binary is just another way of opening things. It tends to be faster. You get the same result.
    Visual Studio 2005 Professional Edition (.NET Framework 2.0)
    ~ VB .NET Links: Visual Basic 6 to .NET Function Equivalents (Thread) | Refactor! (White Paper) | Easy Control for Wizard Forms | Making A Proper UI For WinForms | Graphics & GDI+ Tutorial | Websites For Free Icons
    ~ QUOTE: Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. -Rich Cook

    ~ eyeRmonkey.com

  2. #2
    Old Member moeur's Avatar
    Join Date
    Nov 2004
    Location
    Wait'n for Free Stuff
    Posts
    2,712

    Re: Select all/Find/Open with?

    To get openwith to work you have to load the file that is in Command$ when the program starts. For example:
    VB Code:
    1. Private Sub Form_Load()
    2.     Dim strBuffer       As String
    3.     Dim intDemoFileNbr  As Integer
    4.     Dim strFileToOpen   As String
    5.     If Len(Command$) > 0 Then
    6.         intDemoFileNbr = FreeFile
    7.         Open Command$ For Binary Access Read As #intDemoFileNbr
    8.         strBuffer = Input(LOF(intDemoFileNbr), intDemoFileNbr)
    9.         txtTestFile.Text = strBuffer
    10.         Close #intDemoFileNbr
    11.         mstrLastDir = Left$(strFileToOpen, InStrRev(strFileToOpen, "\") - 1)
    12.     End If
    13. End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width