Click here to Skip to main content
15,888,802 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hi
i need the code by develop a dll with a web browser in c#

in the dll i have a windows form with boton for save and other boton by print and web browser to show a word document. the project is a dll.

i tried with treahds but is failed,

ActiveX control '8856f961-340a-11d0-a96b-00c04fd705a2' cannot be instantiated because the current thread is not in a single-threaded apartment.


if i quit de web browser control the form is works...

helpme please
Posted

1 solution

 
Share this answer
 
Comments
hugojim 15-May-13 13:21pm    
in my project no works
is show me two errors:

Error 1 The best overloaded method match for 'System.Windows.Forms.Application.Run(System.Windows.Forms.Form)' has some invalid arguments

Error 2 Argument 1: cannot convert from 'System.Windows.Forms.WebBrowser' to 'System.Windows.Forms.Form'
Thomas Daniels 15-May-13 13:22pm    
What's your code?
hugojim 15-May-13 13:40pm    
the same of your links

namespace badDllweb
{
public class GenDoc
{
///
/// The main entry point for the application.
///

[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new WebBrowser());
}
}
}
Thomas Daniels 15-May-13 13:48pm    
Application.Run should have a Form as argument. If you want to use a WebBrowser, then create a UserControl, add a WebBrowser, and then have a look at this article:
http://www.codeproject.com/Articles/14276/Using-Windows-Application-on-web

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900