G
Guest
I need to p/invoke this win32 dll: (main parts of it
named: thelib.dl
(compiled with visual c++ 6
#define WINVER 0x50
#include <windows.h
#include <ras.h
#ifdef _cplusplu
#define EXPORT extern "C" _declspec(dllexport
#els
#define EXPORT _declspec (dllexport
#endi
BOOL WINAPI DllMain( HANDLE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserve
return TRUE
EXPORT BOOL CALLBACK thelibfunction(
//stuff (mosty ras functions
return true
i have put the dll directly at c:, for test purposes
the c# propram, in which i invoke (parts of it
using System
using System.Drawing
using System.Collections
using System.ComponentModel
using System.Windows.Forms
using System.Data
using System.Runtime.InteropServices
namespace dllimportin
public class Form1 : System.Windows.Forms.For
[DllImport("c:\\thelib.dll", EntryPoint="thelibfunction", ExactSpelling=true, CharSet=CharSet.Auto)
public static extern bool thelibfunction()
//constructor stuff and els
...
private void Form1_Load(object sender, System.EventArgs e
thelibfunction()
if i run this, i get the failure: The entrypoint 'mylibfunction' was not found in c:\thelib.dl
if i change the DllImport line to this: [DllImport("c:\\thelib.dll")], and touch nothing else, the same failure appears too
Any idea what the failure is? Thanks.
named: thelib.dl
(compiled with visual c++ 6
#define WINVER 0x50
#include <windows.h
#include <ras.h
#ifdef _cplusplu
#define EXPORT extern "C" _declspec(dllexport
#els
#define EXPORT _declspec (dllexport
#endi
BOOL WINAPI DllMain( HANDLE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserve
return TRUE
EXPORT BOOL CALLBACK thelibfunction(
//stuff (mosty ras functions
return true
i have put the dll directly at c:, for test purposes
the c# propram, in which i invoke (parts of it
using System
using System.Drawing
using System.Collections
using System.ComponentModel
using System.Windows.Forms
using System.Data
using System.Runtime.InteropServices
namespace dllimportin
public class Form1 : System.Windows.Forms.For
[DllImport("c:\\thelib.dll", EntryPoint="thelibfunction", ExactSpelling=true, CharSet=CharSet.Auto)
public static extern bool thelibfunction()
//constructor stuff and els
...
private void Form1_Load(object sender, System.EventArgs e
thelibfunction()
if i run this, i get the failure: The entrypoint 'mylibfunction' was not found in c:\thelib.dl
if i change the DllImport line to this: [DllImport("c:\\thelib.dll")], and touch nothing else, the same failure appears too
Any idea what the failure is? Thanks.