<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>difficult bug...meaning of  &quot;Run-Time Check Failure #0 - The value of ESP..&quot;</title>
		<link>http://www.allegro.cc/forums/view/610649</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Sat, 21 Jul 2012 20:56:38 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>He,</p><p>with MSVC 10 / Windows 7,<br />in debug mode  what is the meaning of this error ?</p><p>&quot;Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call.  This is usually a result of calling a function declared with one calling convention with a function pointer declared with a different calling convention.&quot;</p><p>i get it in the above program with the call of: al_map_rgb al_draw_text and al_draw_textf</p><p>In release mode the program crash at the end with the second call of al_destroy_font</p><p>al_destroy_font(arial18);<br />al_destroy_font(arial24); // here<br />al_destroy_font(arial36);</p><p>here is the program :</p><p>/********************************<br />#include &lt;allegro5\allegro.h&gt;<br />#include &lt;allegro5\allegro_native_dialog.h&gt;</p><p>#include &lt;allegro5\allegro_font.h&gt;<br />#include &lt;allegro5\allegro_ttf.h&gt;</p><p>void erreur(const char*txt)<br />{<br />ALLEGRO_DISPLAY *display;</p><p>    display = al_is_system_installed() ? al_get_current_display() : NULL;<br />    al_show_native_message_box( display, &quot;Erreur&quot;, txt ,NULL, NULL, 0);<br />    exit(EXIT_FAILURE);<br />}</p><p>int main()<br />{<br />ALLEGRO_DISPLAY*display;</p><p>	if(!al_init())<br />		erreur(&quot;init allegro&quot;);</p><p>	display=al_create_display(800,600);<br />	if (!display)<br />		erreur(&quot;create display&quot;);</p><p>	al_init_font_addon();<br />	al_init_ttf_addon();</p><p>	ALLEGRO_FONT*arial24 = al_load_ttf_font(&quot;arial.ttf&quot;, 24, 0);<br />	ALLEGRO_FONT*arial36 = al_load_ttf_font(&quot;arial.ttf&quot;, 36, 0);<br />	ALLEGRO_FONT*arial18 = al_load_ttf_font(&quot;arial.ttf&quot;, 18, 0);<br />	if(!arial24||!arial36||!arial18)<br />		erreur(&quot;load fontes&quot;);<br />	<br />al_draw_text(	arial24,al_map_rgb(255, 0, 255),50, 50,0,&quot;Salut 24 point : éàùàâêï&quot;);<br />al_draw_text(arial36, al_map_rgb(255, 127, 127), 800 / 2, 600 / 2, ALLEGRO_ALIGN_CENTRE, &quot;centre et 36 point&quot;);<br />al_draw_text(arial18, al_map_rgb(15, 240, 18), 780, 450, ALLEGRO_ALIGN_RIGHT, &quot;aligné à droite et 18 point&quot;);</p><p>	int scrx = al_get_display_width(display);<br />	int scry = al_get_display_height(display);</p><p>al_draw_textf(arial18, al_map_rgb(255, 255, 255), scrx/2, scry-200, ALLEGRO_ALIGN_CENTRE,&quot;TEXT formaté: largeur et hauteur écran = %i / %i&quot; , scrx, scry);</p><p>	al_flip_display();</p><p>	al_rest(5.0);</p><p>	al_destroy_font(arial18);<br />	al_destroy_font(arial24);<br />	al_destroy_font(arial36);<br />	al_destroy_display(display);<br />	<br />	return 0;</p><p>}
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Fred58)</author>
		<pubDate>Tue, 17 Jul 2012 20:27:45 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I tested it without the unicode characters and it does not crash.</p><div class="source-code"><div class="toolbar"><span class="button numbers"><b>#</b></span><span class="button select">Select</span><span class="button expand">Expand</span></div><div class="inner"><span class="number">  1</span><span class="p">#include &lt;allegro5\allegro.h&gt;</span>
<span class="number">  2</span><span class="p">#include &lt;allegro5\allegro_native_dialog.h&gt;</span>
<span class="number">  3</span><span class="p">#include &lt;allegro5\allegro_font.h&gt;</span>
<span class="number">  4</span><span class="p">#include &lt;allegro5\allegro_ttf.h&gt;</span>
<span class="number">  5</span>
<span class="number">  6</span><span class="k1">void</span> erreur<span class="k2">(</span><span class="k1">const</span> <span class="k1">char</span><span class="k3">*</span>txt<span class="k2">)</span>
<span class="number">  7</span><span class="k2">{</span>
<span class="number">  8</span>  <a href="http://www.allegro.cc/manual/ALLEGRO_DISPLAY"><span class="a">ALLEGRO_DISPLAY</span></a> <span class="k3">*</span>display<span class="k2">;</span>    display <span class="k3">=</span> <a href="http://www.allegro.cc/manual/al_is_system_installed"><span class="a">al_is_system_installed</span></a><span class="k2">(</span><span class="k2">)</span> ? <a href="http://www.allegro.cc/manual/al_get_current_display"><span class="a">al_get_current_display</span></a><span class="k2">(</span><span class="k2">)</span> <span class="k2">:</span> NULL<span class="k2">;</span>
<span class="number">  9</span>  <a href="http://www.allegro.cc/manual/al_show_native_message_box"><span class="a">al_show_native_message_box</span></a><span class="k2">(</span> display, <span class="s">"Erreur"</span>, txt ,NULL, NULL, <span class="n">0</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 10</span>  <a href="http://www.delorie.com/djgpp/doc/libc/libc_298.html" target="_blank">exit</a><span class="k2">(</span>EXIT_FAILURE<span class="k2">)</span><span class="k2">;</span>
<span class="number"> 11</span><span class="k2">}</span>
<span class="number"> 12</span>
<span class="number"> 13</span><span class="k1">int</span> main<span class="k2">(</span><span class="k2">)</span>
<span class="number"> 14</span><span class="k2">{</span>
<span class="number"> 15</span>  <a href="http://www.allegro.cc/manual/ALLEGRO_DISPLAY"><span class="a">ALLEGRO_DISPLAY</span></a><span class="k3">*</span>display<span class="k2">;</span>  <span class="k1">if</span><span class="k2">(</span><span class="k3">!</span><a href="http://www.allegro.cc/manual/al_init"><span class="a">al_init</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">)</span>
<span class="number"> 16</span>    erreur<span class="k2">(</span><span class="s">"init allegro"</span><span class="k2">)</span><span class="k2">;</span>  display<span class="k3">=</span><a href="http://www.allegro.cc/manual/al_create_display"><span class="a">al_create_display</span></a><span class="k2">(</span><span class="n">800</span>,<span class="n">600</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 17</span>  <span class="k1">if</span> <span class="k2">(</span><span class="k3">!</span>display<span class="k2">)</span>
<span class="number"> 18</span>    erreur<span class="k2">(</span><span class="s">"create display"</span><span class="k2">)</span><span class="k2">;</span>  <a href="http://www.allegro.cc/manual/al_init_font_addon"><span class="a">al_init_font_addon</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 19</span>  <a href="http://www.allegro.cc/manual/al_init_ttf_addon"><span class="a">al_init_ttf_addon</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">;</span>  <a href="http://www.allegro.cc/manual/ALLEGRO_FONT"><span class="a">ALLEGRO_FONT</span></a><span class="k3">*</span>arial24 <span class="k3">=</span> <a href="http://www.allegro.cc/manual/al_load_ttf_font"><span class="a">al_load_ttf_font</span></a><span class="k2">(</span><span class="s">"res/font.ttf"</span>, <span class="n">24</span>, <span class="n">0</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 20</span>  <a href="http://www.allegro.cc/manual/ALLEGRO_FONT"><span class="a">ALLEGRO_FONT</span></a><span class="k3">*</span>arial36 <span class="k3">=</span> <a href="http://www.allegro.cc/manual/al_load_ttf_font"><span class="a">al_load_ttf_font</span></a><span class="k2">(</span><span class="s">"res/font.ttf"</span>, <span class="n">36</span>, <span class="n">0</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 21</span>  <a href="http://www.allegro.cc/manual/ALLEGRO_FONT"><span class="a">ALLEGRO_FONT</span></a><span class="k3">*</span>arial18 <span class="k3">=</span> <a href="http://www.allegro.cc/manual/al_load_ttf_font"><span class="a">al_load_ttf_font</span></a><span class="k2">(</span><span class="s">"res/font.ttf"</span>, <span class="n">18</span>, <span class="n">0</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 22</span>  <span class="k1">if</span><span class="k2">(</span><span class="k3">!</span>arial24<span class="k3">|</span><span class="k3">|</span><span class="k3">!</span>arial36<span class="k3">|</span><span class="k3">|</span><span class="k3">!</span>arial18<span class="k2">)</span>
<span class="number"> 23</span>    erreur<span class="k2">(</span><span class="s">"load fontes"</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 24</span>
<span class="number"> 25</span>  <a href="http://www.allegro.cc/manual/al_draw_text"><span class="a">al_draw_text</span></a><span class="k2">(</span>  arial24,<a href="http://www.allegro.cc/manual/al_map_rgb"><span class="a">al_map_rgb</span></a><span class="k2">(</span><span class="n">255</span>, <span class="n">0</span>, <span class="n">255</span><span class="k2">)</span>,<span class="n">50</span>, <span class="n">50</span>,<span class="n">0</span>,<span class="s">"Salut 24 point : PAS DE UNICODE XD"</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 26</span>  <a href="http://www.allegro.cc/manual/al_draw_text"><span class="a">al_draw_text</span></a><span class="k2">(</span>arial36, <a href="http://www.allegro.cc/manual/al_map_rgb"><span class="a">al_map_rgb</span></a><span class="k2">(</span><span class="n">255</span>, <span class="n">127</span>, <span class="n">127</span><span class="k2">)</span>, <span class="n">800</span> <span class="k3">/</span> <span class="n">2</span>, <span class="n">600</span> <span class="k3">/</span> <span class="n">2</span>, ALLEGRO_ALIGN_CENTRE, <span class="s">"centre et 36 point"</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 27</span>  <a href="http://www.allegro.cc/manual/al_draw_text"><span class="a">al_draw_text</span></a><span class="k2">(</span>arial18, <a href="http://www.allegro.cc/manual/al_map_rgb"><span class="a">al_map_rgb</span></a><span class="k2">(</span><span class="n">15</span>, <span class="n">240</span>, <span class="n">18</span><span class="k2">)</span>, <span class="n">780</span>, <span class="n">450</span>, ALLEGRO_ALIGN_RIGHT, <span class="s">"aligné à droite et 18 point"</span><span class="k2">)</span><span class="k2">;</span>  <span class="k1">int</span> scrx <span class="k3">=</span> <a href="http://www.allegro.cc/manual/al_get_display_width"><span class="a">al_get_display_width</span></a><span class="k2">(</span>display<span class="k2">)</span><span class="k2">;</span>
<span class="number"> 28</span>  <span class="k1">int</span> scry <span class="k3">=</span> <a href="http://www.allegro.cc/manual/al_get_display_height"><span class="a">al_get_display_height</span></a><span class="k2">(</span>display<span class="k2">)</span><span class="k2">;</span><a href="http://www.allegro.cc/manual/al_draw_textf"><span class="a">al_draw_textf</span></a><span class="k2">(</span>arial18, <a href="http://www.allegro.cc/manual/al_map_rgb"><span class="a">al_map_rgb</span></a><span class="k2">(</span><span class="n">255</span>, <span class="n">255</span>, <span class="n">255</span><span class="k2">)</span>, scrx<span class="k3">/</span><span class="n">2</span>, scry-200, ALLEGRO_ALIGN_CENTRE,<span class="s">"TEXT formaté: largeur et hauteur écran = %i / %i"</span> , scrx, scry<span class="k2">)</span><span class="k2">;</span>
<span class="number"> 29</span>  <a href="http://www.allegro.cc/manual/al_flip_display"><span class="a">al_flip_display</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">;</span>  
<span class="number"> 30</span>        <a href="http://www.allegro.cc/manual/al_rest"><span class="a">al_rest</span></a><span class="k2">(</span><span class="n">5</span>.<span class="n">0</span><span class="k2">)</span><span class="k2">;</span>  
<span class="number"> 31</span>        <a href="http://www.allegro.cc/manual/al_destroy_font"><span class="a">al_destroy_font</span></a><span class="k2">(</span>arial18<span class="k2">)</span><span class="k2">;</span>
<span class="number"> 32</span>  <a href="http://www.allegro.cc/manual/al_destroy_font"><span class="a">al_destroy_font</span></a><span class="k2">(</span>arial24<span class="k2">)</span><span class="k2">;</span>
<span class="number"> 33</span>  <a href="http://www.allegro.cc/manual/al_destroy_font"><span class="a">al_destroy_font</span></a><span class="k2">(</span>arial36<span class="k2">)</span><span class="k2">;</span>
<span class="number"> 34</span>  <a href="http://www.allegro.cc/manual/al_destroy_display"><span class="a">al_destroy_display</span></a><span class="k2">(</span>display<span class="k2">)</span><span class="k2">;</span>
<span class="number"> 35</span>
<span class="number"> 36</span>  <span class="k1">return</span> <span class="n">0</span><span class="k2">;</span>
<span class="number"> 37</span><span class="k2">}</span>
</div></div><p>

I suspect maybe you&#39;re not using the correct unicode encoding for your cpp and it becomes not UTF-8. This maybe causes Allegro to crash.</p><p>I suggest instead that you load your Unicode text from a UTF-8 encoded text file. I do this and it works great. Some text editors get confused with encoding.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (jmasterx)</author>
		<pubDate>Tue, 17 Jul 2012 21:03:38 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>he,</p><p>the code is correct, so it&#39;s certainly something with text encoded but i don&#39;t know that very well.</p><p>i try to save my source file with le notepad encoded in UTF-8 and after load it in MSVC : same result always in debug mode &quot;Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call...&quot;</p><p>i also add  in &quot;Advanced save options&quot; entry in the File menu to change the encoding to &quot;Unicode (UTF-8 without signature)&quot;</p><p>but i have always the same result and a crash in release mode.</p><p>is it possible the problem is coming because i have a french installation of MSVC10 ?</p><p>Thank you very much for our help.<br />If i can&#39;t find a solution i will continue to learn allegro5 with Mingw32 and cobeBlocks for the moment, but it is very hassle for me.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Fred58)</author>
		<pubDate>Wed, 18 Jul 2012 12:57:18 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>You might play with this little console program:
</p><div class="source-code"><div class="toolbar"><span class="button numbers"><b>#</b></span><span class="button select">Select</span><span class="button expand">Expand</span></div><div class="inner"><span class="number">  1</span><span class="p">#include &lt;stdio.h&gt;</span>
<span class="number">  2</span><span class="p">#include &lt;string.h&gt;</span>
<span class="number">  3</span>
<span class="number">  4</span><span class="k1">char</span> s<span class="k2">[</span><span class="k2">]</span> <span class="k3">=</span> <span class="s">"éàùàâêï"</span><span class="k2">;</span>
<span class="number">  5</span>
<span class="number">  6</span><span class="k1">int</span> main<span class="k2">(</span><span class="k1">void</span><span class="k2">)</span>
<span class="number">  7</span><span class="k2">{</span>
<span class="number">  8</span>  <span class="k1">int</span> i,l<span class="k2">;</span>
<span class="number">  9</span>  l <span class="k3">=</span> <a href="http://www.delorie.com/djgpp/doc/libc/libc_764.html" target="_blank">strlen</a><span class="k2">(</span>s<span class="k2">)</span><span class="k2">;</span>
<span class="number"> 10</span>  <span class="k1">for</span><span class="k2">(</span>i<span class="k3">=</span><span class="n">0</span><span class="k2">;</span>i<span class="k3">&lt;</span>l<span class="k2">;</span>i<span class="k3">+</span><span class="k3">+</span><span class="k2">)</span>
<span class="number"> 11</span>  <span class="k2">{</span>
<span class="number"> 12</span>    <a href="http://www.delorie.com/djgpp/doc/libc/libc_624.html" target="_blank">printf</a><span class="k2">(</span><span class="s">" 0x%X"</span>,<span class="k2">(</span><span class="k1">unsigned</span> <span class="k1">char</span><span class="k2">)</span>s<span class="k2">[</span>i<span class="k2">]</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 13</span>  <span class="k2">}</span>
<span class="number"> 14</span>  <a href="http://www.delorie.com/djgpp/doc/libc/libc_624.html" target="_blank">printf</a><span class="k2">(</span><span class="s">"\n"</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 15</span>  <span class="k1">return</span> <span class="n">0</span><span class="k2">;</span>
<span class="number"> 16</span><span class="k2">}</span>
</div></div><p>
and compile it as regular C.  When I saved it as code page 1252 it came out as
</p><pre> 0x3F 0x3F 0x3F 0x3F 0x3F 0x3F 0x3F</pre><p>
but saving as UTF8 it came out as
</p><pre>0x82 0x85 0x97 0x85 0x83 0x88 0x8B</pre><p>

Until it comes out as the latter sequence, your editor isn&#39;t saving it right.<br />BTW, when I changed the type to save as, the string &#39;s&#39; changed as well, so repaste the &quot;éàùàâêï&quot; as necessary.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Arthur Kalliokoski)</author>
		<pubDate>Wed, 18 Jul 2012 13:17:14 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>
i get :</p><p>0xE9  0xE0  0xF9  0xE0  0xE2  0xEA  0xEF</p><p>in both cases  : saving as code page 1251 and saving as &quot;UTF-8 (without signature)code page 65001 (i take care to repaste &quot;éàùàâêï&quot;)</p><p>i try other code but if it works the result is always <br />0xE9  0xE0  0xF9  0xE0  0xE2  0xEA  0xEF</p><p>have this a meaning for you ?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Fred58)</author>
		<pubDate>Wed, 18 Jul 2012 14:40:34 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I tried this:
</p><div class="source-code snippet"><div class="inner"><pre><span class="p">#include &lt;stdio.h&gt;</span>

<span class="k1">char</span> t<span class="k2">[</span><span class="k2">]</span> <span class="k3">=</span> <span class="k2">{</span><span class="n">0xE9</span>,<span class="n">0xE0</span>,<span class="n">0xF9</span>,<span class="n">0xE0</span>,<span class="n">0xE2</span>,<span class="n">0xEA</span>,<span class="n">0xEF</span>,<span class="n">0</span><span class="k2">}</span><span class="k2">;</span>
<span class="k1">char</span> u<span class="k2">[</span><span class="k2">]</span> <span class="k3">=</span> <span class="k2">{</span><span class="n">0x82</span>,<span class="n">0x85</span>,<span class="n">0x97</span>,<span class="n">0x85</span>,<span class="n">0x83</span>,<span class="n">0x88</span>,<span class="n">0x8B</span>,<span class="n">0</span><span class="k2">}</span><span class="k2">;</span>

<span class="k1">int</span> main<span class="k2">(</span><span class="k1">void</span><span class="k2">)</span>
<span class="k2">{</span>
  <a href="http://www.delorie.com/djgpp/doc/libc/libc_624.html" target="_blank">printf</a><span class="k2">(</span><span class="s">"%s\n"</span>,t<span class="k2">)</span><span class="k2">;</span>
  <a href="http://www.delorie.com/djgpp/doc/libc/libc_624.html" target="_blank">printf</a><span class="k2">(</span><span class="s">"%s\n"</span>,u<span class="k2">)</span><span class="k2">;</span>
  <span class="k1">return</span> <span class="n">0</span><span class="k2">;</span>
<span class="k2">}</span>
</pre></div></div><p>
and your sequence now prints out the &quot;éàùàâêï&quot; but the sequence I posted gets ignored (!)</p><p>I don&#39;t know what&#39;s going on here.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Arthur Kalliokoski)</author>
		<pubDate>Wed, 18 Jul 2012 14:52:01 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>to summarize:</p><p>char s[]=&quot;éàùàâêï&quot;;        // printf(&quot;%s\n&quot;,s); give some symbols</p><p>char u[]={0x82,0x85,0x97,0x85,0x83,0x88,0x8B,0}; // printf(&quot;%s\n&quot;,u); give éàùàâêï</p><p>with saving as UTF8 (code 65001) or saving as occidental langage (code 1252)</p><p>glouk???
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Fred58)</author>
		<pubDate>Wed, 18 Jul 2012 18:28:14 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>MSVC2010 Express, Windows 7, Allegro 5.1.x (from GIT)</p><p>your code file saved with &quot;&quot;UTF-8 (without signature)code page 65001&quot;</p><p>screenshot:<br /><span class="remote-thumbnail"><span class="json">{"name":"606290","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/9\/5\/951202a002139973069318d60bc2acac.png","w":799,"h":599,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/9\/5\/951202a002139973069318d60bc2acac"}</span><img src="http://www.allegro.cc//djungxnpq2nug.cloudfront.net/image/cache/9/5/951202a002139973069318d60bc2acac-240.jpg" alt="606290" width="240" height="179" /></span></p><p>No crashes here, meaning your code is fine.<br />Maybe your problem is caused by some compiler/linker setting?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Dennis)</author>
		<pubDate>Wed, 18 Jul 2012 18:34:16 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>
I use allegro 5.0.7 and not allegro5.1.x but i know that the code is correct : it works perfectly compiled under mingw32.</p><p>Yes the problem is probably caused by some compiler/linker setting. But witch parameter and where find it!?<br />  <br />I try to repair MSVC and reinstall it. It&#39;s a Visual studio 2010 pro FR version for education.</p><p>But i still have the same problem. May be it&#39;s because of the module for the French language ? </p><p>Later i&#39;ll try to uninstall and test vith MSVC2010 Express without french module.</p><p>it&#39;s probably not much but find it is not easy for one starting in Visual studio. If some body has an idear i still listen to.</p><p>Thank you very much for all help. <br />F
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Fred58)</author>
		<pubDate>Wed, 18 Jul 2012 21:10:17 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/610649/960487#target">Fred58</a> said:</div><div class="quote"><p>Yes the problem is probably caused by some compiler/linker setting. But witch parameter and where find it!?</p></div></div><p>
Based on your original error message..:
</p><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/610649/960347#target">Fred58</a> said:</div><div class="quote"><p>&quot;Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call. This is usually a result of calling a function declared with one calling convention with a function pointer declared with a different calling convention.&quot;</p></div></div><p>
.., I&#39;d check the setting for &quot;Calling Convention&quot; first. Make sure it says __cdecl.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Dennis)</author>
		<pubDate>Wed, 18 Jul 2012 21:21:36 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>
yes &quot;calling convention  says __cdecl (/Gd)
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Fred58)</author>
		<pubDate>Wed, 18 Jul 2012 21:37:32 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Are you linking to the correct versions of the .lib files?<br />When you compiled the dependencies(especially Freetype) and Allegro itself, did you use __cdecl as well?</p><p>It&#39;s hard to tell what could be wrong here but I doubt it is at all related to it being a french version of MSVC, so re-installing is not going to solve the problem.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Dennis)</author>
		<pubDate>Wed, 18 Jul 2012 23:30:52 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>
in fact i didn&#39;t compile allegro myself i download the pachage given here, at <a href="http://www.allegro.cc/files/">http://www.allegro.cc/files/</a></p><p>may i compile allegro5 myself (i&#39;m a little afraid about that) ?</p><p>I never meet that kind of problem with allegro 4.</p><p>But i made a new test with the same visual studio installed on another PC (an eepc, HP mini !) with 32bits Windows 7 basic and no problem. My first program about using fonts with allegro 5 works perfectly.</p><p>my big PC i use with the problem is a 64 bits ... Perhaps a track ?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Fred58)</author>
		<pubDate>Thu, 19 Jul 2012 13:46:21 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>char s[]=&quot;éàùàâêï&quot;;</p></div></div><p>
What would be interesting here is how those characters appear in memory at runtime because that&#39;s the only way to see if &quot;saving as UTF-8 (without signature)code page 65001&quot; leads to a correct encoding of the string literal in UTF-8.</p><p>If correctly encoded as UTF-8, the memory pattern should be: C3A9 C3A0 C3B9 C3A0 C3A2 C3AA C3AF (the bit-octets per char may be switched depending on the machines endianness).</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>char u[]={0x82,0x85,0x97,0x85,0x83,0x88,0x8B,0};</p></div></div><p>
The compiler does not translate those (non standard ASCII character numbers) into a UTF8-encoded string, it will just keep those as an array of those numbers, so you can&#39;t ever expect any function that only accepts correctly encoded UTF-8 to make sense of those values.</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>E9 E0 F9 E0 E2 EA EF</p></div></div><p>
Those are in fact the unicode numbers for the characters éàùàâêï but they&#39;re not the UTF8 bytes for those unicode numbers, because in UTF8 the maximum code to be encoded in a single bit-octet is 7F, everything else needs to be encoded in more than one (up to four) bit-octets.</p><p>---</p><p>Back to the runtime problem though, please post the contents of your solution/project files (you can open them in notepad and copy the text) so we may see if there are any odd setting which need fixing.</p><p><b>append</b><br />Ah, you edited. <img src="http://www.allegro.cc/forums/smileys/tongue.gif" alt=":P" />
</p><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/610649/960574#target">Fred58</a> said:</div><div class="quote"><p>my big PC i use with the problem is a 64 bits ... Perhaps a track ?</p></div></div><p>Make sure to set the compiler to compile for 32bit architecture if those Allegro binaries you downloaded were compiled for that as well.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Dennis)</author>
		<pubDate>Thu, 19 Jul 2012 14:43:19 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>
Where could i find if the compiler compile for 32bit architecture ? Is it  Win32 in the configuration manager ?</p><p>Thank you very very much for explanation about unicode/UTF8, i know nothing about that.<br />The problem seems to be that my code page is never in UTF8 ever if i have option &quot;saving as UTF-8 (without signature)code page 65001&quot;</p><p>but i&#39;m not sure to well understand that you tell me to do : i open my source file with the notepad and i copy the text ... but where ? Here ? </p><p>Also i convert the file with the notepad in UTF-8 and load it after in the visual project, compile with option  &quot;saving as UTF-8 (without signature)code page 65001&quot; but i always have the same result &quot;Run-Time Check Failure #0...&quot; <br /><a href="http://www.allegro.cc/forums/smileys/cry.gif">/forums/smileys/cry.gif</a></p><p>#include &lt;allegro5\allegro.h&gt;<br />#include &lt;allegro5\allegro_native_dialog.h&gt;</p><p>#include &lt;allegro5\allegro_font.h&gt;<br />#include &lt;allegro5\allegro_ttf.h&gt;</p><p>void erreur(const char*txt)<br />{<br />ALLEGRO_DISPLAY *display;</p><p>    display = al_is_system_installed() ? al_get_current_display() : NULL;<br />    al_show_native_message_box( display, &quot;Erreur&quot;, txt ,NULL, NULL, 0);<br />    exit(EXIT_FAILURE);<br />}</p><p>int main()<br />{<br />ALLEGRO_DISPLAY*display;</p><p>	if(!al_init())<br />		erreur(&quot;init allegro&quot;);</p><p>	display=al_create_display(800,600);<br />	if (!display)<br />		erreur(&quot;create display&quot;);</p><p>	al_init_font_addon();<br />	al_init_ttf_addon();</p><p>	ALLEGRO_FONT*arial24 = al_load_ttf_font(&quot;arial.ttf&quot;, 24, 0);<br />	ALLEGRO_FONT*arial36 = al_load_ttf_font(&quot;arial.ttf&quot;, 36, 0);<br />	ALLEGRO_FONT*arial18 = al_load_ttf_font(&quot;arial.ttf&quot;, 18, 0);<br />	if(!arial24||!arial36||!arial18)<br />		erreur(&quot;load fontes&quot;);</p><p>	int scrx = al_get_display_width(display);<br />	int scry = al_get_display_height(display);</p><p>	<br />	al_draw_text(	arial24,al_map_rgb(255, 0, 255),	50, 50,	0,	&quot;Salut 24 point : éàùàâêï&quot;);<br />	al_draw_text(arial36, al_map_rgb(255, 127, 127), scrx / 2, scry / 2, ALLEGRO_ALIGN_CENTRE, &quot;centre et 36 point&quot;);<br />	al_draw_text(arial18, al_map_rgb(15, 240, 18), scrx-10, scry-200, ALLEGRO_ALIGN_RIGHT, &quot;aligne à droite et 18 point&quot;);</p><p>	al_draw_textf(arial18, al_map_rgb(255, 255, 255), scrx/2, scry-100, ALLEGRO_ALIGN_CENTRE,<br />		&quot;TEXT formaté: largeur et hauteur écran = %i / %i&quot; , scrx, scry);</p><p>	al_flip_display();</p><p>	al_rest(5.0);</p><p>	al_destroy_font(arial18);<br />	al_destroy_font(arial24);<br />	al_destroy_font(arial36);<br />	al_destroy_display(display);</p><p>	return 0;</p><p>}
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Fred58)</author>
		<pubDate>Thu, 19 Jul 2012 19:05:09 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/610649/960579#target">Dennis</a> said:</div><div class="quote"><p>Back to the runtime problem though, please post the contents of your solution/project files (you can open them in notepad and copy the text) so we may see if there are any odd setting which need fixing.</p></div></div><p>
</p><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/610649/960600#target">Fred58</a> said:</div><div class="quote"><p>but i&#39;m not sure to well understand that you tell me to do : i open my source file with the notepad and i copy the text ... but where ? Here ?</p></div></div><p>Not the source file. We already have your source. I said <b>solution/project</b> files. Those have a .sln/.vcxproj ending. The compiler/linker settings are stored in those files.</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>Is it Win32 in the configuration manager?</p></div></div><p>
Yes and make sure that is the active target when you start building.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Dennis)</author>
		<pubDate>Thu, 19 Jul 2012 21:26:38 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>
I try to reinstall MSVC. And after with the same source code saved as UTF-8 on file i havn&#39;t crash and i have not &quot;Run-Time Check Failure #0...&quot;. but i havn&#39;t éèàâêïù !</p><p>As i lost page layout (i&#39;m very sorry : another thing i have to learn) i give you the two solution/project files.</p><p>However this is the solution file :</p><p>-------------------------------------------------------------<br />Microsoft Visual Studio Solution File, Format Version 11.00
</p><ol><li><p>Visual Studio 2010
</p></li></ol><p>Project(&quot;{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}&quot;) = &quot;alleg5_font_text3&quot;, &quot;alleg5_font_text3\alleg5_font_text3.vcxproj&quot;, &quot;{88138076-89DC-4178-95A2-EAF90200848A}&quot;<br />EndProject<br />Global<br />	GlobalSection(SolutionConfigurationPlatforms) = preSolution<br />		Debug|Win32 = Debug|Win32<br />		Release|Win32 = Release|Win32<br />	EndGlobalSection<br />	GlobalSection(ProjectConfigurationPlatforms) = postSolution<br />		{88138076-89DC-4178-95A2-EAF90200848A}.Debug|Win32.ActiveCfg = Debug|Win32<br />		{88138076-89DC-4178-95A2-EAF90200848A}.Debug|Win32.Build.0 = Debug|Win32<br />		{88138076-89DC-4178-95A2-EAF90200848A}.Release|Win32.ActiveCfg = Release|Win32<br />		{88138076-89DC-4178-95A2-EAF90200848A}.Release|Win32.Build.0 = Release|Win32<br />	EndGlobalSection<br />	GlobalSection(SolutionProperties) = preSolution<br />		HideSolutionNode = FALSE<br />	EndGlobalSection<br />EndGlobal</p><p>-------------------------------------------------</p><p>And the project file : </p><p>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;<br />&lt;Project DefaultTargets=&quot;Build&quot; ToolsVersion=&quot;4.0&quot; xmlns=&quot;<a href="http://schemas.microsoft.com/developer/msbuild/2003">http://schemas.microsoft.com/developer/msbuild/2003</a>&quot;&gt;<br />  &lt;ItemGroup Label=&quot;ProjectConfigurations&quot;&gt;<br />    &lt;ProjectConfiguration Include=&quot;Debug|Win32&quot;&gt;<br />      &lt;Configuration&gt;Debug&lt;/Configuration&gt;<br />      &lt;Platform&gt;Win32&lt;/Platform&gt;<br />    &lt;/ProjectConfiguration&gt;<br />    &lt;ProjectConfiguration Include=&quot;Release|Win32&quot;&gt;<br />      &lt;Configuration&gt;Release&lt;/Configuration&gt;<br />      &lt;Platform&gt;Win32&lt;/Platform&gt;<br />    &lt;/ProjectConfiguration&gt;<br />  &lt;/ItemGroup&gt;<br />  &lt;PropertyGroup Label=&quot;Globals&quot;&gt;<br />    &lt;ProjectGuid&gt;{88138076-89DC-4178-95A2-EAF90200848A}&lt;/ProjectGuid&gt;<br />    &lt;RootNamespace&gt;alleg5_font_text3&lt;/RootNamespace&gt;<br />  &lt;/PropertyGroup&gt;<br />  &lt;Import Project=&quot;$(VCTargetsPath)\Microsoft.Cpp.Default.props&quot; /&gt;<br />  &lt;PropertyGroup Condition=&quot;&#39;$(Configuration)|$(Platform)&#39;==&#39;Debug|Win32&#39;&quot; Label=&quot;Configuration&quot;&gt;<br />    &lt;ConfigurationType&gt;Application&lt;/ConfigurationType&gt;<br />    &lt;UseDebugLibraries&gt;true&lt;/UseDebugLibraries&gt;<br />    &lt;CharacterSet&gt;MultiByte&lt;/CharacterSet&gt;<br />  &lt;/PropertyGroup&gt;<br />  &lt;PropertyGroup Condition=&quot;&#39;$(Configuration)|$(Platform)&#39;==&#39;Release|Win32&#39;&quot; Label=&quot;Configuration&quot;&gt;<br />    &lt;ConfigurationType&gt;Application&lt;/ConfigurationType&gt;<br />    &lt;UseDebugLibraries&gt;false&lt;/UseDebugLibraries&gt;<br />    &lt;WholeProgramOptimization&gt;true&lt;/WholeProgramOptimization&gt;<br />    &lt;CharacterSet&gt;MultiByte&lt;/CharacterSet&gt;<br />  &lt;/PropertyGroup&gt;<br />  &lt;Import Project=&quot;$(VCTargetsPath)\Microsoft.Cpp.props&quot; /&gt;<br />  &lt;ImportGroup Label=&quot;ExtensionSettings&quot;&gt;<br />  &lt;/ImportGroup&gt;<br />  &lt;ImportGroup Label=&quot;PropertySheets&quot; Condition=&quot;&#39;$(Configuration)|$(Platform)&#39;==&#39;Debug|Win32&#39;&quot;&gt;<br />    &lt;Import Project=&quot;$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props&quot; Condition=&quot;exists(&#39;$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props&#39;)&quot; Label=&quot;LocalAppDataPlatform&quot; /&gt;<br />  &lt;/ImportGroup&gt;<br />  &lt;ImportGroup Label=&quot;PropertySheets&quot; Condition=&quot;&#39;$(Configuration)|$(Platform)&#39;==&#39;Release|Win32&#39;&quot;&gt;<br />    &lt;Import Project=&quot;$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props&quot; Condition=&quot;exists(&#39;$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props&#39;)&quot; Label=&quot;LocalAppDataPlatform&quot; /&gt;<br />  &lt;/ImportGroup&gt;<br />  &lt;PropertyGroup Label=&quot;UserMacros&quot; /&gt;<br />  &lt;PropertyGroup /&gt;<br />  &lt;ItemDefinitionGroup Condition=&quot;&#39;$(Configuration)|$(Platform)&#39;==&#39;Debug|Win32&#39;&quot;&gt;<br />    &lt;ClCompile&gt;<br />      &lt;WarningLevel&gt;Level3&lt;/WarningLevel&gt;<br />      &lt;Optimization&gt;Disabled&lt;/Optimization&gt;<br />    &lt;/ClCompile&gt;<br />    &lt;Link&gt;<br />      &lt;GenerateDebugInformation&gt;true&lt;/GenerateDebugInformation&gt;<br />      &lt;AdditionalDependencies&gt;allegro-5.0.7-monolith-mt-debug.lib;%(AdditionalDependencies)&lt;/AdditionalDependencies&gt;<br />    &lt;/Link&gt;<br />  &lt;/ItemDefinitionGroup&gt;<br />  &lt;ItemDefinitionGroup Condition=&quot;&#39;$(Configuration)|$(Platform)&#39;==&#39;Release|Win32&#39;&quot;&gt;<br />    &lt;ClCompile&gt;<br />      &lt;WarningLevel&gt;Level3&lt;/WarningLevel&gt;<br />      &lt;Optimization&gt;MaxSpeed&lt;/Optimization&gt;<br />      &lt;FunctionLevelLinking&gt;true&lt;/FunctionLevelLinking&gt;<br />      &lt;IntrinsicFunctions&gt;true&lt;/IntrinsicFunctions&gt;<br />    &lt;/ClCompile&gt;<br />    &lt;Link&gt;<br />      &lt;GenerateDebugInformation&gt;true&lt;/GenerateDebugInformation&gt;<br />      &lt;EnableCOMDATFolding&gt;true&lt;/EnableCOMDATFolding&gt;<br />      &lt;OptimizeReferences&gt;true&lt;/OptimizeReferences&gt;<br />      &lt;AdditionalDependencies&gt;allegro-5.0.7-monolith-mt.lib;%(AdditionalDependencies)&lt;/AdditionalDependencies&gt;<br />    &lt;/Link&gt;<br />  &lt;/ItemDefinitionGroup&gt;<br />  &lt;ItemGroup&gt;<br />    &lt;ClCompile Include=&quot;alleg5_fontes_textes.cpp&quot; /&gt;<br />  &lt;/ItemGroup&gt;<br />  &lt;Import Project=&quot;$(VCTargetsPath)\Microsoft.Cpp.targets&quot; /&gt;<br />  &lt;ImportGroup Label=&quot;ExtensionTargets&quot;&gt;<br />  &lt;/ImportGroup&gt;<br />&lt;/Project&gt;
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Fred58)</author>
		<pubDate>Fri, 20 Jul 2012 14:38:44 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/610649/960662#target">Fred58</a> said:</div><div class="quote"><p>&lt;CharacterSet&gt;MultiByte&lt;/CharacterSet&gt;</p></div></div><p>
There are two lines in your project file which look like that.</p><p>Change them both to:<br />&lt;CharacterSet&gt;NotSet&lt;/CharacterSet&gt;</p><p>Save and reopen the project.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Dennis)</author>
		<pubDate>Fri, 20 Jul 2012 17:32:38 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>YES !!!!!!!</p><p>i do that and by chance i discovered something else : there is two unicode UTF-8 !<br />unicode (UTF-8 with signature) page coding 65001 <br />unicode (UTF-8 without signature) page coding 65001</p><p>BE CAREFULL : the good one is the second &quot;UTF-8 WITHOUT signature&quot;. Do you know the difference between the two ?</p><p>I try with an other solution/project test and this seems to solve the problem even with &lt;CharacterSet&gt;MultiByte&lt;/CharacterSet&gt; in file project</p><p>Thank you very very very much for your help.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Fred58)</author>
		<pubDate>Fri, 20 Jul 2012 19:19:45 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Did you clean and recompile after those changes?</p><p>Frankly, I am running out of ideas.<br />I have MSVC2010 Express(English) with all updates and service packs here and for me, your code works without problems with the settings described earlier.</p><p>The only other difference is that I&#39;m using Allegro 5.1.3.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Dennis)</author>
		<pubDate>Fri, 20 Jul 2012 19:47:36 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>While you answer me: I found the answer. Look at my previous message
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Fred58)</author>
		<pubDate>Fri, 20 Jul 2012 19:57:41 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I think it&#39;s about the presence of the <a href="http://en.wikipedia.org/wiki/Byte_order_mark">byte order mark</a> at the beginning of the file.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Audric)</author>
		<pubDate>Fri, 20 Jul 2012 20:45:16 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Yes, that&#39;s what I think as well.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Dennis)</author>
		<pubDate>Fri, 20 Jul 2012 20:57:48 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>NOOOOOooo.... it wasn&#39;t the solution and i&#39;m not alone with this problem on web.</p><p>So i find the solution on <a href="http://www.gamedev.net/">http://www.gamedev.net/</a>. Somebody named &quot;Markus&quot; told :</p><p>&quot;This error is most often caused by mismatching header (*.h) and library (*.lib, *.dll) files. It tells you that you have called a function with another signature as the compiled function expects.</p><p>Here&#39;s an example which causes this exact error:</p><p>class A {<br />  public:<br />    virtual int foo(int x, int y) { return x + y; }<br />};</p><p>class B {<br />  public:<br />    virtual int foo(int x) { return x; }<br />};</p><p>int main() {<br />  A a;<br />  reinterpret_cast&lt;B *&gt;(&amp;a)-&gt;foo(123);<br />}</p><p>So check for outdated library files, include path search order (maybe it finds a newer version of some library headers but you&#39;re still linking against the older one) and that your project doesn&#39;t have old binaries left over somewhere which are being used accidently.&quot;</p><p>Actually i used the MingW DLL in place of the MSVC DLL...  This time it is the solution (i hope !)
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Fred58)</author>
		<pubDate>Sat, 21 Jul 2012 20:56:38 +0000</pubDate>
	</item>
</rss>
