Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Clarion8 DLL within C#.NET - Simply won't work!

82 views
Skip to first unread message

Anderson Matos

unread,
Mar 18, 2013, 7:43:42 PM3/18/13
to
Hello,

I'm trying to call some functions that where built using Clarion within my C# code for some app interop and data exchange.

I'm not into the "create an EXE and call it with parameters" so there is no point into answering this. I know that it works but it has some side-effects that I can't afford.

Here is how the function was created:

-- MultiDLL solution.
-- Global.App (the glogal project that is referenced everywhere and holds dictionary into).

1. Inside Global.App, I've created a New Procedure with:

- Name: GetNumber
- Procedure Type: ClassABC Source Procedure
- Prototype: (long num),LONG,PASCAL
- Actions > Parameters: (long num)
- Declare global: true
- Export: true


2. Inside this procedure, within Embeds > Processed Code, I've placed a Source with this code:

MESSAGE('Just a test')
RETURN(150)


3. Compiled just fine.

4. On the .NET startup project, I've placed:

[DllImport(@"C:\Dev\Clarion8\P1\BuildRelease\Global.dll", EntryPoint = "GETNUMBER")]
public static extern int GetNumber(int num);

static void Main()
{
int result = GetNumber(10);
}


--

Running this code throws an exception saying that the DLL could not be loaded because the entrypoint was not found.

I've triple-checked the EntryPoint within DependencyWalker and LibMaker and the generated name is "GETNUMBER" (upper case on both).

Other DLL (from Windows API, Delphi, C and C++) work pretty fine.
Just this one from Clarion that does not work at all.


Any clue why?

Leonid Chudakov

unread,
Mar 22, 2013, 9:41:05 PM3/22/13
to
Try changing prototype to
(long num),LONG,PASCAL,NAME('GETNUMBER')

Leonid Chudakov
chud...@klarisoft.com
0 new messages