Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to use .H files in C# programs?
Message
From
03/05/2005 16:04:25
 
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
C# 1.1
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01010555
Message ID:
01010601
Views:
17
Hi Mike,
Maybe this code help you.
[DllImport("kernel32.dll")]
private extern static IntPtr LoadLibrary(string fileName) ;

[DllImport("kernel32.dll")]
private extern static void FreeLibrary(IntPtr handle) ;

[DllImport("kernel32.dll")]
private extern static IntPtr GetProcAddress(IntPtr handle, string
procName);

//Get the address of Pci from "Winscard.dll".
private IntPtr GetPciT0()
{
  IntPtr handle = LoadLibrary("Winscard.dll") ;
  IntPtr pci = GetProcAddress(handle, "g_rgSCardT0Pci") ;
  FreeLibrary(handle) ;
    return pci ;
}
>I'm calling a Windows API and need to use a constant. In the past, I've just retrieved the value from the .H file and defined it in C#. Now I have to use one defined like this:
>
> #define SCARD_PCI_T0 (&g_rgSCardT0Pci)
>
>Can anyone tell me how to use this in C#?
>
>Thanks,
>Mike
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform