Page1_En.html 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. <html>
  2. <head>
  3. <title>
  4. Bind a Dll to LuaEdit (Tutorial) - Getting Started
  5. </title>
  6. </head>
  7. <body bgcolor="#FFFFFF" vlink="silver" alink="navy" link="navy">
  8. <table width="100%" border="0" cellpadding="0" cellspacing="0" summary="">
  9. <tr>
  10. <td valign="bottom">
  11. <div align="left">
  12. <b><font face="Tahoma" size="3" color="navy">Getting Started</font></b>
  13. </div>
  14. </td>
  15. <td>
  16. <font face="Tahoma" size="1" color="silver">
  17. <div align="right" valign="top">
  18. <a href="http://www.lua.org">Lua homepage</a>
  19. </div>
  20. </font>
  21. </td>
  22. </tr>
  23. <tr valign="top">
  24. <td colspan="2">
  25. <hr size="1" color="#000000">
  26. <br>
  27. <br>
  28. <font face="Tahoma" size="2">
  29. <p style="text-align:justify">
  30. First of all, download LuaEdit <a href="http://luaforge.net/frs/?group_id=84&release_id=318">here</a>,
  31. install it and start it. (If LuaEdit is already installed, simply start it)
  32. Then, we need to create a new project which will contain a lua script file in it.
  33. Once the new project is created, save it under [Tutorial]\Bin\Simon.lpr and save its lua script file
  34. under [Tutorial]\Bin\Simon.lua where [Tutorial] represents the path where you unzipped this
  35. tutorial. We need to do so to be able to set the "Initializer" property. This "Initializer"
  36. property is in fact the path of a dll file wich MUST export the following function:
  37. <ul type="square">
  38. <li>Delphi: <b style="color: navy">&nbsp;LuaDebug_Initializer(L: PLua_State): Integer; cdecl;&nbsp;</b></li>
  39. <li>C/C++: <b style="color: navy">&nbsp;int LuaDebug_Initializer(lua_State *L);&nbsp;</b></li>
  40. </ul>
  41. This function will be called right before the execution of the script and its use may
  42. vary from a project to another. In other words, this is a call back function in which you
  43. may do anything useful with/without the Lua state before any scripts have been executed.
  44. Only lua script files contained in a project can benefit of the "Initializer" property
  45. since this property is set in the project settings. In our example in this tutorial, we will
  46. assign the full path of [Tutorial]\Bin\simon.dll file. This file exports the function discussed
  47. above to register functions to the Lua environement. Once this property is set, save the project
  48. again and let's get ready to talk about code.
  49. <br>
  50. <br>
  51. <br>
  52. <b>Hints:</b>
  53. <ul type="square">
  54. <li>To create a new project, click on the menu Files/New/Project</li>
  55. <li>If you can't find the Project Tree window, this may be because it's hidden.
  56. To show it, click on the View/Project Tree menu.</li>
  57. <li>To set the initializer property of a project, right click on the project
  58. file in the project tree, and click on the Project Settings menu. In the
  59. Project Settings dialog, select Debug tab. Specify the path of a valid dll
  60. file and press Ok when done.</li>
  61. <li>You may want to change the project name to Simon in the project settings.
  62. Changing this property has no effects but may help you when working with
  63. LuaEdit.</li>
  64. </ul>
  65. </p>
  66. <br>
  67. </font>
  68. </td>
  69. </tr>
  70. <tr>
  71. <td valign="bottom">
  72. <font face="Tahoma" size="2">
  73. <div align="left" valign="bottom">
  74. <a href=".\Intro_En.html">&lt;&lt; Previous</a>
  75. </div>
  76. </td>
  77. <td>
  78. <font face="Tahoma" size="2">
  79. <div align="right" valign="bottom">
  80. <a href=".\Page2_En.html">Next &gt;&gt;</a>
  81. </div>
  82. </font>
  83. </td>
  84. </tr>
  85. <tr>
  86. <td colspan="2">
  87. <font face="Tahoma" size="1" color="silver">
  88. <hr size="1" color="#000000">
  89. <div align="right">
  90. <a href="http://www.luaedit.org">www.luaedit.org</a>
  91. <br>
  92. © Copyright 2004-2005 LuaEdit
  93. <br>
  94. Bind a Dll to LuaEdit (Tutorial)
  95. </div>
  96. </font>
  97. </td>
  98. </tr>
  99. </table>
  100. </body>
  101. </html>