Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to use .H files in C# programs?
Message
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
C# 1.1
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
MS SQL Server
Divers
Thread ID:
01010555
Message ID:
01010601
Vues:
18
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform