|
-
Jul 28th, 2004, 10:15 AM
#1
Thread Starter
New Member
How to use CodeDom to dynamically create a Windows Form Application£¿
Hi, everybody. I can use CodeDom to dynamically create a Windows Console Application(a exe file), like this:
http://support.microsoft.com/default...NoWebContent=1
But I don't know how to dynamically create a Windows Form Application(a exe file) use CodeDom£¿Who can help me? If you can write a very simple example(just need display a windows form) to guide me?I will thank you much!
-
Jul 28th, 2004, 10:46 AM
#2
The link you gave shows everything you need. Whats the problem?
-
Jul 28th, 2004, 11:08 AM
#3
Thread Starter
New Member
This Link can only dynamically create a Windows Console application. But I wanna dynamically create a Windows Form application use CodeDom.
-
Jul 28th, 2004, 11:13 AM
#4
Add the following
Code:
parameters.ReferencedAssemblies.Add("System.Windows.Forms.dll")
parameters.ReferencedAssemblies.Add("System.dll")
parameters.MainClass = "Form1"
test code to compile
Code:
Class Form1
Inherits System.Windows.forms.Form
End Class
-
Jul 28th, 2004, 09:07 PM
#5
Thread Starter
New Member
To Cander, Thank you very much! I praise your technic!
Now I can get a windows form appliction. And now, I wanna embed a resource file (a .rtf file) to the dynamically create windows form application. So I add this following code:
parameters.Win32Resource = "my.rtf"
But above code line result to compile error. The Error Number is BC31019, Error Text is "specified mapping file not include resource file". I don't know what the Error Text meaning.
Can you give me a guide?
-
Jul 29th, 2004, 08:02 AM
#6
It has to be an actual Resource file (.rc?)
Im not sure how to create those in .NET as I have the first version of Visual Studio and it doesnt have a Resource Editor. Maybe they added it to 2003. There are some ways to make them in code you can look up some info on.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|