| <<<Back 1 day (to 2017/07/17) | 20170718 |
jtth | chrisl : please let me know when you are in and have a few minutes, or check yesterdays chat logs. thanks! | 14:02.44 |
chrisl | jtth: I have - I've been looking. There's a simple issue, and a more difficult one - the latter is to do with LCMS2 threading support, and I'm really not sure how to resolve it | 14:04.04 |
Robin_Watts | hears lcms2 and threading - ears prick up... | 14:07.32 |
| oh, is this WinRT ? | 14:08.10 |
chrisl | Yes | 14:08.14 |
| Various things like InitializeCriticalSection don't exist in WinRT | 14:08.43 |
kens | Make dummy ones ? | 14:09.03 |
| Obviously that won't work if anyone tries to actually use threading | 14:09.20 |
chrisl | WinRT has the "Ex" variants: i.e. InitializeCriticalSectionEx | 14:10.17 |
kens | Oh, I see | 14:10.24 |
chrisl | But, obviously (being MS) the parameters aren't always directly compatible | 14:10.43 |
Robin_Watts | chrisl: We are forking LCMS for MuPDF. | 14:11.00 |
| We could roll such fixes into that. | 14:11.11 |
chrisl | Sorry - doorbell..... | 14:15.26 |
| jtth: For now, you could try using this: https://ghostscript.com/~chrisl/gsdll32metro.zip | 14:21.10 |
jtth | I will give it a go | 14:29.04 |
| Chris, I'm not quite sure how to explain the error I'm getting. Can I paste code or a link to pastebin to give you reference to what I am seeing? | 14:46.05 |
kens | pastebin is better, but we are in a meeting right now | 14:46.21 |
chrisl | pastebin is fine | 14:46.24 |
jtth | Ok. See: https://pastebin.com/erHNFC9U | 14:49.27 |
chrisl | jtth: There's no information there at all.... | 14:52.16 |
jtth | First region is where I am importing the dll, second region is attempting to call the gsapi_new_instance | 14:53.16 |
kens | And the problem is ? | 14:53.37 |
jtth | I am not exactly sure what is going on... it can't create the instance? | 14:53.51 |
chrisl | Right. But the only error there is the one in your code. | 14:53.52 |
jtth | Ok, but to be fair when I tried using gsdll32 it went into my catches for that try | 14:54.14 |
kens | I should probably say we don't have any expertise in WinRT, Metro, or C# | 14:54.17 |
jtth | gsdll32 returned DllnotFound, gsdll64 returns Badimageformat | 14:54.27 |
| That is fine. I downloaded the script from: https://www.codeproject.com/Articles/32274/How-To-Convert-PDF-to-Image-Using-Ghostscript-API | 14:54.55 |
kens | OK so if you try to use the 64-vit DLL with a 32-bit app that's not going to work | 14:55.27 |
chrisl | Well, there is no gsdll64. I only built a 32 bit one | 14:55.31 |
kens | :-) | 14:55.39 |
jtth | Right. I meant I used the gsdll64 from the main site. | 14:55.48 |
| Not that you built one. | 14:55.53 |
kens | That's not going to work on WinRT I'm sure | 14:56.00 |
jtth | ... guys guys please I know this | 14:56.13 |
| I only said that to point out that its having an error with the dll... i think. | 14:56.23 |
| But I'm not sure | 14:56.25 |
kens | I'm not sure there's a lot we can say. If it can't find the DLL then that would mean you aren't looking for it in the right place. | 14:56.57 |
| If the DLL is the wrong format, then its clearly the wrong DLL | 14:57.09 |
jtth | No it is because the gsdll32 is not compatible with WinRT | 14:57.16 |
kens | Hmm, maybe... | 14:57.29 |
jtth | The gsdll64 is not compatible with x86 environments thus it returned BadImageFormat | 14:57.30 |
chrisl | What VS version are you using? | 14:58.00 |
kens | Right, and the 32-bit one returned 'DllNotFond' because ? | 14:58.01 |
| Presumably (I would guess) because its not found | 14:58.17 |
| Dumb question, but you did change the name of the DLL in the Import code ? | 14:58.37 |
jtth | That isn't possible Kens. I know exactly where the solution is looking for the Dll. | 14:58.42 |
| That is specifically why I said the gsdll64 returns BadImageFormat. Because I know where it is looking. | 14:58.59 |
kens | OK | 14:59.03 |
| OK meting is over, 100% attention again.... | 14:59.43 |
| As chrisl asked, what version of VS are you using ? | 15:00.43 |
jtth | 2015 update 3 | 15:01.18 |
kens | Umm, don't have that installed currently :-( | 15:01.30 |
chrisl | Well, I built the DLL with 2012, so there could be a problem there | 15:01.43 |
jtth | I suppose, but I doubt it | 15:02.54 |
kens | Umm, in fact it seems I've removed all my VS versions exc ept 2008. Oops | 15:03.38 |
chrisl | DllNotFound can happen because of a missing dependency | 15:04.03 |
kens | can you try the example code on 2012 chris ? | 15:04.45 |
chrisl | I don't really want to join the website to get it | 15:05.55 |
kens | Hmm, yeah I didn't realise you had to sign up | 15:07.28 |
| I could use a throwaway email address | 15:07.50 |
| I'm a bit puzzled how this relates to WinRT (showing my lack of knowledge here), as hte author is using our x86 libraries in the project. | 15:12.18 |
| But then, I know nothing about WinRT/Metro/UWP etc. | 15:12.37 |
| Presumably one has to alter the project for WinRT in some way | 15:13.19 |
deekej | chrisl: hello! I have question regarding the urw-core45-fonts | 15:17.59 |
chrisl | Again?? | 15:18.18 |
deekej | chrisl: where should I sent a patch for it? to you, or to URW++? (would URW++ even accept the patch?) | 15:18.37 |
kens | I really don't think URW woudl accept a patch, for a multitude of reasons. | 15:19.10 |
chrisl | Well, not me - and I doubt URW++ would accept it | 15:19.19 |
deekej | kens: *sigh* :-/ | 15:19.29 |
kens | Not least the fact that they undoubtedly hold the outlines in their own format and generate the otehr formats as required | 15:19.30 |
chrisl | "error C2018: unknown character...." WTF does that mean? | 15:19.55 |
kens | what character ? | 15:20.50 |
chrisl | 0x1, 0x5, ;, &, 0x8, 0x14... hundreds of 'em | 15:21.34 |
kens | WOw, well I think they sholdn't be there. 0x1 sounds bad anwyay | 15:21.53 |
chrisl | It's looks like it's trying to compile a binary file | 15:22.01 |
kens | LOL yeah I was about to say that | 15:22.10 |
| According to one reply here, they needed to add the include files using Tools->Options, not merely include the .h in the .cpp file | 15:23.18 |
| Sounds weird to me, but possible I guess | 15:23.26 |
| THey were getting the error trying to use a .lib file | 15:23.38 |
| The MS documentation is much less helpfu; | 15:24.02 |
deekej | chrisl: I've just dropped URW an e-mail. Hopefully they will at least talk to me... :D | 15:29.15 |
chrisl | deekej: what's the patch, anyway? | 15:29.40 |
jtth | chrisl: is the gsdll32metro the gsdll you compiled for winrt previously | 15:30.30 |
chrisl | jtth: I just did it today - I hacked the bits of code that caused the compile problem to get it to build | 15:31.06 |
deekej | chrisl: https://pastebin.com/RFWu7Lr7 | 15:31.48 |
| I would patch the *.ttf and *.otf versions as well, but I don't know how to do it | 15:32.12 |
chrisl | deekej: Okay. If you don't hear from URW++ in a day or two, open a bug on our bug tracker - we have at least one other issue to refer back to URW++ | 15:33.30 |
deekej | chrisl: OK, will do. Thanks :) | 15:33.51 |
jtth | Ahh I see. Well, the gsapi new_instance / init_with_args / exit / delete_instance are 4 functions independent of the source I downloaded the script from yes | 15:34.25 |
kens | Those are (some of) the entry points in the Ghostscript DLL | 15:35.03 |
| So they are in the DLL not the C# source, is that what you mean ? | 15:35.26 |
chrisl | I can't get the WinRT Ghostscript build to work on VS2015 at all - it's now throwing an error about "exit being redefined" in one of the MS headers..... :-( | 15:40.18 |
jtth | kens: Yes that is what I was asking. As you and chris pointed out, the application exception is in my code, but it is an exception being thrown from a method that is in the gs DLL | 15:44.52 |
| Meaning that I don't think it is a problem with the script necessarily... Honestly my guess is as good or actually probably worse then yours as I have no experience building dlls or ghostscript | 15:45.36 |
kens | Doesn't seem like we're managing too well with WinRT | 15:45.58 |
| But then, we don't really support it | 15:46.07 |
| Does anyone really use it I wonder.... | 15:46.18 |
chrisl | We never had a app that called the WinRT dll - we did it for a customer, who was *seemingly* happy..... | 15:48.07 |
| jtth: does it work if you use the normal 32bit dll? | 15:55.07 |
jtth | So here is the lowdown. I am developing for the HoloLens using Unity and Visual Studio. | 15:56.32 |
| The 64 bit dll works in Unity (as Unity's editor is strictly a 64 bit environment) | 15:56.47 |
| When I try to use the dll in the HoloLens 32 bit environment, it does not work. It says DllNotFound (even though I know it is there). | 15:57.13 |
| I've tried using the 64 bit dll in the HoloLens to confirm my theory and as I said before, it returns BadImageFormat. Meaning it can see the 64bit dll, meaning that it can see the 32 bit dll | 15:57.38 |
| That is why I believe I need the gsdll32 for winrt | 15:58.17 |
chrisl | Um, that seems like a hell of a leap..... | 15:58.44 |
jtth | Which part | 15:59.06 |
| Also the gsdll32metro you sent earlier doesn't get caught by badimageformat or dllnotfound. As you saw it it's a problem with gsapi_new_instance | 15:59.54 |
chrisl | Well, no, I didn't see that, exactly, since you don't show the error code - the only error codes you mentioned were badimageformat and dllnotfound | 16:00.53 |
jtth | Please see the pastebin link again: https://pastebin.com/erHNFC9U | 16:01.27 |
chrisl | Right, so what's the error code? | 16:01.51 |
jtth | Below the two regions which I specified there is an "Error:" section with the exception I specified | 16:01.57 |
| ApplicationException: I can't create a new istance of Ghostscript please verify no other istance are running! | 16:02.25 |
chrisl | That's not an error code | 16:02.47 |
jtth | It's an exception created from the gsapi_new_instance | 16:02.58 |
chrisl | Does gsapi_new_instance() return? | 16:03.44 |
jtth | It is returning an int less then 1 | 16:04.44 |
chrisl | Less that zero, you mean | 16:05.11 |
jtth | Whoops, yes. | 16:05.21 |
chrisl | So, what value is it? | 16:05.32 |
kens | getting the back channel would be useful too | 16:06.21 |
jtth | kens: how do I do that | 16:06.46 |
| chris: let me check | 16:06.51 |
kens | For the back channel you need to register a callback to receive the data | 16:07.12 |
jtth | chrisl: returning -100 | 16:14.59 |
chrisl | Oh, that's less that ideal - that's basically just "fatal error" :-( | 16:15.25 |
jtth | kens: I don't know how to do that | 16:15.31 |
| Ouch. | 16:15.33 |
chrisl | Without being able to debug it, it's unlikely we'll get to the bottom of that | 16:18.40 |
kens | We could add different codes during startup I guess.... | 16:19.12 |
| a lack of an instance handle would cause it for example | 16:20.03 |
| also having more than a single instance per process | 16:20.23 |
| or a shit load of other faults | 16:20.38 |
| all return fatal | 16:20.43 |
| but there are only a few real ones I think. Mostly parameter problems or failure to allocate memory | 16:21.27 |
| memory allocation failure looks like the most likely candidate | 16:22.26 |
chrisl | Grr, and now Windows 8 wants me to activate it (again!) and I've no idea where the media for it might be.... | 16:22.32 |
kens | Well, at a quick debug, and knowing that the 64-bit build works OK with the same code (so I can discount a few errors) the only likely problem is a fialure to allocate memory | 16:24.14 |
| Dinner time for me, goodnight all | 16:25.07 |
chrisl | jtth: So, the "bit of a leap" I was talking about was that if the regular 64 bit DLL works, what leads you to think that you need the 32 bit DLL for WinRT? | 16:26.46 |
jtth | Oh! Well quite simply I use the 64-bit dll in the Editor because it is only 64 bit compatible. | 16:27.24 |
| But when I'm running on the Hololens, it is strictly a 32-bit compatible, so I must use the 32 bit dll there. | 16:27.48 |
| The Hololens is a UWP app, and from what I know about that platform, which granted is little, it is compatible with WinRT dlls. | 16:28.30 |
| Essentially I know for a fact the standard 32 bit dll does not work, which lead me to search for a build that would be compatible and WinRT makes sense | 16:29.01 |
| As univseral windows platform apps use windows runtime code/dlls | 16:29.15 |
chrisl | OKay, that makes sense | 16:30.08 |
jtth | What @kens said about failure to allocate memory struck a chord because I know how finicky the hololens is with memory access. Maybe it isn't allowed access to creating the images that the ghostscript creates when converting the pdf | 16:32.51 |
chrisl | jtth: It's nearing the end of my day here.... I'll try to build a debug DLL, and use the code from codeproject, and see if I can debug what's happening | 16:33.19 |
jtth | Anyway as you have probably already guessed, I am a junior dev with no previous ghostscript/dll building experience and was completely lost. Posted on stackoverflow 10+ days ago and Kens happened to respond to check out this page | 16:33.46 |
| Ok that would be great | 16:33.49 |
| If you dont mind me asking where are you located? It is 9:30 in the AM for me at the present time | 16:34.02 |
chrisl | I'm in the UK | 16:34.10 |
| As is kens | 16:34.31 |
jtth | Ahh I see. | 16:35.24 |
chrisl | We really should be allocated much memory just to create a gs instance | 16:35.37 |
| s/should/shouldn't | 16:35.44 |
| See, my typing goes when I get tired | 16:35.52 |
jtth | Ha, understandable. I believe I get your gist- it isn't, or shouldn't, be allocating much memory to create a gs instance | 16:36.25 |
chrisl | Exactly. | 16:37.24 |
jtth | Any luck on the debug dll | 17:16.59 |
chrisl | I have a debug build of the DLL, and of the application, but VS won't step into the DLL in the debugger | 17:18.27 |
camelopard | Could anybody clarify what bug report 692024 is about? What documents? What languages? | 17:20.55 |
chrisl | jtth: I'm out of time today - I'll pick this up again tomorrow | 17:35.56 |
jtth | Ok thanks Chris. Thank you | 17:59.11 |
| Forward 1 day (to 2017/07/19)>>> | |