Click here to Skip to main content
15,881,172 members
Home / Discussions / C#
   

C#

 
GeneralCombo Box in ToolBar Pin
azusakt24-Aug-03 23:33
azusakt24-Aug-03 23:33 
GeneralRe: Combo Box in ToolBar Pin
Furty25-Aug-03 5:42
Furty25-Aug-03 5:42 
GeneralRe: Combo Box in ToolBar Pin
Ista25-Aug-03 15:28
Ista25-Aug-03 15:28 
GeneralRe: Combo Box in ToolBar Pin
Nick Parker25-Aug-03 17:40
protectorNick Parker25-Aug-03 17:40 
GeneralRe: Combo Box in ToolBar Pin
Ista25-Aug-03 17:43
Ista25-Aug-03 17:43 
GeneralRe: Combo Box in ToolBar Pin
Nick Parker25-Aug-03 18:31
protectorNick Parker25-Aug-03 18:31 
GeneralRe: Combo Box in ToolBar Pin
Ista26-Aug-03 3:26
Ista26-Aug-03 3:26 
GeneralObject reference not set to an instance of an object. Pin
HJo24-Aug-03 23:16
HJo24-Aug-03 23:16 
Hi,

I am trying to create a C# interface for a dll with functions. The C++ interface for one of the functions looks like this:
<br />
__declspec(dllimport) long _cdecl GetLiveList(<br />
    long, <br />
    long*, <br />
    long*, <br />
    long[]*, <br />
    long);<br />

I declared my C# equivalent as:
<br />
public class Ismbus32<br />
{<br />
//...<br />
<br />
[DllImport("ismbus32.dll", CharSet=CharSet.Auto, CallingConvention=CallingConvention.Cdecl)]<br />
private static extern long GetLiveList(<br />
    long, <br />
    ref long,<br />
    ref long,<br />
    ref long[],<br />
    long);<br />
}<br />

When I try to call the function, using the code below, I get a NullPointerException and the message "Object reference not set to an instance of an object."
<br />
public class Form1 : System.Windows.Forms.Form<br />
{<br />
//...<br />
<br />
private void btn_Click(object sender, System.EventArgs e)<br />
{<br />
long in = 2;<br />
long out1 = 0;<br />
long out2 = 0;<br />
long[] items = new long[635];<br />
long itemsMax = 634;<br />
long lRes = Ismbus32._CDDLG_GetLiveList(in, ref out1, ref out2, ref items, itemsMax);<br />
}<br />
}<br />

Does anyone have a clue?!

Thanks in advance,
/Henrik Johansson
GeneralRe: Object reference not set to an instance of an object. Pin
Roger Stewart25-Aug-03 7:43
professionalRoger Stewart25-Aug-03 7:43 
GeneralRe: Object reference not set to an instance of an object. Pin
HJo25-Aug-03 20:30
HJo25-Aug-03 20:30 
QuestionHow to save/load stream(such as image) to/from database? Pin
xfqiu24-Aug-03 22:46
xfqiu24-Aug-03 22:46 
AnswerRe: How to save/load stream(such as image) to/from database? Pin
Mazdak25-Aug-03 3:03
Mazdak25-Aug-03 3:03 
GeneralRunning webpage Pin
deanoA24-Aug-03 22:14
deanoA24-Aug-03 22:14 
GeneralRe: Running webpage Pin
Mazdak25-Aug-03 4:56
Mazdak25-Aug-03 4:56 
GeneralAccessing Over A NETWORK Pin
deanoA24-Aug-03 20:40
deanoA24-Aug-03 20:40 
GeneralRe: Accessing Over A NETWORK Pin
Julian Bucknall [MSFT]26-Aug-03 7:06
Julian Bucknall [MSFT]26-Aug-03 7:06 
GeneralInheritance w/ 2 Main() methods in Visual Studio .NET C# Pin
Joe McBride24-Aug-03 15:48
Joe McBride24-Aug-03 15:48 
GeneralRe: Inheritance w/ 2 Main() methods in Visual Studio .NET C# Pin
Joe McBride24-Aug-03 18:45
Joe McBride24-Aug-03 18:45 
GeneralWindowsService Questions Pin
Mazdak24-Aug-03 10:49
Mazdak24-Aug-03 10:49 
GeneralRe: WindowsService Questions Pin
Corinna John28-Aug-03 1:39
Corinna John28-Aug-03 1:39 
GeneralRe: WindowsService Questions Pin
Mazdak28-Aug-03 8:02
Mazdak28-Aug-03 8:02 
GeneralRe: WindowsService Questions Pin
Corinna John29-Aug-03 1:46
Corinna John29-Aug-03 1:46 
GeneralRe: WindowsService Questions Pin
Mazdak29-Aug-03 2:40
Mazdak29-Aug-03 2:40 
GeneralRe: WindowsService Questions Pin
Corinna John29-Aug-03 9:50
Corinna John29-Aug-03 9:50 
Generalreading and writting excel format/or using ado.net Pin
djkno324-Aug-03 6:32
djkno324-Aug-03 6:32 

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.