Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Interop / August 2006

Tip: Looking for answers? Try searching our database.

Regasm

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
James - 21 Aug 2006 23:34 GMT
I notice that anytime I run Regasm to register a managed library for
COM-interop that it registers it with a threadingmodel of "Both".  I have a
particular library that can display forms, and therefore, I believe, must run
in an STA.  Is there control over this?  I do note that the registration is
actually for the MSCoree.dll, not by DLL, and that the Class and Assembly
Keys contain the references to my DLL and class.  Can you control the
publishing threadingmodel, or does the framework handle the problem
internally?

Signature

James

"Peter Huang" [MSFT] - 22 Aug 2006 10:47 GMT
Hi James,

So far I am researching the issue and I will reply to you ASAP.

Best regards,

Peter Huang

Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
"Peter Huang" [MSFT] - 24 Aug 2006 07:55 GMT
Hi James,

I understand your scenario that you have an unmanaged app which will
ininitialize as MTA to create the .NET component.
But your component have UI feature which need STA apartment. So the regasm
will only register it as Both which will cause the .NET component running
in MTA if the calling thread is MTA.
If I misunderstood, please feel free to let me know.

Based on my research, I do understand your scenario and I have reported it
to our product team.
So far as a workaround, I suggest you create another thread and initialize
it as STA and call the .NET assembly from this STA thread.

Commonly even if the Win32, we high recommend doing Win32 Windows UI
related programming in the STA thread if it is COM related. So  based on my
experience, if we have the UI design request, it is recommended to create a
STA thread for UI related processing.

If you have any concern, please feel free to let me know.

Best regards,

Peter Huang

Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.