473,385 Members | 1,622 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

com interop C# GUI thread

x
I am currently calling a windows form from my vb6 app. I need to know the
best practice
for handling the gui thread. I wish to call the form and have it behave as a
modal dialog and obtain a notification/return value
when the form is disposed.

Is this possible?

If so how?

Many thanks and good karma in return !
Nov 17 '05 #1
3 1615
Hi,

I foresee no threading issues at all - VB6 apps are single-threaded and if
you expose your .NET windows form through a COM-callable object, it will run
on the caller's thread.

So here's how I'd do it:

a) Create the form
b) Create a COM-callable object that would accept the parent window's
handle, display the form modally, retrieve any return value and pass it back
to the caller.

a) and b) should reside in the same assembly.

c) Register the assembly with regasm
b) Add a reference to the assembly's type library to the VB6 project and
make use of the COM-callable object.

That's basically it, please feel free to ask further questions.

--
Sincerely,
Dmytro Lapshyn [Visual Developer - Visual C# MVP]

"x" <it*****@hotmail.com> wrote in message
news:rH*******************@news20.bellglobal.com.. .
I am currently calling a windows form from my vb6 app. I need to know the
best practice
for handling the gui thread. I wish to call the form and have it behave as
a modal dialog and obtain a notification/return value
when the form is disposed.

Is this possible?

If so how?

Many thanks and good karma in return !


Nov 17 '05 #2

here is one article which could be of ur interest..
i myself have'nt read this....and not sure how much it will hlep u

http://www.codeproject.com/useritems/vb6_NET_forms.asp

regards

Nov 17 '05 #3

Thank you, that did the trick.
*** Sent via Developersdex http://www.developersdex.com ***
Nov 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: Mark Sisson | last post by:
Hey all. I've got a legacy COM dll that I'd like to use in my multithreaded C# app. Problem though is when I create several instances of the interop object and start them on their own threads...
1
by: Mike | last post by:
I am working on an application originaly developed in VB5.0/6.0 that has a mdi parent/child forms. I created a VB.net 2003 program with a couple of forms, compiled it as a dll and registered it as...
0
by: Darren | last post by:
Hi, I'm struggling with a COM Interop issue that only manifests itself on our production boxes. The app works fine on the dev boxes (furthermore, it works on the production boxes when the remote...
6
by: Sudha | last post by:
Hi All, I am trying to use COM DLL in my C#. I have added this DLL in referance and all interface are working fine. I have one issue in calling function decleared like: void...
8
by: Z D | last post by:
Hello, I'm having a strange problem that is probably due to my lack of understanding of how threading & COM Interop works in a WinForms.NET application. Here's the situation: I have a 3rd...
1
by: Nadav | last post by:
Hi, Introduction: ********************* I am writing a mixed mode application I have a COM module and a .NET module that communicate with each other. The COM exposes a custom sink interface,...
12
by: Anil Krishnamurthy | last post by:
We have an ASP.NET application that uses COM objects through Interop. The web application requires access to network and database resources and hence, needs to impersonate a domain account. The...
0
by: Chris V | last post by:
Hello, I'm having problems sending MAPI Mail from an ASP.NET applcation (in VB) (which worked fine in traditional asp) When run on our test server, it returns an COMException (0x80010106): ]]...
3
by: Jay A. Moritz | last post by:
I have an application that loads IE and iterates through web pages to retrieve information from the page then activates specific controls to retrieve the next page and iterate through that page for...
2
by: Christopher Carnahan | last post by:
I need to figure out how to terminate a thread while it is blocked trying to create a COM object via interop. In a worker thread, I do something like this: Type t = null; Object...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.