How to creata an instance of an Interface in VB.Net

Posted on 2012-08-15
Medium Priority
Last Modified: 2012-08-20
I'm migrating a project from C# to VB.Net and need to mimic this successful C# code in VB.net.

These two lines of code runs successfully in the C# project. ISchedulerFactory and IScheduler are both Interfaces:

            // First we must get a reference to a scheduler
            ISchedulerFactory sf = new StdSchedulerFactory();
            IScheduler sched = sf.GetScheduler();

Question by:JMO9966
LVL 70

Expert Comment

by:Éric Moreau
ID: 38296757
this is VB 101!

            '// First we must get a reference to a scheduler
            dim sf as new StdSchedulerFactory()
            dim sched as IScheduler = sf.GetScheduler()
LVL 83

Accepted Solution

CodeCruiser earned 1500 total points
ID: 38296761
Did you try?

Dim sf as ISchedularFactory = new StdSchedularFactory()
Dim sched As ISchedular = sf.GetSchedular()

Author Comment

ID: 38312626
That's the syntax I was using, thanks.

I discovered my issue was missing assemblies.

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Integration Management Part 2
Screencast - Getting to Know the Pipeline
Suggested Courses
Course of the Month17 days, 9 hours left to enroll

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question