Avatar of Camillia
Camillia
Flag for United States of America asked on

Where's WindowsFormsApplicationBase class?

I'm following this example, method 2 but doing it in C#
http://emoreau.com/Entries/Articles/2008/11/Passing-arguments-to-an-application-startup.aspx

I have this but I cant find WindowsFormsApplicationBase

namespace Scene7API
{
    class cStartup : Microsoft.CSharp.// (but i dont see other methods to get me to the namespace above

    {
    }
}
C#

Avatar of undefined
Last Comment
AndyAinscow

8/22/2022 - Mon
Randy Downs

Maybe this will help
http://msdn.microsoft.com/en-us/library/microsoft.visualbasic.applicationservices.windowsformsapplicationbase(v=vs.80).aspx

public class WindowsFormsApplicationBase : ConsoleApplicationBase

Open in new window

kaufmed

It tells you in the article:

Public Class cStartup
   Inherits Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase
End Class

Open in new window


You'll probably need to add a reference to Microsoft.VisualBasic.dll.
Camillia

ASKER
I'm using C# tho...not VB. Let me add a reference to Microsoft.CSharp.dll

Now, If I use
public class WindowsFormsApplicationBase : ConsoleApplicationBase

That's WindowsFormsApplicationBase inherting from ConsoleApplicationBase....

I need (per that article) my class to inherit from WindowsFormsApplicationBase
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes
Camillia

ASKER
I added a reference to Microsoft.CSharp.dll, that doesnt give me WindowsFormsApplicationBase either
ASKER CERTIFIED SOLUTION
Éric Moreau

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
AndyAinscow

You probably don't need it.
What are you trying to do ?
start an app AND pass arguements to it ?
read the arguements passed to the current app ?
Start only one instance of an app ?
Camillia

ASKER
Let me try it, Emoreau
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
kaufmed

Very interesting choice of answer selection.
Camillia

ASKER
oh, i'm sorry. I just saw that you have the same answer at the botton of your answer. If I can reopen and divide the points, i can do that.
AndyAinscow

I'm just puzzled why you highlight you are doing it in C# and then accept an answer to use VB.
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
Camillia

ASKER
because i didnt know i can add VB dlls to C# project. I tried it and it worked.
Éric Moreau

there is nothing wrong in using the VB library in C# if it contains features you want!
AndyAinscow

>>there is nothing wrong in using the VB library in C# if it contains features you want!

Agreed - but maybe there is a simple C# way to accomplish what was required.  (One can get from A to D round a square by going A..B..C...D if one wants but maybe A..D is more suitable).

Anyway as long as it works.
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.