Click here to Skip to main content
15,915,019 members
Home / Discussions / COM
   

COM

 
Questionreturning array of BSTRs from the COM component Pin
Raj Prathap17-Jul-07 2:25
Raj Prathap17-Jul-07 2:25 
AnswerRe: returning array of BSTRs from the COM component Pin
Mike Dimmick17-Jul-07 2:52
Mike Dimmick17-Jul-07 2:52 
GeneralRe: returning array of BSTRs from the COM component Pin
Raj Prathap18-Jul-07 20:20
Raj Prathap18-Jul-07 20:20 
QuestionUnable to Start Exchange service Pin
Ashish Vasudev16-Jul-07 23:09
Ashish Vasudev16-Jul-07 23:09 
QuestionApartment (STA) mode before OLE calls Pin
MadmanWoo16-Jul-07 21:03
MadmanWoo16-Jul-07 21:03 
AnswerRe: Apartment (STA) mode before OLE calls Pin
User 21559716-Jul-07 22:58
User 21559716-Jul-07 22:58 
GeneralRe: Apartment (STA) mode before OLE calls Pin
MadmanWoo18-Jul-07 12:41
MadmanWoo18-Jul-07 12:41 
GeneralRe: Apartment (STA) mode before OLE calls Pin
User 21559719-Jul-07 19:44
User 21559719-Jul-07 19:44 
MadmanWoo wrote:
In the Callback class I have a sub set up to handle every time the OLE window changes which works fine, now the fun begins. I set up another sub which takes a string from the sub receiving the callback message, it then uses this string to select a control on the main form like so

Dim pnl as Panel = Mainform.pnlLegend.Controls.Item({String})

When ever it gets to this line it throws the error "Current thread must be set to single thread apartment (STA) mode before OLE calls can be made".


I believe the problem happens because your callback and the control, whose property you are setting, are in different appartments. Will it help if you make the call from your event handling sub to another sub as non blocking instead of a blocking call - post the string to a queue or post the reuquest to your UI thread etc

What appartment mode does your main thread run in?




Sohail


modified 21-Apr-21 21:01pm.

QuestionRegarding COM's Server type(DLL or EXE) Pin
Karismatic13-Jul-07 21:39
Karismatic13-Jul-07 21:39 
AnswerRe: Regarding COM's Server type(DLL or EXE) Pin
Mike Dimmick14-Jul-07 6:40
Mike Dimmick14-Jul-07 6:40 
QuestionI am getting 'ICaptureGraphBuilder2' : missing storage-class or type specifiers Pin
yaminisridaran12-Jul-07 19:43
yaminisridaran12-Jul-07 19:43 
QuestionHow to Generate OLE dispatch map functions Pin
KASR111-Jul-07 23:01
KASR111-Jul-07 23:01 
Questionsugest me the basic COM book with C#.Net Pin
help as an alias11-Jul-07 19:00
help as an alias11-Jul-07 19:00 
AnswerRe: sugest me the basic COM book with C#.Net Pin
User 21559711-Jul-07 23:04
User 21559711-Jul-07 23:04 
QuestionThis problem is COM related Pin
beloveyyj9-Jul-07 23:03
beloveyyj9-Jul-07 23:03 
Questionir receiver Pin
Waqas Habib9-Jul-07 17:23
Waqas Habib9-Jul-07 17:23 
AnswerRe: ir receiver Pin
User 2155979-Jul-07 18:52
User 2155979-Jul-07 18:52 
QuestionShow Picture In ActiveX control Pin
eraccn8-Jul-07 19:34
eraccn8-Jul-07 19:34 
QuestionRetrieving the COM class factory for component with CLSID failed due to the following error: 80004005. Pin
kalaveer8-Jul-07 0:33
kalaveer8-Jul-07 0:33 
AnswerRe: Retrieving the COM class factory for component with CLSID failed due to the following error: 80004005. Pin
User 2155978-Jul-07 18:17
User 2155978-Jul-07 18:17 
AnswerRe: Retrieving the COM class factory for component with CLSID failed due to the following error: 80004005. Pin
MAW3021-Jul-07 20:42
MAW3021-Jul-07 20:42 
Questionplugin for Mozilla Pin
Dimkov6-Jul-07 6:31
Dimkov6-Jul-07 6:31 
AnswerRe: plugin for Mozilla Pin
User 2155978-Jul-07 18:19
User 2155978-Jul-07 18:19 
Questionwebservice Pin
brsecu6-Jul-07 3:39
brsecu6-Jul-07 3:39 
AnswerRe: webservice Pin
Thomas Chester9-Jul-07 8:04
Thomas Chester9-Jul-07 8:04 

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.