Loading the Language DLL

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • Loading the Language DLL

      Hello again,
      I'm having quite a lot of success with implementing and now heavily modifying the code outlined in the book. However, I have one problem which nobody else seems to have come up with...

      When my application tries to load the language DLL it tells me it cannot be found, but rather than giving what you'd expect to be the DLL name in the brackets it simply shows up as a series of the unknown character [] symbol.

      I would assume this is due to the use of wide character support but as the language DLL part of my code is literally a copy of yours (I basically copy the code in, check that it works, then heavily modify it to my own needs for each section so that i know that it is my error if it stops working).

      I don't know if this is enough information to help me on, but after a search of the forum nobody else seems to have had this problem. Perhaps I haven't set up my project correctly or completely? Any advice?
    • I'd look first into where your working directory is versus where the EXE is stored.

      Try to put the DLL in the same directory as the EXE, and run it outside of the debugger. If that works - then you've nailed it as a working directory issue.
      Mr.Mike
      Author, Programmer, Brewer, Patriot
    • Oh yes, it works. With the file in the directory it works. I'm more concerned that when I remove that file the message displayed to the user is:

      "Error 6052: Language DLL not found ( [] [] [] [] )."

      I would assume this is because the message box is trying to display the kpLangDllName in a unicode format, but it is in fact just a char array, but then my question would be what ways are there to make it display properly? And are there any good online resources dealing with char, TCHAR and strings?

      Because obviously, this issue will bug me no end as development continues and i can't display variables properly in windows formatted message boxes.

      OH, and thanks for the reply Mike :)

      Actually, I could probably just research into this myself.
      I've only just started clicking on whats ACTUALLY happening, and all I need to do is convert the kpLangDllName into wide character format before it gets put into the string that gets displayed.

      And NOW I have a good reason to read into ASCII, MBCS and UNICODE.

      Ok, thanks for clicking me onto the right track Mike :D

      The post was edited 2 times, last by Mingoo ().

    • Ok, heh, I read into the ASCII, MBCS and UNICODE and have now updated my code to use only unicode completely so NOW when the DLL isn't found the message box displays the correct string in the brackets, but because I've updated all the function calls the DLL can still be found if it is there. If anyone has any advice of why NOT to use wchar_t instead of TCHAR, or why not to use Unicode over SBCS (other than size in memory and support in the Win9x range) I'd be glad to hear it :)

      As small a victory as it may seem to most veterans of C++, for me I feel quite accomplished :D
    • If you're really interested in arguments for and against various character formats, search on the Lua mailing list archives. This has been a topic for debate for a few years amongst these guys. It flares up again every six or nine months, but it's usually the same thing - "this way is more portable" or "this way is the only way to reach XX community."

      Rich
      "Your job is not to die for your country. Your job is to make some other poor sod die for his."
    • Hi everybody,

      I'm having pretty much the same problem, but am none the less quite clueless.

      It would be really great if you could give a ridicously helpless newbie a hint which the language dll actually is that has to be copied into the same directory to fix the problem.

      I allready had to copy all the DLLs from the BIN directory, to get the game "running" in the first place, but unfortunatly I don't know where to find the language DLL (as it doesn't seem to be included there), so any help would be highly appreciated.

      Thanx in advance,
      Morgh

      P.S.: Sorry for any bad English that might be included herein.. ;)
    • It should be called Lang.dll or langd.dll or langp.dll depending on the build (release, debug, or profile). The DLL should be built right alongside the EXE...unless something has gone wrong in your project settings or something.

      Do a search for lang*.dll and see if it just didn't get built...
      Mr.Mike
      Author, Programmer, Brewer, Patriot