can anyone get the new sendrequest to work????

Nov 8, 2007 at 3:54 PM
i get the error below,

don't really understand what sendrequest is supposed to do anymore, anyone?

has anyone got it to work?

Thanks


Server Error in '/facebookapp' Application.
ActiveX control '8856f961-340a-11d0-a96b-00c04fd705a2' cannot be instantiated because the current thread is not in a single-threaded apartment.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

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

Source Error:

Line 56: //fbs.SendRequest("<fb:req-choice url=\"http://apps.facebook.com/myapp/default.aspx\" label=\"Add Application\" ></fb:req-choice>", "request", "this is the text",true);
Line 57: fbs.SendRequest("this is the markup", "request", "this is the text", true);
Line 58:
Nov 8, 2007 at 5:28 PM
i second this... The comments for strings could definitely be elaborated on.

I thought the documentation might have a hint... but I have yet to get sand castle to work either to build the documentation... but that is a different problem.

Developer
Nov 8, 2007 at 5:33 PM
You're probably calling the service on some other thread besides the one it was instantiated on (the main UI thread). Because of the way these COM componenets, like FacebookService work, they usually have to be called from the thread they were instantiated on.

You should still be able to get it to work, though, if from your form's code-behind you call: this.Invoke(someMethod), where someMethod is a method which calls SendRequest. Let me know if that works for you or not.