473,320 Members | 2,189 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,320 software developers and data experts.

Why can't I create a Form in a com-object?

I'm trying to create and display a Form in an inproc COM server using
C# and it is locking up. It's intermittent, but happens more often
than not.

The following code demonstrates the problem - the Form is
unresponsive.

Can anyone explain why this is happening?

====
TestComServerLockup.cs
====
using System.Windows.Forms;
using System.Reflection;
using System.Runtime.InteropServices;

[assembly: AssemblyDescription("TestComServerLockup 1.0 Type
Library")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: Guid("431F88DF-A2B4-4669-841B-ED2A2316676A")]

[Guid("90BBBCF3-81FE-4c82-9A3B-6071E76C6955"),
InterfaceType(ComInterfaceType.InterfaceIsDual)]
public interface ITestComServerLockup {
[DispId(1)] void LockUp();
}

[ClassInterface(ClassInterfaceType.None)]
[ProgId("dcc.TestComServerLockup.1")]
[Guid("5C241427-18B7-4b81-A24F-D7791AAB1D4F")]
public class TestComServerLockup : ITestComServerLockup {
public void LockUp() {
Form f = new Form();
f.Name = "Test Form";
f.Text = "Test Form";
f.ShowDialog();
}
}

===
To build:
===
csc /target:library /r:System.Windows.Forms.dll TestComServerLockup.cs
regasm TestComServerLockup.dll /codebase

===
I'm testing it with python + win32 extentions. C++ clients exhibit
the same behavior.
===
python -c "from win32com.client import Dispatch;
Dispatch('dcc.TestComServerLockup.1').LockUp()"
Sep 10 '08 #1
0 827

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

Similar topics

10
by: Bob Garbados | last post by:
forgive my ignorance, as I'm new to php coming from a ms background... If I create a page named redirect.php and it's only content is: <?php header("Location: http://www.google.com"); ?>...
6
by: Paul | last post by:
Hello everyone: I am developing a VB.Net Windows Application and I am now ready to create the deployment project for it. This application needs to be installable on a different number of users...
3
by: intl04 | last post by:
Is it possible to create a Word form as the data entry form for an Access database? I didn't see any reference to this possibility in my Access books, so I'm sorry if this is a question that is...
4
by: amywolfie | last post by:
I've been trying to do something for about 3 days – I get close, but not 100%. I am trying to: Open frmRevisionHistory from a button on frmFeeInput. If there is NO RELATED RECORD, then I...
6
by: skgolden | last post by:
My husband and I own a small temporary labor company and deal with 4 major clients (A,B,C & D), each of which has about 2 dozen units in our tristate area that we deal with (ie, Company A, units...
2
by: mpanwar1 | last post by:
I need to create a new row on the form. I have a button on the form and based on the requirement I need to create a new row on the form. My existing row contains some text boxes and list boxes. On...
1
by: Arend Jan Nijenhuis | last post by:
Hi, I'm fairly new to .Net, but an expert in Microsoft Access VBA. For a large Access application, I want to create some sort of custom control (COM interop?) in VB.Net, to be used in an Access...
4
by: Steven | last post by:
Hi, I have a database table field to store the form name, I want to create the particular windows form by using the value that read from that DB field. For examples, the table field has a value...
3
by: wherez73 | last post by:
Hi, IE7 has a search bar from which you can search on the internet. It is also possible to add a site to the list of sources for this bar. The only disadvantage of this is that it pass the full...
7
by: chrismaliszewski | last post by:
Hi. I created code which makes dynamically form with bounded controls for all columns. I show it to you below. My problem is, how I have to change this code to create form which record source...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
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: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.