Results 1 to 3 of 3

Thread: Using DDE with Visual basic

  1. #1

    Thread Starter
    Member docHoliday's Avatar
    Join Date
    Sep 1999
    Location
    Stamford, CT, USA
    Posts
    48

    Post

    I'm not 100% sure if DDE is the method, but I'd like to pass file information to my small text editor app so that when you double click on a text file, it launches the app and opens the file. Thus far I have been able to make my app the deafult text editing progam, but failed tring to get the file opening functionality to work?

    Anyone have any suggestions or know of an API to use to accomplish this?

  2. #2
    old fart Frans C's Avatar
    Join Date
    Oct 1999
    Location
    the Netherlands
    Posts
    2,926

    Post

    If you have got windows to launch your app when double clicking on the file, all you have to do is open the file passed to your app in the commandline. Something like this:

    Code:
    ption Explicit
    
    Private Sub Form_Load()
    Dim hFile As Integer
    Dim Text As String
        If Len(Command) > 0 Then
            If Dir(Command) <> "" Then
                hFile = FreeFile
                Open Command For Input As #hFile
                Text = Input(LOF(hFile), #hFile)
                Close #hFile
                Text1.Text = Text
            End If
        End If
    End Sub

  3. #3

    Thread Starter
    Member docHoliday's Avatar
    Join Date
    Sep 1999
    Location
    Stamford, CT, USA
    Posts
    48

    Post

    Thanks a lot. I'll give it a try.

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