-
Hi,
I have been a little confused bout something for awhile but I finally want to know the facts..
I understand that when you compile a VB app into P-code, it means that it has to be interpreted at run-time by the VB DLL. But what about native code? You still have to distribute the VB runtime DLL with a native code compiled EXE as well.. If they both need to be interpreted by the run time DLL, then what's the difference between the two?
Any info on this subject to help me clear this confusion up would be greatly appreciated.
Dan
-
This is from Help
Compiling Your Project to Native Code
If you have the Professional or Enterprise edition of Visual Basic, you can compile your code either in standard Visual Basic p-code format or in native code format. Native code compilation provides several options for optimizing and debugging that aren't available with p-code.
P-code, or pseudo code, is an intermediate step between the high-level instructions in your Basic program and the low-level native code your computer's processor executes. At run time, Visual Basic translates each p-code statement to native code. By compiling directly to native code format, you eliminate the intermediate p-code step.
You can debug compiled native code using standard native code debugging tools, such as the debugging environment provided by Visual C++. You can also use options available in languages such as Visual C++ for optimizing and debugging native code. For example, you can optimize code for speed or for size.
Note All projects created with Visual Basic use the services of the run-time DLL (MSVBVM60.DLL). Among the services provided by this DLL are startup and shutdown code for your application, functionality for forms and intrinsic controls, and run-time functions like Format and CLng.
Compiling a project with the Native Code option means that the code you write will be fully compiled to the native instructions of the processor chip, instead of being compiled to p-code. This will greatly speed up loops and mathematical calculations, and may somewhat speed up calls to the services provided by MSVBVM60.DLL. However, it does not eliminate the need for the DLL.