ZioRed Posted May 4, 2010 Share Posted May 4, 2010 When I call something like the following: string filepath = Leadwerks.FileSystem.GetAbsolutePath("abstract::crawler.gmf"); The Core.AbstractPath() call returns me an error (Attempted to read or write protected memory)... but when I tried it some weeks ago it worked. Everyone else may try this? Quote ?? FRANCESCO CROCETTI ?? http://skaredcreations.com Link to comment Share on other sites More sharing options...
tec.imp Posted May 5, 2010 Share Posted May 5, 2010 I just tried it and yes, it bumps a memory read/write exception in my face :/ Maybe the file "crawler.gmf" is not within the data? Mfg Imp Quote Link to comment Share on other sites More sharing options...
ZioRed Posted May 5, 2010 Author Share Posted May 5, 2010 I doubt, it should be some problem with the Core.AbstractPath, because loading it with Mesh.Load("abstract::crawler.gmf") works fine. What is strange is that when I suggested to you the code in the other thread it worked, now the same command did not. From that moment I downloaded several SDK update, may be something changed in the last engine updates (I'm using 2.31). Now I'm going to try that function in a C++ test client to see if it works there. EDIT: Tried the AbstractPath command on a C++ project and it works fine, so it's really strange. The declaration in the wrapper seems to be correct: [DllImport(EngineDll, EntryPoint = "AbstractPath", CallingConvention = CallingConvention.StdCall)] public static extern string AbstractPath(string _path); Have someone any idea what may be the problem? The same command worked some weeks ago (before some updates of the 2.31 SDK), as I told, so I thought that it may be something in the last engine changes. Quote ?? FRANCESCO CROCETTI ?? http://skaredcreations.com Link to comment Share on other sites More sharing options...
tec.imp Posted May 5, 2010 Share Posted May 5, 2010 Well i guess i found a way to fix it. As you use the Abstract Path you have to set it first with: Leadwerks.FileSystem.AbstractPath = "Data"; After i did this, it works just fine PS: However its wired that it does crash if you don't set it, that shouldn't be the case. Mfg Imp Quote Link to comment Share on other sites More sharing options...
ZioRed Posted May 5, 2010 Author Share Posted May 5, 2010 mmh.. sounds strange, however if it fixes... Now I must going to almost re-write many part of both client and server because after the third wine glass I carelessly copy&pasted in my working source folder an old version of the solution.... leave me now to put aside that damned wine, before I think to retake the old C++ work! Q_Q Quote ?? FRANCESCO CROCETTI ?? http://skaredcreations.com Link to comment Share on other sites More sharing options...
tec.imp Posted May 5, 2010 Share Posted May 5, 2010 Haha you better leave the wine alone Btw before you change everything back to what it was before, try my solution first.. not that it does not work for you, would be a waste of time otherwise Mfg Imp Quote Link to comment Share on other sites More sharing options...
ZioRed Posted May 11, 2010 Author Share Posted May 11, 2010 This issue is solved with the SDK 2.32 Quote ?? FRANCESCO CROCETTI ?? http://skaredcreations.com Link to comment Share on other sites More sharing options...
ZioRed Posted May 31, 2010 Author Share Posted May 31, 2010 Unfortunately this issue still occurs, most times it raises the AccessViolation exception (no matter calling or not RegisterAbstractPath before it). A quick test code for it: static void Main(string[] args) { Graphics.Initialize(800, 600); Framework.Initialize(false); Leadwerks.FileSystem.AbstractPath = "C:/Leadwerks Engine SDK"; string path = FileSystem.GetAbsolutePath("abstract::vehicle_monstertruck.gmf"); while (!Keyboard.KeyHit(Key.Escape) && !Leadwerks.Window.HasRequestedClose()) { Framework.Update(); Framework.Render(); Drawing.Text("Path: " + path, 0, 30); Graphics.Flip(); } Engine.Terminate(); } Inside the wrapper GetAbsolutePath only calls: return Core.AbstractPath(abstractPath) Anyone with engine source access could debug it when used with the wrapper? I'm available for quick testing on MSN (send me a PM to be added). Quote ?? FRANCESCO CROCETTI ?? http://skaredcreations.com Link to comment Share on other sites More sharing options...
ZioRed Posted June 1, 2010 Author Share Posted June 1, 2010 Nobody can check this please? Quote ?? FRANCESCO CROCETTI ?? http://skaredcreations.com Link to comment Share on other sites More sharing options...
TylerH Posted June 18, 2010 Share Posted June 18, 2010 My solution was lost, but it was a matter of changing ALL calls into Leadwerks commands that return strings to return an IntPtr, and using Marshal.PtrToStringAnsi to convert it to a string. (Just re-added incase anyone searches this thread in the future) Quote nVidia 530M Intel Core i7 - 2.3Ghz 8GB DDR3 RAM Windows 7 Ultimate (64x)----- Visual Studio 2010 Ultimate Google Chrome Creative Suite 5 FL Studio 10 Office 15 ----- Expert Professional Expert BMX Programmer ----- Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.