Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Can one program native (Win32) code in Visual Basic .NET?

Posted on 2006-07-06
4
Medium Priority
?
350 Views
Last Modified: 2010-08-05
Hello,

I do not have much experience with .NET, but I do program in VB 6.  Can I still use Visual Basic .NET to program for Win32 and not the .NET or CLR environments?

If so, how?  I will be using Visual Studio 2003.

Thanks,

Todd
0
Comment
Question by:toddsab
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 52

Assisted Solution

by:Carl Tawn
Carl Tawn earned 800 total points
ID: 17054852
Simple answer: No.

You can with VC++ but not VB.Net. You can access the Win32 API's but your app will still be dependent on the .Net framework.
0
 
LVL 64

Accepted Solution

by:
Fernando Soto earned 1200 total points
ID: 17055654
Hi toddsab;

There is a tool which will turn a VB .Net assembly into a Native Image called NGen.exe. Even though you turn it into a Native Image the assembly, IL code is still needed. Also; A native image is a file containing compiled processor-specific machine code. Note that the native image that Ngen.exe generates cannot be shared across Application Domains. Therefore, you cannot use Ngen.exe in application scenarios, such as ASP.NET, that require assemblies to be shared across application domains. The application using Native Image will load faster but also true is that certain function may run a little slower.

The tool may be found in c:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\ngen.exe for version 1.1 of the framework and c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\ngen.exe for version 2.0 of the framework.

Here is a link to the Microsoft Documentation. Read the pros and cons of using it. http://msdn2.microsoft.com/en-us/library/6t9t5wcf.aspx


Fernando
0
 

Author Comment

by:toddsab
ID: 17058045
Thank you for your answers, I learned a lot.

I want to learn .NET and provide a solution using .NET, but at the same time I find it awkward to have to impose to users that they load the framework onto their computer.  It just gives me an uneasy feeling.  Am I wrong?

I guess I would be more comfortable if I knew a good portion of Windows users had the framework installed on their systems.

Regards,

Todd
0
 
LVL 52

Expert Comment

by:Carl Tawn
ID: 17058311
A good proportion probably have, version 1.1 at least.

.Net framework is no big deal, its not different to having to install the VB6 runtime or the C runtime for MFC.
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question