Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Interop / July 2003

Tip: Looking for answers? Try searching our database.

Problem with interop

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Fitim Skenderi - 30 Jun 2003 15:57 GMT
Hi everyone,

I am trying to convert the follwoing code from c++ to c#

=====================================================================
c++ code
---------------------------------------------------------------------

typedef short (WINAPI* PAC_ADT_SET_FINGER_STATUS)(
     short FingerStatus,
 (unsigned char)* Image,
 unsigned long RowNumber,
 unsigned long ColumnNumber,
        (unsigned char)* ContinueFlag);

typedef short (WINAPI * PAC_ADT_SET_MESSAGE)(
     int MessageID,
 (unsigned char)* ContinueFlag);

typedef short (WINAPI * PAC_ADT_SET_ADT_STATUS)(
     unsigned char StatusID,
 (unsigned char)* ContinueFlag);

typedef struct _AC_ADT_GUI_CALLBACK
{
   PAC_ADT_SET_FINGER_STATUS AC_ADT_SetFingerStatus;
   PAC_ADT_SET_MESSAGE       AC_ADT_SetMessages;
   PAC_ADT_SET_ADT_STATUS    AC_ADT_SetADTStatus;
} AC_ADT_GUI_CALLBACK, *PAC_ADT_GUI_CALLBACK;

short ADTSPIAPI AC_ADT_SetGUICallbacks(AC_ADT_GUI_CALLBACK
GUICallbackFunction);

=====================================================================

=====================================================================
#c code
---------------------------------------------------------------------

public delegate short PAC_ADT_SET_FINGER_STATUS(
  short FingerStatus,
  IntPtr Image,
  uint RowNumber,
  uint ColumnNumber,
  out byte ContinueFlag);

public delegate short PAC_ADT_SET_MESSAGE(
  int MessageID,
  out byte ContinueFlag);

public delegate short PAC_ADT_SET_ADT_STATUS(
  byte StatusID,
  out byte ContinueFlag);

[StructLayout(LayoutKind.Sequential)]
public class TAC_ADT_GUI_CALLBACK
{
[MarshalAs(UnmanagedType.FunctionPtr)]
public PAC_ADT_SET_FINGER_STATUS AC_ADT_SetFingerStatus;
[MarshalAs(UnmanagedType.FunctionPtr)]
public PAC_ADT_SET_MESSAGE AC_ADT_SetMessages;
[MarshalAs(UnmanagedType.FunctionPtr)]
public PAC_ADT_SET_ADT_STATUS AC_ADT_SetADTStatus;
}

public static extern short AC_ADT_SetGUICallbacks(TAC_ADT_GUI_CALLBACK
GUICallbackFunction);

=====================================================================

everytime I call the function it is comming back with "object instance not
set" exception.

Help will be appretiated

Fitim Skenderi
Fitim Skenderi - 01 Jul 2003 11:00 GMT
Hi all

I found the problem.

Thanks

> Hi everyone,
>
[quoted text clipped - 72 lines]
>
> Fitim Skenderi

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.