Click here to Skip to main content
15,907,395 members
Home / Discussions / C#
   

C#

 
GeneralRe: Develop Windows Application with Add-Ins Pin
Roger Stewart23-Sep-04 11:08
professionalRoger Stewart23-Sep-04 11:08 
GeneralRe: Develop Windows Application with Add-Ins Pin
shawaj23-Sep-04 12:54
shawaj23-Sep-04 12:54 
GeneralRe: Develop Windows Application with Add-Ins Pin
Nnamdi Onyeyiri23-Sep-04 13:21
Nnamdi Onyeyiri23-Sep-04 13:21 
GeneralNullReferenceException Pin
Anonymous23-Sep-04 9:49
Anonymous23-Sep-04 9:49 
GeneralRe: NullReferenceException Pin
Heath Stewart23-Sep-04 10:20
protectorHeath Stewart23-Sep-04 10:20 
GeneralPassword Textbox for Datagrid Pin
macsgirl23-Sep-04 8:45
macsgirl23-Sep-04 8:45 
GeneralRe: Password Textbox for Datagrid Pin
Heath Stewart23-Sep-04 11:37
protectorHeath Stewart23-Sep-04 11:37 
General.NET load of DLL in privatePath failing -- HELP!!!! Pin
LongRange.Shooter23-Sep-04 8:19
LongRange.Shooter23-Sep-04 8:19 
GeneralRe: .NET load of DLL in privatePath failing -- HELP!!!! Pin
Heath Stewart23-Sep-04 10:41
protectorHeath Stewart23-Sep-04 10:41 
GeneralRe: .NET load of DLL in privatePath failing -- HELP!!!! Pin
LongRange.Shooter23-Sep-04 11:07
LongRange.Shooter23-Sep-04 11:07 
GeneralRe: .NET load of DLL in privatePath failing -- HELP!!!! Pin
Heath Stewart23-Sep-04 11:21
protectorHeath Stewart23-Sep-04 11:21 
GeneralRe: .NET load of DLL in privatePath failing -- HELP!!!! Pin
LongRange.Shooter24-Sep-04 4:40
LongRange.Shooter24-Sep-04 4:40 
GeneralRe: .NET load of DLL in privatePath failing -- HELP!!!! Pin
Heath Stewart24-Sep-04 5:36
protectorHeath Stewart24-Sep-04 5:36 
GeneralRe: Basic EventHandling Question Pin
Heath Stewart23-Sep-04 7:21
protectorHeath Stewart23-Sep-04 7:21 
GeneralRe: Basic EventHandling Question Pin
SandeepN23-Sep-04 8:49
SandeepN23-Sep-04 8:49 
GeneralRe: Basic EventHandling Question Pin
Heath Stewart23-Sep-04 10:53
protectorHeath Stewart23-Sep-04 10:53 
GeneralRe: Basic EventHandling Question Pin
SandeepN24-Sep-04 4:32
SandeepN24-Sep-04 4:32 
GeneralHowto: Lock my ArrayList collection. Pin
matthias s.23-Sep-04 6:47
matthias s.23-Sep-04 6:47 
GeneralRe: Howto: Lock my ArrayList collection. Pin
Heath Stewart23-Sep-04 7:34
protectorHeath Stewart23-Sep-04 7:34 
GeneralRe: Howto: Lock my ArrayList collection. Pin
Werdna23-Sep-04 10:29
Werdna23-Sep-04 10:29 
GeneralBasic EventHandling Question Pin
SandeepN23-Sep-04 6:42
SandeepN23-Sep-04 6:42 
GeneralInterfacing with C Vendor DLLs Pin
Evelyne23-Sep-04 4:53
Evelyne23-Sep-04 4:53 
1. my vendor interface is defined in an h & c file:

_EXTERN S16BIT _DECL aceSetIrqConditions(S16BIT DevNum, U16BIT bEnable,
U32BIT dwIrqMask,void(_DECL *funcExternalIsr)(S16BIT DevNum, U32BIT
dwIrqStatus))

void _DECL Callback(S16BIT DevNum, U32BIT dwIrqStatus);

/* Configure user callback ISR and enable EOM interrupts */
aceSetIrqConditions(DevNum, TRUE, ACE_IMR1_BC_MSG_EOM, Callback);

void _DECL Callback(S16BIT DevNum, U32BIT dwIrqStatus)
{
/* this is what I would write, I would like to get here with C#
}

2. I am trying to use the vendor interface for the above
aceSetIrqConditions() to call an interrup routine I write (eomInterrupt).
This is my C# effort, it compiles, but when I try to execute this, I get an
Error, see below:

// EOM Interrupt declaration
public delegate void Callback(short DevNum, uint dwIrqStatus);

[DllImport("C:\\acs\\bin\\Release\\emace_32.dll")]
public extern static short aceSetIrqConditions(short DevNum, ushort bEnable,
uint dwIrqMask, Callback cbm);

Callback cbm = new Callback(eomInterrupt);

aceSetIrqConditions(devNum, 1, ACS1553.ACE_IMR1_BC_MSG_EOM, cbm);

public void eomInterrupt(short DevNum, uint dwIrqStatus)
{
/* *** never gets to statement below! *** */
if((dwIrqStatus & ACS1553.ACE_IMR1_BC_MSG_EOM) != 0)
{
irqCount++;
}
}

The error is:
Debug Error!

File:i386\chkesp.c, Line 42.

The value of ESP was not properly saved across a function call. This is
usually a result of calling a function declared with one calling convention
with a function pointer declared with a different calling convention.

The program runs fine, except when I added above. What am I doing wrong???

Thanks,

--
Evelyne



Expand AllCollapse All

Evelyne S. Mitchell
GeneralRe: Interfacing with C Vendor DLLs Pin
Heath Stewart23-Sep-04 6:58
protectorHeath Stewart23-Sep-04 6:58 
GeneralRe: Interfacing with C Vendor DLLs Pin
Evelyne23-Sep-04 8:47
Evelyne23-Sep-04 8:47 
GeneralRe: Interfacing with C Vendor DLLs Pin
Heath Stewart23-Sep-04 10:17
protectorHeath Stewart23-Sep-04 10:17 

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.