Click here to Skip to main content
15,897,371 members
Home / Discussions / C#
   

C#

 
AnswerRe: Windows Service Question Pin
Le centriste14-Apr-09 8:52
Le centriste14-Apr-09 8:52 
AnswerRe: Windows Service Question Pin
#realJSOP14-Apr-09 9:06
professional#realJSOP14-Apr-09 9:06 
GeneralRe: Windows Service Question Pin
PIEBALDconsult14-Apr-09 17:55
mvePIEBALDconsult14-Apr-09 17:55 
GeneralRe: Windows Service Question Pin
#realJSOP15-Apr-09 0:34
professional#realJSOP15-Apr-09 0:34 
GeneralRe: Windows Service Question Pin
PIEBALDconsult15-Apr-09 4:32
mvePIEBALDconsult15-Apr-09 4:32 
AnswerRe: Windows Service Question Pin
Eddy Vluggen14-Apr-09 10:01
professionalEddy Vluggen14-Apr-09 10:01 
AnswerRe: Windows Service Question Pin
PIEBALDconsult14-Apr-09 17:54
mvePIEBALDconsult14-Apr-09 17:54 
QuestionProblem linking with C++ function Pin
Alan Balkany14-Apr-09 8:01
Alan Balkany14-Apr-09 8:01 
Hi all,

I'm having a problem using DllImport in C# to call a C++ function.

C++ Header File:

DLLEXPORT int drawMarkupOnLine (int jobId, int lineNumber, short* line, int drawMode);


C++ Source File:

DLLEXPORT int drawMarkupOnLine (int jobId, int lineNumber, short* line, int drawMode)
{
...
}

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

C# Source File:

[DllImport("vdrdll.dll", EntryPoint = @"?drawMarkupOnLine@@YAHHHPAFH@Z")]

unsafe static extern int drawMarkupOnLine(int jobId, int lineNumber, short* line, int drawMode);


...

short* scan0 = (short*)bmd.Scan0;	// Start of image.
short* nextScanLine = scan0;		// First scan line.
drawMarkupOnLine (0, i, nextScanLine, lca[i]);

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

When I try to call the function, I get an EntryPointNotFoundException, with message, "Unable to find an entry point named '?drawMarkupOnLine@@YAHHHPAFH@Z' in DLL 'vdrdll.dll'."

I've tried various permutations of IntPtr, string pointers, and void pointers for the third parameter (which I'm assuming is causing the problem), but nothing seems to work. (Other functions with only int parameters work just fine.) Can someone suggest a reliable way to get this to link?

Thanks,
Alan
AnswerRe: Problem linking with C++ function Pin
Luc 64801114-Apr-09 8:12
Luc 64801114-Apr-09 8:12 
GeneralRe: Problem linking with C++ function Pin
Alan Balkany14-Apr-09 8:25
Alan Balkany14-Apr-09 8:25 
AnswerRe: Problem linking with C++ function Pin
Alan Balkany14-Apr-09 8:31
Alan Balkany14-Apr-09 8:31 
GeneralRe: Problem linking with C++ function Pin
Luc 64801114-Apr-09 8:42
Luc 64801114-Apr-09 8:42 
GeneralRe: Problem linking with C++ function Pin
Alan Balkany14-Apr-09 8:46
Alan Balkany14-Apr-09 8:46 
GeneralRe: Problem linking with C++ function Pin
Luc 64801114-Apr-09 9:36
Luc 64801114-Apr-09 9:36 
GeneralRe: Problem linking with C++ function Pin
Alan Balkany14-Apr-09 10:00
Alan Balkany14-Apr-09 10:00 
GeneralRe: Problem linking with C++ function Pin
Luc 64801114-Apr-09 10:19
Luc 64801114-Apr-09 10:19 
GeneralRe: Problem linking with C++ function Pin
Alan Balkany14-Apr-09 10:35
Alan Balkany14-Apr-09 10:35 
GeneralRe: Problem linking with C++ function Pin
Luc 64801114-Apr-09 10:57
Luc 64801114-Apr-09 10:57 
GeneralRe: Problem linking with C++ function Pin
Luc 64801114-Apr-09 11:10
Luc 64801114-Apr-09 11:10 
GeneralRe: Problem linking with C++ function Pin
Alan Balkany14-Apr-09 11:20
Alan Balkany14-Apr-09 11:20 
GeneralRe: Problem linking with C++ function Pin
Luc 64801114-Apr-09 11:22
Luc 64801114-Apr-09 11:22 
QuestionWindows Mobile USB Port Pin
Justin Talley14-Apr-09 6:57
Justin Talley14-Apr-09 6:57 
AnswerRe: Windows Mobile USB Port Pin
Giorgi Dalakishvili14-Apr-09 8:15
mentorGiorgi Dalakishvili14-Apr-09 8:15 
GeneralRe: Windows Mobile USB Port Pin
Justin Talley15-Apr-09 6:44
Justin Talley15-Apr-09 6:44 
Questionhow to write '&' in xml Pin
novhard14-Apr-09 6:46
novhard14-Apr-09 6:46 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.