p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


Go Back   p2p.wrox.com Forums > .NET > Other .NET > General .NET
I forgot my password Register Now
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.

Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .NET section of the Wrox p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.

Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old August 11th, 2006, 01:36 PM
Authorized User
Points: 192, Level: 3
Points: 192, Level: 3 Points: 192, Level: 3 Points: 192, Level: 3
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2005
Location: , , .
Posts: 47
Thanks: 0
Thanked 0 Times in 0 Posts
Default Converting C# to VB.net

I have samples of C# code that I need to use to instantiate an object. I need to convert it to VB.net.

I have a dll called ProjectUtilities. It is referenced in .net as "InteractiveSoftworks.VoiceNet.ProjectUtilitie s"

I need to instantiate the ProjectManager object of the dll, but in order to do that it requires certain values to be passed.

Here is the C# code:
Code:
(Class Constructor):
Public ProjectManager(string sSystemDatabase, ScriptModel[] arrScm, IScriptModelFactory objScmFactory)

(Actual instantiation):
ProjectManager pm = new ProjectManager("Voicenet", new ScriptModel [] {scriptmodel.AgentScriptModel, ScriptModel.IVRScriptModel}, new ScriptModelFactory());
The constructor requires 3 arguments
1. A string
2. An array of constants
3. An object

Here is my code in VB.NET:
Code:
Dim oScriptModelFactory As New InteractiveSoftworks.VoiceNet.ProjectUtilities.ScriptModelFactory
Dim oScriptModel As New InteractiveSoftworks.VoiceNet.ProjectUtilities.ScriptModel
Dim arrScriptModel(,)

'I am setting the constants here
Dim sAgentScriptModel = InteractiveSoftworks.VoiceNet.ProjectUtilities.ScriptModel.AgentScriptModel
Dim sIVRScriptModel = InteractiveSoftworks.VoiceNet.ProjectUtilities.ScriptModel.IVRScriptModel

'Now trying to pass them
Dim oProjectManager As New InteractiveSoftworks.VoiceNet.ProjectUtilities.ProjectManager("NG2468", arrScriptModel(sAgentScriptModel, sIVRScriptModel), oScriptModelFactory)

I'm getting Object Refernce Not Set to Instance of Object
Am I passing the array incorrectly?

I would appreciate any help,
Ninel

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
help, converting vb.net few lines to C# nesrine C# 3 March 6th, 2007 10:43 AM
help, converting vb.net few lines to C# nesrine ASP.NET 2.0 Professional 1 March 5th, 2007 07:10 AM
Problem Converting C# to VB.NET in ASP.NET kwilliams ASP.NET 2.0 Basics 0 February 9th, 2007 06:22 PM
converting code from c# to VB.net drachx General .NET 0 October 21st, 2004 12:19 AM
converting DTS package from VB 6 to VB .NET petroleo Pro VB Databases 0 August 18th, 2003 06:01 PM



All times are GMT -4. The time now is 07:31 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© 2008 Wiley Publishing, Inc