473,236 Members | 1,423 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,236 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 825

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: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
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: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
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...

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.