Click here to Skip to main content
15,890,282 members
Home / Discussions / COM
   

COM

 
AnswerRe: folder browser activex control and file/ folder list in tree format Pin
Dave Kreskowiak16-May-07 4:54
mveDave Kreskowiak16-May-07 4:54 
GeneralRe: folder browser activex control and file/ folder list in tree format Pin
leckey16-May-07 6:20
leckey16-May-07 6:20 
QuestionAdding Filter by Class ID Pin
Raja Bose C Leo15-May-07 21:29
Raja Bose C Leo15-May-07 21:29 
AnswerRe: Adding Filter by Class ID Pin
rjkg18-May-07 19:07
rjkg18-May-07 19:07 
QuestionRe: Adding Filter by Class ID Pin
Raja Bose C Leo18-May-07 22:04
Raja Bose C Leo18-May-07 22:04 
AnswerRe: Adding Filter by Class ID Pin
rjkg22-May-07 20:10
rjkg22-May-07 20:10 
GeneralGetting an ActiveX control to install (newbie question) Pin
Judah Gabriel Himango15-May-07 18:24
sponsorJudah Gabriel Himango15-May-07 18:24 
QuestionHow to properly initialise a COM/ActiveX component in C#? Pin
orinoco7715-May-07 6:12
orinoco7715-May-07 6:12 
I'm trying to do something that might actually be a bit silly. I'm accessing what is essentially a windows form from an aspx page, to do some printing from the server side for me.

I have the following code:

public class axForm	: System.Windows.Forms.Form
{	
	public AxDHTMLEDLib.AxDHTMLEdit axd;
	public axForm()
	{
		Thread.CurrentThread.ApartmentState=ApartmentState.STA;
		axd=new AxDHTMLEDLib.AxDHTMLEdit();
		((System.ComponentModel.ISupportInitialize)(axd)).BeginInit();
		this.Controls.Add(axd);
		axd.Enabled = true;
		axd.Name = "axd";			
		((System.ComponentModel.ISupportInitialize)(axd)).EndInit();
	}

	public void printDoc(string sHtml, bool bPrompt)
	{
		axd.DocumentHTML=sHtml;
		object filename=@"c:\fileouttest.txt";
		for(;axd.Busy!=false;)
		{
			System.Windows.Forms.Application.DoEvents();
		}
		axd.SaveDocument(ref filename);
		object opt=null;
		if (bPrompt)
			opt="1";
		axd.PrintDocument(ref opt);

			
	}
}


Basically I create an instance of that class in my aspx code behind, then call printDoc with the HTML I want to print and an indicator as to whether or not I want to see the print dialog (I don't but the code I based this on had the boolean in there and I thought it might be useful for testing).

The problem is I'm getting a HRESULT error message and I don't know what to do about it. I'm guessing, since the error is fired just after the .endInit() line that it's something to do with how I'm setting the thing up in the first place, but I don't know enough about it to be able to debug it properly. The error is:
'System.Runtime.InteropServices.COMException' occurred in system.windows.forms.dll - Additional information: Exception from HRESULT: 0x80040200.


Can anyone help me figure this out? It seems like I'm really close to getting it working. If I tone down the amount of debug information I want, it actually runs without giving any errors at all, and the line that saves the document to disk actually works regardless, so I'm a bit confused. Any help would be greatly appreciated.
QuestionNeed help to understand STA and MTA in COM Pin
Nandu_77b15-May-07 1:53
Nandu_77b15-May-07 1:53 
AnswerRe: Need help to understand STA and MTA in COM Pin
User 21559715-May-07 2:14
User 21559715-May-07 2:14 
QuestionWhat is proxy/strub in COM Pin
Nandu_77b15-May-07 1:46
Nandu_77b15-May-07 1:46 
AnswerRe: What is proxy/strub in COM [modified] Pin
User 21559715-May-07 2:18
User 21559715-May-07 2:18 
Questionregarding adding a filter Pin
Raja Bose C Leo14-May-07 3:04
Raja Bose C Leo14-May-07 3:04 
QuestionProblem: GetRecordInfoFromGuids Pin
viral_umang@hotmail.com14-May-07 1:55
viral_umang@hotmail.com14-May-07 1:55 
AnswerRe: Problem: GetRecordInfoFromGuids Pin
viral_umang@hotmail.com14-May-07 19:18
viral_umang@hotmail.com14-May-07 19:18 
QuestionInvalid Procedure call or argument in VB Client ? Pin
viral_umang@hotmail.com12-May-07 1:50
viral_umang@hotmail.com12-May-07 1:50 
AnswerRe: Invalid Procedure call or argument in VB Client ? Pin
Lim Bio Liong13-May-07 19:45
Lim Bio Liong13-May-07 19:45 
GeneralRe: Invalid Procedure call or argument in VB Client ? Pin
viral_umang@hotmail.com14-May-07 1:02
viral_umang@hotmail.com14-May-07 1:02 
GeneralRe: Invalid Procedure call or argument in VB Client ? Pin
Lim Bio Liong14-May-07 2:21
Lim Bio Liong14-May-07 2:21 
QuestionQuery Interface from Another Interface of Same Com Server Pin
georgekjolly11-May-07 4:47
georgekjolly11-May-07 4:47 
AnswerRe: Query Interface from Another Interface of Same Com Server Pin
Roger Stoltz11-May-07 5:08
Roger Stoltz11-May-07 5:08 
GeneralRe: Query Interface from Another Interface of Same Com Server Pin
georgekjolly11-May-07 5:21
georgekjolly11-May-07 5:21 
GeneralRe: Query Interface from Another Interface of Same Com Server Pin
Roger Stoltz11-May-07 9:37
Roger Stoltz11-May-07 9:37 
GeneralRe: Query Interface from Another Interface of Same Com Server Pin
georgekjolly11-May-07 18:35
georgekjolly11-May-07 18:35 
QuestionWindows services Pin
tantoun11-May-07 4:17
tantoun11-May-07 4:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.