EDN Admin
Well-known member
Hello,
My previous question was "How to generate an executable using VB code" and answered correctly.Now the problem is that in order to make what I want, the two codes of these applications must be connected. For example: The button text of the newly created executable
must be the text of a textbox in the main executable. To make it easier: I have an exe with a textbox and a button. When someone clicks this button a new executable file is being created somewhere on the disk. When the user opens this new executable it contains
a simple form with a button. The button text must be the same with the textbox text in the first form. I have the following code from the previous question,so does anybody knows how to modify it in order to do the above?
Thanks to <span style="text-decoration:underline Crazypennie
<pre class="prettyprint lang-vb prettyprinted" style="font-family:inherit; outline:0px; list-style-type:none; word-wrap:normal; text-align:left; overflow-y:hidden; overflow-x:auto; color:#333333; font-size:13px; line-height:16px <span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Imports<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px System<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px .<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px CodeDom<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px .<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Compiler
<span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Public<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px <span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Class<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Form1
<span class="com" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px This string is the code to be compiled by the application...<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px
<span class="com" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Here I hardcoded the code to be compiled, ... You, you can get it from wherever you want<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px
<span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Private<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Code <span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px As<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px <span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px String<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px <span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px =<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px <span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px CStr<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px (<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px
<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px <<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Code_Example<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px ><span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px
<span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Imports<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px System
<span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Imports<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px System<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px .<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Windows<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px .<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Forms
<span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Class<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Form1 <span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px :<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px <span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Inherits<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Form
<span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Private<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px <span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px WithEvents<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Button1 <span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px As<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px <span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px New<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Button
<span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Private<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px <span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Sub<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Form1_Load<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px (<span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px ByVal<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px sender <span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px As<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px System<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px .<span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Object<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px ,<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px <span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px ByVal<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px e <span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px As<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px System<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px .<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px EventArgs<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px )<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px <span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Handles<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px <span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px MyBase<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px .<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Load
Button1<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px .<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Text <span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px =<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px <span class="str" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px "ClickMe"<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px
Application<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px .<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px EnableVisualStyles<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px ()<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px
Button1<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px .<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px parent<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px =<span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Me<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px
<span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px End<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px <span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Sub<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px
<span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px private<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px <span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Sub<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Button1_Click<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px (<span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px ByVal<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px sender <span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px As<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px <span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Object<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px ,<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px <span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px ByVal<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px e <span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px As<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px System<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px .<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px EventArgs<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px )<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px <span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Handles<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Button1<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px .<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Click
Messagebox<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px .<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Show<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px (<span class="str" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px "Button1 Was Clicked"<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px )<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px
<span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px End<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px <span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Sub<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px
<span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px End<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px <span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Class<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px
<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px </<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Code_Example<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px >)<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px
<span class="com" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px ==================================================<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px
<span class="com" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px =========== Now the code to do the compilation<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px
<span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Private<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px <span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Sub<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Button1_Click<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px (<span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px ByVal<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px sender <span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px As<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px System<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px .<span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Object<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px ,<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px <span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px ByVal<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px e <span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px As<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px System<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px .<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px EventArgs<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px )<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px <span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Handles<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Button1<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px .<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Click
<span class="com" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px ===Create a provider<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px
<span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Dim<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Provider <span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px As<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px CodeDomProvider <span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px =<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px CodeDomProvider<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px .<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px CreateProvider<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px (<span class="str" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px "VisualBasic"<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px )<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px
<span class="com" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px ===Create the compiler parameters<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px
<span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Dim<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px cp <span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px As<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px CompilerParameters <span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px =<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px <span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px New<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px CompilerParameters<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px ()<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px
<span class="com" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px ===Specify to create an executable (Here False will create a DLL file)<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px
cp<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px .<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px GenerateExecutable <span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px =<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px <span class="lit" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px True<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px
<span class="com" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px ===Always set to false (It can get very complicated to create it in memory)<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px
cp<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px .<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px GenerateInMemory <span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px =<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px <span class="lit" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px False<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px
<span class="com" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px ===Set target to winexe to create an executable<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px
<span class="com" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px ===m:Form1 specify to start the application in Form1. To start in Sub main,<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px
<span class="com" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Specify the name of the module where the Sub Main is located<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px
cp<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px .<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px CompilerOptions <span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px =<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px <span class="str" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px " /target:winexe /m:Form1"<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px
<span class="com" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px ===Specify the main Form<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px
cp<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px .<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px MainClass <span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px =<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px <span class="str" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px "Form1"<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px
<span class="com" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px ===The DLL name you want to put as reference (To create a form application you<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px
<span class="com" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px will at least need a reference to System.dll and System.Windows.Forms.dll)<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px
cp<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px .<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px ReferencedAssemblies<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px .<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px AddRange<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px ({<span class="str" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px "System.dll"<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px ,<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px <span class="str" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px "System.Windows.Forms.dll"<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px }.<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px ToArray<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px )<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px
<span class="com" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px ===Specify the path and name where to save the EXE file compiled<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px
cp<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px .<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px OutputAssembly <span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px =<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px <span class="str" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px "C:tstSourceFileEXE.exe"<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px
<span class="com" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px ===Specify if you want the compiler to abort the compilation for the warnings<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px
cp<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px .<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px TreatWarningsAsErrors <span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px =<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px <span class="lit" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px False<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px
<span class="com" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px ===Compile and get the result of the compilation<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px
<span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Dim<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Result <span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px As<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px CompilerResults <span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px =<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Provider<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px .<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px CompileAssemblyFromSource<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px (<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px cp<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px ,<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Code<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px )<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px
<span class="com" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px ===If the result has some error then get the error messages and show them in a message box<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px
<span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px If<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Result<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px .<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Errors<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px .<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px HasErrors <span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Then<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px
<span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Dim<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px ErrorString <span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px As<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px <span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px String<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px <span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px =<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px <span class="str" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px "Compiler error:"<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px
<span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px For<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px <span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Each<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Err <span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px As<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px CompilerError <span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px In<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Result<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px .<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Errors
ErrorString <span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px &=<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Err<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px .<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px ToString <span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px &<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px vbCrLf
<span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Next<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px
MsgBox<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px (<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px ErrorString<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px ,<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px MsgBoxStyle<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px .<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px OkOnly<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px ,<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px <span class="str" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px "Error while compiling"<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px )<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px
<span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Else<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px
<span class="com" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px ===== If there is no error start the new process<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px
Process<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px .<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Start<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px (<span class="str" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px "C:tstSourceFileEXE.exe"<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px )<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px
<span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px End<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px <span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px If<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px
<span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px End<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px <span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Sub<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px
<span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px End<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px <span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Class[/code]
View the full article
My previous question was "How to generate an executable using VB code" and answered correctly.Now the problem is that in order to make what I want, the two codes of these applications must be connected. For example: The button text of the newly created executable
must be the text of a textbox in the main executable. To make it easier: I have an exe with a textbox and a button. When someone clicks this button a new executable file is being created somewhere on the disk. When the user opens this new executable it contains
a simple form with a button. The button text must be the same with the textbox text in the first form. I have the following code from the previous question,so does anybody knows how to modify it in order to do the above?
Thanks to <span style="text-decoration:underline Crazypennie
<pre class="prettyprint lang-vb prettyprinted" style="font-family:inherit; outline:0px; list-style-type:none; word-wrap:normal; text-align:left; overflow-y:hidden; overflow-x:auto; color:#333333; font-size:13px; line-height:16px <span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Imports<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px System<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px .<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px CodeDom<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px .<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Compiler
<span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Public<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px <span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Class<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Form1
<span class="com" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px This string is the code to be compiled by the application...<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px
<span class="com" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Here I hardcoded the code to be compiled, ... You, you can get it from wherever you want<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px
<span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Private<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Code <span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px As<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px <span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px String<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px <span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px =<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px <span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px CStr<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px (<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px
<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px <<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Code_Example<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px ><span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px
<span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Imports<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px System
<span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Imports<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px System<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px .<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Windows<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px .<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Forms
<span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Class<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Form1 <span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px :<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px <span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Inherits<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Form
<span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Private<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px <span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px WithEvents<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Button1 <span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px As<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px <span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px New<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Button
<span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Private<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px <span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Sub<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Form1_Load<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px (<span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px ByVal<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px sender <span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px As<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px System<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px .<span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Object<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px ,<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px <span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px ByVal<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px e <span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px As<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px System<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px .<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px EventArgs<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px )<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px <span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Handles<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px <span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px MyBase<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px .<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Load
Button1<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px .<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Text <span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px =<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px <span class="str" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px "ClickMe"<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px
Application<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px .<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px EnableVisualStyles<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px ()<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px
Button1<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px .<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px parent<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px =<span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Me<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px
<span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px End<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px <span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Sub<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px
<span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px private<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px <span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Sub<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Button1_Click<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px (<span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px ByVal<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px sender <span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px As<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px <span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Object<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px ,<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px <span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px ByVal<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px e <span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px As<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px System<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px .<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px EventArgs<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px )<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px <span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Handles<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Button1<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px .<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Click
Messagebox<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px .<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Show<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px (<span class="str" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px "Button1 Was Clicked"<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px )<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px
<span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px End<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px <span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Sub<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px
<span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px End<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px <span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Class<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px
<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px </<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Code_Example<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px >)<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px
<span class="com" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px ==================================================<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px
<span class="com" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px =========== Now the code to do the compilation<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px
<span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Private<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px <span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Sub<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Button1_Click<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px (<span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px ByVal<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px sender <span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px As<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px System<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px .<span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Object<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px ,<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px <span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px ByVal<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px e <span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px As<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px System<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px .<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px EventArgs<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px )<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px <span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Handles<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Button1<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px .<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Click
<span class="com" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px ===Create a provider<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px
<span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Dim<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Provider <span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px As<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px CodeDomProvider <span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px =<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px CodeDomProvider<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px .<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px CreateProvider<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px (<span class="str" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px "VisualBasic"<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px )<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px
<span class="com" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px ===Create the compiler parameters<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px
<span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Dim<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px cp <span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px As<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px CompilerParameters <span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px =<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px <span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px New<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px CompilerParameters<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px ()<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px
<span class="com" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px ===Specify to create an executable (Here False will create a DLL file)<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px
cp<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px .<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px GenerateExecutable <span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px =<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px <span class="lit" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px True<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px
<span class="com" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px ===Always set to false (It can get very complicated to create it in memory)<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px
cp<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px .<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px GenerateInMemory <span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px =<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px <span class="lit" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px False<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px
<span class="com" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px ===Set target to winexe to create an executable<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px
<span class="com" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px ===m:Form1 specify to start the application in Form1. To start in Sub main,<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px
<span class="com" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Specify the name of the module where the Sub Main is located<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px
cp<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px .<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px CompilerOptions <span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px =<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px <span class="str" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px " /target:winexe /m:Form1"<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px
<span class="com" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px ===Specify the main Form<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px
cp<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px .<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px MainClass <span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px =<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px <span class="str" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px "Form1"<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px
<span class="com" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px ===The DLL name you want to put as reference (To create a form application you<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px
<span class="com" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px will at least need a reference to System.dll and System.Windows.Forms.dll)<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px
cp<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px .<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px ReferencedAssemblies<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px .<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px AddRange<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px ({<span class="str" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px "System.dll"<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px ,<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px <span class="str" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px "System.Windows.Forms.dll"<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px }.<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px ToArray<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px )<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px
<span class="com" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px ===Specify the path and name where to save the EXE file compiled<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px
cp<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px .<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px OutputAssembly <span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px =<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px <span class="str" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px "C:tstSourceFileEXE.exe"<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px
<span class="com" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px ===Specify if you want the compiler to abort the compilation for the warnings<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px
cp<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px .<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px TreatWarningsAsErrors <span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px =<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px <span class="lit" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px False<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px
<span class="com" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px ===Compile and get the result of the compilation<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px
<span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Dim<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Result <span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px As<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px CompilerResults <span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px =<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Provider<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px .<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px CompileAssemblyFromSource<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px (<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px cp<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px ,<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Code<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px )<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px
<span class="com" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px ===If the result has some error then get the error messages and show them in a message box<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px
<span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px If<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Result<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px .<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Errors<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px .<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px HasErrors <span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Then<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px
<span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Dim<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px ErrorString <span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px As<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px <span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px String<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px <span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px =<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px <span class="str" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px "Compiler error:"<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px
<span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px For<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px <span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Each<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Err <span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px As<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px CompilerError <span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px In<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Result<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px .<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Errors
ErrorString <span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px &=<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Err<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px .<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px ToString <span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px &<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px vbCrLf
<span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Next<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px
MsgBox<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px (<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px ErrorString<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px ,<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px MsgBoxStyle<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px .<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px OkOnly<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px ,<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px <span class="str" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px "Error while compiling"<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px )<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px
<span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Else<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px
<span class="com" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px ===== If there is no error start the new process<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px
Process<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px .<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Start<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px (<span class="str" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px "C:tstSourceFileEXE.exe"<span class="pun" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px )<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px
<span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px End<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px <span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px If<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px
<span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px End<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px <span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Sub<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px
<span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px End<span class="pln" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px <span class="kwd" style="border:0px; font-style:inherit; font-family:inherit; margin:0px; outline:0px; padding:0px Class[/code]
View the full article