Changing to StdCall seems to have fixed it. Thanks.
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Show posts Menu
using System;
using System.Text;
using Microsoft.CSharp;
using System.Runtime.InteropServices;
class NewLispDLL
{
[DllImport("C:\Program Files\newlisp\newLisp.dll", EntryPoint = "newlispEvalStr", CallingConvention = CallingConvention.Cdecl)]
private static extern System.Text.StringBuilder newlispEvalStr(string txt);
public static string Eval(string LispExpression)
{
System.Text.StringBuilder ResultObject;
ResultObject = newlispEvalStr(LispExpression);
return ResultObject.ToString();
}
}
using System;
using System.Collections.Generic;
using System.Text;
namespace NewLispTest
{
class Program
{
static void Main(string[] args)
{
string strCmd = "(+ 2 2)";
string txt = "";
txt = NewLispDLL.Eval(strCmd);
Console.WriteLine(txt);
Console.ReadLine();
}
}
}
Quote
Debugger entered--Lisp error: (error "Invalid escape character syntax")
eval-buffer(#<buffer *load*<2>> nil "nl-docstrings" nil t)
load-with-code-conversion("c:/home/emacs-21.3/lisp/nl-docstrings.el" "nl-docstrings" nil t)
require(nl-docstrings)
eval-buffer(#<buffer *load*> nil "~/.emacs" nil t)
load-with-code-conversion("c:/.emacs" "~/.emacs" t t)
load("~/.emacs" t t)