0

I have 4 old upload modules. These upload modules make use of a dll someone written a long time ago. This project is lost and I don't really want do decompile the dll.

I would like to have one upload module where they can select one of these 4 upload modules.

They all have this code in the program.cs:

[STAThread] static void Main() { new APACMiscUM(); } 

This class triggers the dll.

namespace ApacMiscUploadModule { class APACMiscUM : UploadModule.UploadModule { public override void applicationStart() { showMessage("Upload Module", Color.Green); Connection = new SqlConnection("X"); } public override void fileSelected() { ... } } } 

When the new object is created (APACMiscUM) the dll (UploadModule.UploadModule) creates the interface. How can I activate this form after clicking a button on a new form?

ADDITIONAL INFO:

enter image description here enter image description here

2
  • "when the new object is created" - which object? And which form? And which button? !!!! Commented Jan 24, 2014 at 10:03
  • In the Main function in program.cs. It ceates the object APACMiscUM and this object creates the uploadmodule object Commented Jan 24, 2014 at 10:04

2 Answers 2

1

Save the object created fromAPACMiscUM. Call object methods, simple enough I guess.

[STAThread] static void Main() { var classObject = new APACMiscUM(); var someReturnTyoe = classObject.SomeMethod(SomeArgument) } 
Sign up to request clarification or add additional context in comments.

1 Comment

I got the following error: Starting a second message loop on a single thread is not a valid operation. Use Form.ShowDialog instead. Form.ShowDialog doesn't exist or APACMiscUM.ShowDialog also doesn't exist
1

Copy the upload-modules (APACMiscUM.cs, APACUM.cs, EMEASeiUM.cs and EMEAUM.cs) to a windows form project. Reference the upload-dll. Place four buttons on the form. Create code like this:

 private void button1_Click(object sender, EventArgs e) { new APACMiscUM(); } private void button2_Click(object sender, EventArgs e) { new APACUM(); } private void button3_Click(object sender, EventArgs e) { new EMEASeiUM(); } private void button4_Click(object sender, EventArgs e) { new EMEAUM(); } 

It is fairly straightforward.

1 Comment

True but this doens't work unfortunately. You get this error: Starting a second message loop on a single thread is not a valid operation. Use Form.ShowDialog instead. Form.ShowDialog doesn't exist or APACMiscUM.ShowDialog also doesn't exist

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.