Solved

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

Posted on 2006-07-06
4
347 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
  • 2
4 Comments
 
LVL 52

Assisted Solution

by:Carl Tawn
Carl Tawn earned 200 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 63

Accepted Solution

by:
Fernando Soto earned 300 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
MailAddress in vb 4 36
FInd Image Control Gridview 3 35
VB.NET String Settings and Temp Folder Question 3 70
vb.net datagrid scroll automatically to the first found row 11 28
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

749 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