Results 1 to 4 of 4

Thread: Set to Deafault, loads the program but wont load the file

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2008
    Posts
    13

    Question Set to Deafault, loads the program but wont load the file

    I made a word proccessor much like notepad, however when i set my wordproccesser.exe as default for txt files or rtf's and i try to open that file by double clicking, it doesnt load. I use vb 6.0 can someone help

  2. #2
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: Set to Deafault, loads the program but wont load the file

    How exactly did you set/associate your exe to txt/rtf files? Maybe that was not done correctly? And what doesn't load? The application? Or does the app load, but the document doesn't display in it?
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  3. #3

    Thread Starter
    New Member
    Join Date
    Oct 2008
    Posts
    13

    Re: Set to Deafault, loads the program but wont load the file

    I made the exe using vb then i right clicked a txt file i located on my desktop and click open with... browse then my exe. The program opens perfectly but doesnt load the txt file i just tried to open

  4. #4
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: Set to Deafault, loads the program but wont load the file

    In your Form_Load event process a VB variabled named Command$. That variable if not a null string (i.e., <> "") will be the file that was sent. Therefore, the code should look something like:
    Code:
    Private Sub Form_Load()
       .... 
       If Command$<>vbNullString Then 
          ' load Command$ into your editor.  Command$ is full path & filename
       Else 
          ' user opened your app directly without any associated file
       End If
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

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