Click here to Skip to main content
15,891,687 members
Home / Discussions / C#
   

C#

 
GeneralRe: serialize hashtable within another hashtable Pin
Robert Rohde1-Feb-05 3:38
Robert Rohde1-Feb-05 3:38 
GeneralScrollBar is disappeareing Pin
FocusedWolf31-Jan-05 16:19
FocusedWolf31-Jan-05 16:19 
GeneralRe: ScrollBar is disappeareing Pin
Stefan Troschuetz31-Jan-05 21:25
Stefan Troschuetz31-Jan-05 21:25 
GeneralRe: ScrollBar is disappeareing Pin
FocusedWolf1-Feb-05 9:50
FocusedWolf1-Feb-05 9:50 
GeneralRe: ScrollBar is disappeareing Pin
FocusedWolf1-Feb-05 10:04
FocusedWolf1-Feb-05 10:04 
Generalemail Pin
Anonymous31-Jan-05 15:47
Anonymous31-Jan-05 15:47 
GeneralRe: email Pin
Corinna John31-Jan-05 20:52
Corinna John31-Jan-05 20:52 
GeneralRe: email Pin
Esmo20001-Feb-05 2:22
Esmo20001-Feb-05 2:22 
GeneralRe: email Pin
Anonymous1-Feb-05 11:58
Anonymous1-Feb-05 11:58 
GeneralRe: email Pin
Anonymous1-Feb-05 12:30
Anonymous1-Feb-05 12:30 
GeneralListView with a multiline ColumnHeader Pin
Lin Qi31-Jan-05 15:35
Lin Qi31-Jan-05 15:35 
GeneralVBA to C# dll Addin Pin
mitsemaj31-Jan-05 13:53
mitsemaj31-Jan-05 13:53 
GeneralRe: VBA to C# dll Addin Pin
Heath Stewart31-Jan-05 14:01
protectorHeath Stewart31-Jan-05 14:01 
GeneralRe: VBA to C# dll Addin Pin
mitsemaj31-Jan-05 15:24
mitsemaj31-Jan-05 15:24 
GeneralUsing SHFILEINFO to retrieve Special Folder Icons Pin
Drakkhen31-Jan-05 13:20
Drakkhen31-Jan-05 13:20 
GeneralRe: Using SHFILEINFO to retrieve Special Folder Icons Pin
Heath Stewart31-Jan-05 13:48
protectorHeath Stewart31-Jan-05 13:48 
Generalevent invocation Pin
cchere31-Jan-05 12:59
cchere31-Jan-05 12:59 
GeneralRe: event invocation Pin
Heath Stewart31-Jan-05 13:28
protectorHeath Stewart31-Jan-05 13:28 
GeneralRe: event invocation Pin
cchere31-Jan-05 18:05
cchere31-Jan-05 18:05 
GeneralRe: event invocation Pin
Heath Stewart1-Feb-05 6:10
protectorHeath Stewart1-Feb-05 6:10 
GeneralRe: event invocation Pin
cchere4-Feb-05 4:34
cchere4-Feb-05 4:34 
Generalcalling C++ dll function in C# Pin
isamir31-Jan-05 12:25
isamir31-Jan-05 12:25 
Hi,

I am trying to calling Visual C++ dll function in C#.

This is function I am trying to call from dll.

float CMD_RD(int port, int address, int *err_type, int *err_attr)

Here is my code.

public class OmegaBusWrap
{
[DllImport("C:\\work\\Eco-now\\Code\\OmegaBus\\OmegaLib\\cmd_dll.DLL",
EntryPoint="CMD_RD", SetLastError=true,
CharSet=CharSet.Auto, ExactSpelling=true,
CallingConvention=CallingConvention.StdCall)]
public static extern float CMD_RD(int port, int ddress,IntPtr
err_type, IntPtr err_attr);
}

Here I am calling this function in my code

IntPtr err_type = new IntPtr(0);
IntPtr err_att = new IntPtr(0);

float fvalue;

try
{
fvalue = OmegaBusWrap.CMD_RD(m_PortNo,1,err_type,err_att);
}
catch(Exception e)
{
Debug.WriteLine(e.ToString());
}


I got exception this exception

System.NullReferenceException: Object reference not set to an instance of an object.
at OmegaBusSerial.OmegaBusWrap.CMD_RD(Int32 port, Int32 address, IntPtr err_type, IntPtr err_attr)

What I am doing wrong, How can I solve this problem.

Thanks.
GeneralRe: calling C++ dll function in C# Pin
Heath Stewart31-Jan-05 13:14
protectorHeath Stewart31-Jan-05 13:14 
GeneralRotate Flip Image isn't working Pin
adonisv31-Jan-05 12:17
adonisv31-Jan-05 12:17 
GeneralRe: Rotate Flip Image isn't working Pin
Charlie Williams31-Jan-05 12:32
Charlie Williams31-Jan-05 12: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.