• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

shapelib.dll crash - SBX 3.14

rhumbaflappy

Administrator
Staff member
Resource contributor
Messages
5,943
Country
us-wisconsin
There should be no reason to register shapelib.dll. That is not the problem.

Dick
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
32,883
Country
netherlands
C style DLL files can't be registered, that's only for COM DLL files, etc.

Since the same software runs fine for other people on 64 bit, I don't think the DLL files got mixed up either. It must be some OS related problem.
 

rhumbaflappy

Administrator
Staff member
Resource contributor
Messages
5,943
Country
us-wisconsin
As Arno writes, this is a problem with the operating system or the users' configuration of the operating system.

Dick
 
Messages
1,243
Country
canada
Looks like I can replicate this error. Using the KGPI file. get the same error.

System.AccessViolationException was unhandled
HResult=-2147467261
Message=Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
Source=SBuilderX
StackTrace:
at SBuilderX.moduleSHAPE.DBFAddField(Int32 hdbf, String& pszFieldName, DBFFieldType eType, Int32 nWidth, Int32 nDecimals)
at SBuilderX.moduleSHAPE.MakeSHPPolys(String filename, String type)
at SBuilderX.frmBGL.MakeBGLVector()
at SBuilderX.frmBGL.cmdCompile_Click(Object eventSender, EventArgs eventArgs)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
at SBuilderX.frmStart.BGLMenuItem_Click(Object sender, EventArgs e)
at System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
at System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ToolStrip.WndProc(Message& m)
at System.Windows.Forms.ToolStripDropDown.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
at SBuilderX.My.MyApplication.Main(String[] Args)
InnerException:

I really believe it's a .NET issue between windows 8(not working) and windows 8.1(not working) and windows 7 (works)

my .NET is 4.0.30319
 
Messages
258
Country
us-california
Thanks Ron, good to see it's not just me. LOL. I expect you'll find the crash happening with any terrain vector. Try making a hydro polygon and compiling it.
 

GHD

Messages
12,243
Country
england
It must be the calling routine, Shapelib is a pure C++ module, with DBFAddField defined as:

DBFAddField( DBFHandle hDBF, const char * pszFieldName, DBFFieldType eType, int nWidth, int nDecimals );
 

rhumbaflappy

Administrator
Staff member
Resource contributor
Messages
5,943
Country
us-wisconsin
If sceneproc is working with shapelib.dll 64-bit, then we are still looking at a SBuilderX314 64-bit problem. Oddly, the 32-bit version works. If Luis' coding was not right, then I would expect the 32-bit version would not work either.

Luis handled the DBF file with his own routine, I believe. He had some issues with getting it working in SBuilderX314. VB.Net 4.5, shapelib.dll 64-bit, :banghead:

Dick
 
Messages
1,243
Country
canada
I think there is something wrong with the managed part of the code.

There should be an IntPtr rather than int32 for the handle part of the DBFAddField (yes but why does it work in windows 7 64 bit and other windows 8 - well I blame Microsoft ... just because :stirthepo)

//
StackTrace:
at SBuilderX.moduleSHAPE.DBFAddField(Int32 hdbf, String& pszFieldName, DBFFieldType eType, Int32 nWidth, Int32 nDecimals)

When I look at other Shapelib programs and they supply the source code there is an IntPtr in the DBFAddField.

[DllImport("shapelib.dll", CharSet = CharSet.Ansi)]
public static extern int DBFAddField(IntPtr hDBF, string szFieldName,
DBFFieldType eType, int nWidth, int nDecimals);


Google ----- https://code.google.com/p/mikeshewrapper/downloads/list

Just puttin it out there.....
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
32,883
Country
netherlands
Good catch. The first argument should indeed be a IntPtr, that's how I use it in my tools as well.

Those IntPtr indeed have a different size on 32 or 64 bit OS. So for 32 bit it probably maps to a Int32, but on 64 bit it doesn't I guess (most likely a Int64 or so).
 

rhumbaflappy

Administrator
Staff member
Resource contributor
Messages
5,943
Country
us-wisconsin
I can try to look at the code, but I recall that Luis had problems with the DBF functions of shapelib, so he created his own code to handle the DBF file. And that would explain why he coded using the Int32.

Again, this is something Luis can look at when he returns from sailing. He may well desire to fix this, as compatibility with the newer operating systems was a goal for the update.

Dick
 
Messages
223
Country
us-ohio
Any more thoughts on this, particularly since Windows 10 and all its various regular (often buggy) updates came out? I'm still convinced it's an OS conflict error introduced with Windows 8, hence it works in 7 but not consistently since then (have we ever checked if particular updates to 8, 8.1, or 10 introduced the issue, I wonder?).
I had got my 314 working nicely but just recently it's "broken" again - no doubt one of the wonderful Win 10 updates.
ian
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
32,883
Country
netherlands
I think we really need Luis to look at this in his code. From the outside it's not easy to say what's going on. I don't blame the OS here, since scenProc uses the same DLL and has no problem on all the different OS versions.
 

rhumbaflappy

Administrator
Staff member
Resource contributor
Messages
5,943
Country
us-wisconsin
You could try to contact Luis via his forum:

http://www.ptsim.com/forum/

Luis is in retirement, and has other interests than maintaining SBuilderX. He might be agreeable to releasing the code if he is unwilling to revisit the program himself. Meanwhile, the 32-bit version of the SBuilderX3.14 seems to be working.

With the release of Dovetail's Flight Simulator later this year, and the continuing popularity of P3D, a new scenery builder, built from scratch, is a possibility.

Dick
 
Messages
223
Country
us-ohio
You could try to contact Luis via his forum:

http://www.ptsim.com/forum/

Luis is in retirement, and has other interests than maintaining SBuilderX. He might be agreeable to releasing the code if he is unwilling to revisit the program himself. Meanwhile, the 32-bit version of the SBuilderX3.14 seems to be working.

With the release of Dovetail's Flight Simulator later this year, and the continuing popularity of P3D, a new scenery builder, built from scratch, is a possibility.

Dick
I think I left a post there, Dick. I can understand that Luis is taking a step back from SBX and focusing on other interests. I know I'd rather be sailing if I were him! His work has already done so much for all of us and, as you say, right now the 32-bit version works with shapefiles.

I'd love to thoroughly understand this mystery though. The longer we can keep SBX alive, despite changing OS issuses or any other varying external factors, the better off we are.

As for releasing any code, clearly that's Luis's call but, at the very least, it has to be well-protected from others using it without permission as the basis for a commercial, payware product of some kind, unless Luis can sell it, if he wishes of course, and buy more sails!

It goes without saying, I'm willing to test anything or help in any way if needed.

ian
 

spotlope

FSDevConf team
Messages
346
Country
portugal
If it's some slight consolation, I'm having the same problem. Haven't found any workaround that results in being able to compile yet. I'm on Win10, btw.
 

spotlope

FSDevConf team
Messages
346
Country
portugal
Scratch my previous comment re: not finding a fix. I hadn't seen Rhumbaflappy's x86 3.14 build thread. I downloaded that, and now things are compiling correctly. Thanks, Dick!
 
Messages
223
Country
us-ohio
Scratch my previous comment re: not finding a fix. I hadn't seen Rhumbaflappy's x86 3.14 build thread. I downloaded that, and now things are compiling correctly. Thanks, Dick!
Note though still a [new] problem for me (from 314 with FSX SDK shpvec for vector scenery), I think compiling was not the original issue. It had been working after 314. It's still however not reading or "Appending" shp files that presents problems and where the shapefile.dll mystery needs to be solved.

ian
 
Top