I'm using codedom to generate an exe that includes a form, so I want the code type to be windows application. At the moment when the exe launches it opens a console window and then the form window on top of that.
How can you set the output type using codedom so it compiles a windows application ..or how can I stop that console window appearing.
This is my code which it would have to be fitted into:
Dim c As System.CodeDom.Compiler.CodeDomProvider c = System.CodeDom.Compiler.CodeDomProvider.CreateProvider("VB")
Dim prov As New Microsoft.VisualBasic.VBCodeProvider()
Dim cp As New System.CodeDom.Compiler.CompilerParameters( _ StringArray( _ "System.dll", _ "System.Management.dll", _ "Microsoft.VisualBasic.dll", _ "System.Windows.Forms.dll", _ "System.Data.dll", _ "System.Drawing.dll", _ "System.Xml.dll"), sExeName)
cp.WarningLevel = 0 cp.TreatWarningsAsErrors = False cp.GenerateExecutable = True cp.GenerateInMemory = False 'cp.IncludeDebugInformation = False cp.IncludeDebugInformation = True ' todo cp.CompilerOptions = "/optimize" cp.MainClass = "MainModule" cp.OutputAssembly = sExeName
WriteTextFile(sVbName, sScript)
Dim sRoot As String = "c:\mystuff" Dim sPath As String = sRoot & "\myutils"
Dim result As System.CodeDom.Compiler.CompilerResults
' Compile from source files
result = prov.CompileAssemblyFromFile(cp, _ sVbName, _ sPath & "\frmForm.Designer.vb", _ sPath & "\frmForm.vb", _ sPath & "\Utils.vb" _ )
thanks
.NET Development2
|