fbpx
Welcome, Guest
Username: Password: Remember me
Visual Objects

Please use this forum to post questions about Visual Objects and Vulcan.NET
  • Page:
  • 1

TOPIC: Index file error

Index file error 1 year 7 months ago #1

I am looking at using XSharp to convert a DLL written in VO (2.6), which uses DBF files with NTX indexes, using DBUseArea() and DBSetIndex(). I have got a clean build, and if I call it from a simple X# test application it works fine, but if I call it from a similar C# application, the DLL opens the DBF file OK but fails to set the index. The index expression is a simple concatenation of three string fields. The error is:

Vulcan.NET Runtime Error
Error Code: 7 [Syntax error]
Error Subcode: 1022 [Expression for macro compiler is invalid]
Filename: "DBFNTX.Compile"
Subsystem: DBFNTX
Function: ORDLISTADD
Call Stack:
at Vulcan.Error.Throw(__Usual[] $args)
at VulcanRTFuncs.Functions.DefError(Error oError)
at VulcanRTFuncs.Functions.DoError(String nSymFunc, __Usual nTries)
at VulcanRTFuncs.Functions.DoError(String nSymFunc)
at VulcanRTFuncs.Functions.OrdListAdd(__Usual[] $args)
at VulcanRTFuncs.Functions.DBSetIndex(__Usual[] $args)
at XSharpTestLib.TestDBF.Open(__Usual[] Xs$Args) in C:\XSharp Test\XTestLib\XSharpTestLib\XSharpTestLib\TestDBF.prg:line 21

I have found that the same error happens if the X# test application has its dialect set to Core, even if the DLL’s dialect is set to VO. Is there any way this DLL can be run from a C# application?
Thanks,
Mike.

Please Log in or Create an account to join the conversation.

Index file error 1 year 7 months ago #2

  • wriedmann
  • wriedmann's Avatar
  • Away
  • Posts: 1406
  • Karma: 6
Hi Mike,

X# and Vulcan.NET are making some calls to initialize the runtime. If you are calling the DLL from a C# application, then you need to make this yourself.

Since you already have a Vulcan installation, you can find the basics here:

Basically, in C# you need a code like the following:
class VulcanLoader
{

void InitVulcan()
{
   System.Reflection.MethodInfo mi = typeof( VulcanLoader).GetMethod( "InitVulcan" );
   Vulcan.Runtime.State.AppModule = mi.Module;
}
}

Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
This email address is being protected from spambots. You need JavaScript enabled to view it.
www.riedmann.it - docs.xsharp.it
Attachments:

Please Log in or Create an account to join the conversation.

Index file error 1 year 7 months ago #3

Yes, that worked.
Many thanks,
Mike.

Please Log in or Create an account to join the conversation.

  • Page:
  • 1