Click here to Skip to main content
15,887,027 members
Home / Discussions / C#
   

C#

 
AnswerRe: Running a program as an Administrator Pin
Luc Pattyn14-Jun-12 17:54
sitebuilderLuc Pattyn14-Jun-12 17:54 
AnswerRe: Running a program as an Administrator Pin
Bernhard Hiller14-Jun-12 21:44
Bernhard Hiller14-Jun-12 21:44 
AnswerRe: Running a program as an Administrator Pin
DaveyM6915-Jun-12 0:28
professionalDaveyM6915-Jun-12 0:28 
Questionhow can i make double right click for button C# Pin
Member 401482414-Jun-12 9:40
Member 401482414-Jun-12 9:40 
SuggestionRe: how can i make double right click for button C# Pin
Sandeep Mewara14-Jun-12 10:50
mveSandeep Mewara14-Jun-12 10:50 
GeneralRe: how can i make double right click for button C# Pin
Wes Aday14-Jun-12 11:23
professionalWes Aday14-Jun-12 11:23 
AnswerRe: how can i make double right click for button C# Pin
PIEBALDconsult14-Jun-12 18:48
mvePIEBALDconsult14-Jun-12 18:48 
QuestionCOM/OLE: VB2010 code working - Similar C#2010 code not working? Pin
ToBick14-Jun-12 2:32
ToBick14-Jun-12 2:32 
Hi,

i want to develop a program in C# which reads and analyzes values from Pulse LabShop (a Bruel & Kjaer tool to measure & analyze acoustics).

With a VB2010 example i found i was able to read out values via the COM&OLE interface:

-------------------------------------------

Public Class Form1

Dim myPulse As PulseLabShop.Application
Dim myDataSet As PulseLabShop.BKDataSet

Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click

myPulse = CreateObject("Pulse.LabShop.Application")

myPulse.Visible = True

Me.Text = "ControlPULSE " + myPulse.Name

Label1.Text = myPulse.Project.FunctionOrganiser.FunctionGroups(1).Name

End Sub

---------------------------------------

Now i wanted to code the same in C# 2010:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace C_PulseTest
{
public partial class Form1 : Form
{

PulseLabShop.Application myPulse;
PulseLabShop.BKDataSet myDataSet;

public Form1()
{
InitializeComponent();
}

private void button1_Click(object sender, EventArgs e)
{

myPulse = new PulseLabShop.Application("Pulse.LabShop.Application");

myPulse.Visible = true;

this.Text = "ControlPULSE " + myPulse.Name;

label1.Text = myPulse.Project.FunctionOrganiser.FunctionGroups(1).Name;

}
}
}

However the code is not working due to an error in the last line:

Invalid index. (Exception from HRESULT: 0x8002000B (DISP_E_BADINDEX))

I also tried [0] or [1] or ("string") as index - but all with the same error...

Is there something wrong in general with my C# code?

Any other idea why the index is not working?

Thanks a lot for all possible help!

BR
Tobias
AnswerRe: COM/OLE: VB2010 code working - Similar C#2010 code not working? Pin
Pete O'Hanlon14-Jun-12 3:03
mvePete O'Hanlon14-Jun-12 3:03 
GeneralRe: COM/OLE: VB2010 code working - Similar C#2010 code not working? Pin
ToBick14-Jun-12 3:08
ToBick14-Jun-12 3:08 
GeneralRe: COM/OLE: VB2010 code working - Similar C#2010 code not working? Pin
Pete O'Hanlon14-Jun-12 3:22
mvePete O'Hanlon14-Jun-12 3:22 
GeneralRe: COM/OLE: VB2010 code working - Similar C#2010 code not working? Pin
ToBick14-Jun-12 4:35
ToBick14-Jun-12 4:35 
GeneralRe: COM/OLE: VB2010 code working - Similar C#2010 code not working? Pin
Pete O'Hanlon14-Jun-12 4:46
mvePete O'Hanlon14-Jun-12 4:46 
GeneralRe: COM/OLE: VB2010 code working - Similar C#2010 code not working? Pin
ToBick14-Jun-12 18:46
ToBick14-Jun-12 18:46 
GeneralRe: COM/OLE: VB2010 code working - Similar C#2010 code not working? Pin
ToBick14-Jun-12 21:07
ToBick14-Jun-12 21:07 
GeneralRe: COM/OLE: VB2010 code working - Similar C#2010 code not working? Pin
Pete O'Hanlon14-Jun-12 22:15
mvePete O'Hanlon14-Jun-12 22:15 
QuestionFinal Year Project Pin
mhamidnasir13-Jun-12 20:53
mhamidnasir13-Jun-12 20:53 
AnswerRe: Final Year Project PinPopular
OriginalGriff13-Jun-12 21:28
mveOriginalGriff13-Jun-12 21:28 
AnswerRe: Final Year Project Pin
Richard MacCutchan13-Jun-12 22:27
mveRichard MacCutchan13-Jun-12 22:27 
AnswerRe: Final Year Project Pin
Pete O'Hanlon13-Jun-12 22:31
mvePete O'Hanlon13-Jun-12 22:31 
AnswerRe: Final Year Project Pin
Dave Kreskowiak14-Jun-12 2:16
mveDave Kreskowiak14-Jun-12 2:16 
GeneralRe: Final Year Project Pin
Manfred Rudolf Bihy14-Jun-12 3:31
professionalManfred Rudolf Bihy14-Jun-12 3:31 
GeneralRe: Final Year Project Pin
Dave Kreskowiak14-Jun-12 3:38
mveDave Kreskowiak14-Jun-12 3:38 
GeneralRe: Final Year Project Pin
PIEBALDconsult14-Jun-12 4:07
mvePIEBALDconsult14-Jun-12 4:07 
AnswerRe: Final Year Project Pin
Paul Conrad14-Jun-12 6:47
professionalPaul Conrad14-Jun-12 6:47 

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.