Results 1 to 10 of 10

Thread: "My way" of using VB6 don't work on VB.net

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2007
    Posts
    544

    "My way" of using VB6 don't work on VB.net

    I have this great way to use VB6

    I treated my project like a .exe file.

    Say I want to work on c:\work directory.

    I just save as the .vbp file to c:\work directory

    All the other files (.frm,.bas,.cls) files are in a special directory called library

    ALL of my .vbp files, in c:\work1, c:\work2, c:\work3 refer to that one same directory.

    How can I do that in vb.net?

    Why this is important? Bugs always happen all the time. If I just run .exe file, when bug happen, I cannot do a thing. However, if I run the project file and run the program in debug mode, when bug happen I can figure out what happen.
    Last edited by teguh123; Oct 19th, 2009 at 10:35 PM.

  2. #2
    Wait... what? weirddemon's Avatar
    Join Date
    Jan 2009
    Location
    USA
    Posts
    3,828

    Re: "My way" of using VB6 don't work on VB.net

    I am thoroughly confused about what you want. It could just be me, but I'm not sure.

    If you want to change the directory of your project, just move the project folder to where you want it.

    The executable has nothing to do with the development part of your project, so you shouldn't worry about it until release time.

    Why this is important? Bugs always happen all the time. If I just run .exe file, when bug happen, I cannot do a thing. However, if I run the project file and run the program in debug mode, when bug happen I can figure out what happen.
    Are you talking about debugging errors? Typically you'll always want to run the app in debug mode to figure out what the issue is because VS will point to the error and give you an explanation.

    Again, I'm not sure if any of this applies, because I'm not entirely sure I understand what you're asking.
    CodeBank contributions: Process Manager, Temp File Cleaner

    Quote Originally Posted by SJWhiteley
    "game trainer" is the same as calling the act of robbing a bank "wealth redistribution"....

  3. #3
    Super Moderator RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,711

    Re: "My way" of using VB6 don't work on VB.net

    Are you trying to create a centralized folder with all your "library" code which you want to reference from any project/solution you create?
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  4. #4
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,335

    Re: "My way" of using VB6 don't work on VB.net

    Quote Originally Posted by weirddemon View Post
    I am thoroughly confused about what you want. It could just be me, but I'm not sure.
    It is not just you...I'm confused here as well.

    What is it about how .NET works that you don't like?

  5. #5
    ASP.NET Moderator gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,966

    Re: "My way" of using VB6 don't work on VB.net

    Quote Originally Posted by Hack View Post
    It is not just you...I'm confused here as well.

    What is it about how .NET works that you don't like?
    Me three.

    Very confused!!

    Can you perhaps provide some more information, perhaps with the aid of screenshots, or actual examples that will help better illustrate the problem that you are having?

    Gary

  6. #6

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2007
    Posts
    544

    Re: "My way" of using VB6 don't work on VB.net

    Quote Originally Posted by RobDog888 View Post
    Are you trying to create a centralized folder with all your "library" code which you want to reference from any project/solution you create?
    YES

    In vb6 I just put the .vbp file in the same folder where the .exe file should be.

    Say I want a program that read a file from "current working" directory and display the content in a text box. The location of the .exe file will be in the place where the directory is right?

    Now in vb6. I just put the .vbp file on the same directory (I can't just copy, need to open another .vbp file and then save as project). Then I open the .vbp file press run and it's equivalent with running the .exe file

    Except that of course I have the whole power of the debugger.

  7. #7
    Hyperactive Member
    Join Date
    Mar 2001
    Posts
    485

    Re: "My way" of using VB6 don't work on VB.net

    You can consider manually editing the .SLN or .VBPROJ file, though I'm not sure that's the best way to get it done.

    Odd indeed.

  8. #8

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2007
    Posts
    544

    Re: "My way" of using VB6 don't work on VB.net

    Actually I did it. There is another way to do it too, namely make a new project and then add all the necessary files and references. Unlike in vb6 you can't save as project.

    Another bummer. Also you can't edit and continue using linked source. Sucks. Why Microsoft? Why?

  9. #9
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    35,066

    Re: "My way" of using VB6 don't work on VB.net

    If I understand you right, one of the problems you had was that whenever you add an existing item into a new .NET project it actually copied the file into that project, where you wanted to keep all those items together in one folder. There was a solution to this, though I totally forget what it was, but since I may not even be understanding you correctly, it probably doesn't matter.

    The reason for this change is obvious enough. They wanted each project to stand alone. If you are the sole developer, you have organizational options that don't exist for teams. You generally don't have to worry about somebody else tampering with your file and breaking a program that was working.

    Of course, you could also actually make a library, which you could then link in. You can certainly step into that code, but, as you noted, you can't edit and continue for the simple reason that it would be absurd to do so. MS was trying to make the system more stable for team use, which means that people can freely tinker with the code in their project, but not freely tinker with the code that is shared between projects. It's not bad, just different.
    My usual boring signature: Nothing

  10. #10
    Fanatic Member
    Join Date
    Aug 2006
    Location
    In my head
    Posts
    913

    Re: "My way" of using VB6 don't work on VB.net

    Here is something else.....

    If there is an external file, dll, image, etc that you want to keep with your project at all times, then right click on your solution name and click on add --> Existing Item. Find the file you want and add it to your list. Then in solution explorer, right click on the file and then choose properties. Under properties there is an item that is called "Copy to Output Directory" with 3 options: Do Not Copy, Copy Always and Copy if Newer. This guarantees that the file will stay with your project. This is particularly useful if files are always shifting around or you make specific changes to files for various projects because you will always have the correct ones with your project.


    D
    Platforms of choice: Visual Studio 2005/2008 Professional : Visual Studio 2010 Enterprise : PHP - Notepad++/WAMP

    Please Rate If I helped you.
    Please remember to mark threads as closed if your issue has been resolved.

    Reserved Words in Access | Connection Strings

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