1

Continuing from Create Kindle book programmatically using C#?, I've been in touch with my web host, and they will not allow exes to be run on my shared hosting package. I'm not in the position to get VPS, so does anyone have any idea if a dll version of KindleGen is available?

Community
  • 1
  • 1
Sam Delaney
  • 335
  • 3
  • 16
  • DLLs and EXEs are exactly the same. If you put some code in `DllMain` and rename the DLL to `.exe`, you can run it all the same. I don't see how using a DLL would fix your problem. – Polynomial Apr 27 '12 at 20:56
  • So if I rename an exe to dll, I can use it as if it were the same? – Sam Delaney Apr 27 '12 at 20:57
  • DLL libraries are not blocked by my shared host. EXEs are. – Sam Delaney Apr 27 '12 at 20:58
  • No. The DLL has to export APIs. If you're using C#, it has to be a managed DLL too. – Polynomial Apr 27 '12 at 21:00
  • What do you mean 'no'? My host will not allow executables to be run. – Sam Delaney Apr 27 '12 at 21:02
  • *"So if I rename an exe to dll, I can use it as if it were the same?"* - No. – Polynomial Apr 27 '12 at 21:03
  • If 'DLLs and EXEs are exactly the same', then what do you propose my solution is, given I can't execute EXEs on my shared hosting? – Sam Delaney Apr 27 '12 at 21:08
  • They're not exactly the same in this sense. I assumed you mean "running a DLL", with rundll or some other host, in which case they are exactly the same. You need a kindle library - the executable is just a converter. The solution would be to find some sort of kindlegen library. – Polynomial Apr 27 '12 at 21:10
  • There is already a KindleGen library - it's Amazon's own, called KindleGen :), but it's a command line exe. I want its functionality, without it being an exe. – Sam Delaney Apr 27 '12 at 21:16
  • That's not a library. That's a utility. – Polynomial Apr 27 '12 at 21:34
  • I've already stated it's an EXE so the meaning is quite clear. Are you able to answer the original question? – Sam Delaney Apr 27 '12 at 21:47
  • As I've said already, you **cannot** use that utility executable as a library. It's just a program. It does not export the APIs you need. You'll need to find a kindle library. – Polynomial Apr 27 '12 at 21:51
  • "does anyone have any idea if a dll version of KindleGen is available?" was my question. Thanks for your comments, but they weren't an answer to the question. – Sam Delaney Apr 27 '12 at 22:03
  • @Polynomial: It's true that DLLs and EXEs both use the Portable Executable (PE) format, but there are some significant differences. For one, EXE files are usually not compiled as relocatable code, and don't have section fixup information required for relocation, so they can't be loaded as libraries. – Ben Voigt Apr 27 '12 at 22:08
  • @BenVoigt I know that. I was assuming he was talking about loading the DLL into a host, in which case they are exactly the same in that context. – Polynomial Apr 27 '12 at 22:09
  • @SamDelaney There's none that Amazon provide, no. Is there a reason you can't encode to a different format that the Kindle supports? They'll take PDFs, TPZs, MOBIs, PRCs and (on the newest firmware) HTML-based KF8s. And there's certainly libs for PDFs :) – Polynomial Apr 27 '12 at 22:12
  • @Polynomial, I'm open to any suggestions that will allow me to create periodical type ebooks without having to get a VPS, and just use a library... The periodical layout is important due to the infomation that will be created. – Sam Delaney Apr 27 '12 at 22:24
  • no, it must be a proper ebook, which has the ability to create periodical type output. I currently use application/x-mobipocket-subscription-magazine to do this. It gives the same output as a news ebook created from Calibre. – Sam Delaney Apr 27 '12 at 22:33

1 Answers1

1

I ended up getting a VPS and ran the kindlegen utility on that.

Sam Delaney
  • 335
  • 3
  • 16