Trying to import a dll in runtime but im getting error: Attribute 'DllImport' is not valid on this d

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
<div style="color:Black;background-color:White; <pre>
<span style="color:Blue; using System;
<span style="color:Blue; using System.Collections.Generic;
<span style="color:Blue; using System.ComponentModel;
<span style="color:Blue; using System.Data;
<span style="color:Blue; using System.Drawing;
<span style="color:Blue; using System.Linq;
<span style="color:Blue; using System.Text;
<span style="color:Blue; using System.Windows.Forms;
<span style="color:Blue; using System.Runtime.InteropServices;

<span style="color:Blue; namespace WindowsFormsApplication1
{
<span style="color:Blue; public <span style="color:Blue; partial <span style="color:Blue; class Form1 : Form
{
[DllImport(<span style="color:#A31515; @"nvapi64.dll", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl, EntryPoint = <span style="color:#A31515; "NvAPI_Initialize")]
<span style="color:Blue; public Form1()
{
InitializeComponent();
}

<span style="color:Blue; private <span style="color:Blue; void Form1_Load(<span style="color:Blue; object sender, EventArgs e)
{

}
}
}
[/code]
<br/>
The error is on the: DllImport<hr class="sig danieli

View the full article
 
Back
Top