Click here to Skip to main content
15,909,896 members
Home / Discussions / C#
   

C#

 
GeneralRe: Implementing a list of abstract objects... Pin
faheemnadeem1-Jul-11 13:52
faheemnadeem1-Jul-11 13:52 
GeneralRe: Implementing a list of abstract objects... Pin
Philippe Mori1-Jul-11 15:16
Philippe Mori1-Jul-11 15:16 
GeneralRe: Implementing a list of abstract objects... Pin
faheemnadeem1-Jul-11 15:41
faheemnadeem1-Jul-11 15:41 
GeneralRe: Implementing a list of abstract objects... Pin
Philippe Mori1-Jul-11 16:30
Philippe Mori1-Jul-11 16:30 
GeneralRe: Implementing a list of abstract objects... Pin
faheemnadeem1-Jul-11 18:09
faheemnadeem1-Jul-11 18:09 
GeneralRe: Implementing a list of abstract objects... Pin
Philippe Mori2-Jul-11 3:30
Philippe Mori2-Jul-11 3:30 
GeneralRe: Implementing a list of abstract objects... Pin
faheemnadeem2-Jul-11 4:08
faheemnadeem2-Jul-11 4:08 
QuestionC# to MATLAB connectivity in windows 7 Pin
Sa na1-Jul-11 9:03
Sa na1-Jul-11 9:03 
Hello,
I am trying to connect c# with MATLAB. I used the deploytool in MATLAB to get the dll file to be used in my c# application. I followed the steps by step example from
MATHWORKS tells for its connectivity with c#[^].

After building my c# project, when I run, it stops working and shows run time exception as follows:

Unhandled Exception: System.TypeInitializationException: The type initializer for 'test.testclass' threw an exception. ---> System.BadImageFormatException: An attempt was made to load a program with an incorrect format. (Exception from HRESULT:0x8007000B)
at MathWorks.MATLAB.NET.Utility.MWMCR.mclInitializeApplication(String[] start
upOptions, Int32 startupOptionsCount)
at MathWorks.MATLAB.NET.Utility.MWMCR.InitializeApplication(String[] startupOptions)
at test.testclass..cctor()
--- End of inner exception stack trace ---
at test.testclass..ctor()
at mainApp_test.Program.Main(String[] args) in C:\Users\Abro\Documents\Visual
Studio 2008\Projects\mainApp_test\mainApp_test\Program.cs:line 44
Press any key to continue . . .

Can anyone help me solving this problem?

I am using MATLAB version 7.3, visual studio 8, windows 7 home premium, 64-bit operating system

my c# code is:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using test;
using MathWorks.MATLAB.NET.Arrays;
using MathWorks.MATLAB.NET.Utility;


namespace mainApp_test
{
class Program
{
static void Main(string[] args)
{
testclass obj = null;
double[] a = new double[1] { 10 };
double[] b = new double[1] { 33 };
MWNumericArray mwnA = new MWNumericArray(a);
MWNumericArray mwnB = new MWNumericArray(b);
MWArray[] result =null;
try
{
obj = new testclass();
result = obj.addMatlab(mwnA,mwnB);
MWNumericArray output = (MWNumericArray)result.ToArray();
Console.WriteLine(output);
}
catch(Exception)
{
throw;
}
}
}
}
AnswerRe: C# to MATLAB connectivity in windows 7 Pin
Dave Kreskowiak1-Jul-11 11:10
mveDave Kreskowiak1-Jul-11 11:10 
GeneralRe: C# to MATLAB connectivity in windows 7 Pin
Sa na2-Jul-11 1:13
Sa na2-Jul-11 1:13 
GeneralRe: C# to MATLAB connectivity in windows 7 Pin
Sa na2-Jul-11 2:52
Sa na2-Jul-11 2:52 
QuestionIs file mapping supported in microsoft .net framework Pin
Danzy831-Jul-11 5:26
Danzy831-Jul-11 5:26 
AnswerRe: Is file mapping supported in microsoft .net framework Pin
Ennis Ray Lynch, Jr.1-Jul-11 6:06
Ennis Ray Lynch, Jr.1-Jul-11 6:06 
QuestionHow do I monitor bytes per second written or read from a directory (and sub-directories)? Pin
bbranded1-Jul-11 5:16
bbranded1-Jul-11 5:16 
AnswerRe: How do I monitor bytes per second written or read from a directory (and sub-directories)? Pin
Dave Kreskowiak1-Jul-11 7:14
mveDave Kreskowiak1-Jul-11 7:14 
GeneralRe: How do I monitor bytes per second written or read from a directory (and sub-directories)? Pin
bbranded1-Jul-11 9:10
bbranded1-Jul-11 9:10 
GeneralRe: How do I monitor bytes per second written or read from a directory (and sub-directories)? Pin
Dave Kreskowiak1-Jul-11 11:07
mveDave Kreskowiak1-Jul-11 11:07 
Questionquestion Pin
ivan_go1-Jul-11 1:57
ivan_go1-Jul-11 1:57 
AnswerRe: question PinPopular
Pete O'Hanlon1-Jul-11 2:19
mvePete O'Hanlon1-Jul-11 2:19 
QuestionConvert SQL Data Type To C# Pin
Kevin Marois30-Jun-11 15:49
professionalKevin Marois30-Jun-11 15:49 
AnswerRe: Convert SQL Data Type To C# Pin
Not Active30-Jun-11 16:01
mentorNot Active30-Jun-11 16:01 
AnswerRe: Convert SQL Data Type To C# Pin
OriginalGriff30-Jun-11 22:08
mveOriginalGriff30-Jun-11 22:08 
AnswerRe: Convert SQL Data Type To C# Pin
Shameel30-Jun-11 22:30
professionalShameel30-Jun-11 22:30 
AnswerRe: Convert SQL Data Type To C# Pin
Mario Majčica1-Jul-11 0:31
professionalMario Majčica1-Jul-11 0:31 
AnswerRe: Convert SQL Data Type To C# Pin
PIEBALDconsult1-Jul-11 2:45
mvePIEBALDconsult1-Jul-11 2:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.