how to convert program from VB 6.0 to Vb 2010

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • patty
    New Member
    • Apr 2013
    • 3

    #1

    how to convert program from VB 6.0 to Vb 2010

    I am having problem working in VB 2010. I used to write program in VB 6.0, things seems to be different in 2010.
    anyone can help in quick way learning this environment. <stdio.h> is not working, I dont know how to see output in Console application. it keeps giving me error on opening the file " name.cpp"
    thanks
  • weaknessforcats
    Recognized Expert Expert
    • Mar 2007
    • 9214

    #2
    Maybe you could post the error and also some of your C++ code that does the console display.

    Comment

    • patty
      New Member
      • Apr 2013
      • 3

      #3
      Code:
      #include <stdio.h>
      #include <string.h>
      
      main ()
      {
      	char s1[15];
      	printf(" enter the name of the Author:       ");
      	scanf("%s", s1);
      	/*gets(s1);*/
      	
      	while (strcmp( s1, "John_Doe"))
      	{
      		if (!strcmp(s1, "kennedy"))
      		{	printf ( " The  books for the Authors named: %s is as follows:\n\n", s1);
      
      			printf("  1- Google pocket book\n");
      			printf("  2- Information Science\n");
      		}
      		 if (!strcmp (s1, "Sekaran"))
      		 {
      			 
      			 printf ( " The  books for the Authors named: %s is as follows:\n\n", s1);
      
      			 printf ("  1- Research Methods for bussiness\n");
              
      		}
      
      		else
      		{ printf(" The specified Author has no books listed\n\n");
      		  printf("Enter the name of another Author:   ");
      		}
      		 
      		scanf("%s", s1);
      
      	}
      
      }
      this is an example of a simple code, which runs through VB6.0 just fine, but now I want to start using Vb2010,and I am having problem seeing the output, or sometimes even building the program.by the way, I am making console application.
      Last edited by weaknessforcats; Apr 30 '13, 02:26 PM.

      Comment

      • weaknessforcats
        Recognized Expert Expert
        • Mar 2007
        • 9214

        #4
        It's something other than the code you have posted. main() should return an int but after making that change your posted code compiles OK using Visual Studio.NET 2008.

        What errors are you getting?

        Comment

        • patty
          New Member
          • Apr 2013
          • 3

          #5
          thanks for your help, you were right, I figured it out. the problem was due to the software itself, although "int" seems to be necessary in 2010 version where in 6.0 I always leave it out. it is working ok in 2010 now. again thanks for your comments.
          also, should I really know anything about .NET environment to work on VS 2010? sorry about the title, I meant VS not VB because I was working on C programming not VB. but, I used to work alot on programming Vb, C, Pascal C++, forTRan. lisp ...for many years, before .NET. I have not done so several years now. anything I should learn about .NET?

          Comment

          • weaknessforcats
            Recognized Expert Expert
            • Mar 2007
            • 9214

            #6
            .NET is the Microsoft framework that runs programs compiled as Microsoft Intermediate Language (MSIL) files. These files are read by the "framework" and cmpiled to machine code on the fly at run time. This allows any programming language t be used to write framework code if that language has an MSIL compiler. Hence you have C++.NET, VB.NET, etc..

            The C# language is the MSIL language of choice. Here is where all the action is today.

            Comment

            Working...