<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" version="2.0">
  <channel>
    <title>Malek's Moorish tales</title>
    <link>http://kemmou.com/</link>
    <description>the new 1001 nights mantra : blog or die</description>
    <language>en-us</language>
    <copyright>Malek Kemmou</copyright>
    <lastBuildDate>Wed, 04 Feb 2004 13:39:07 GMT</lastBuildDate>
    <generator>newtelligence dasBlog 1.8.5223.2</generator>
    <managingEditor>blog@kemmou.com</managingEditor>
    <webMaster>blog@kemmou.com</webMaster>
    <item>
      <trackback:ping>http://kemmou.com/Trackback.aspx?guid=eb8b59f0-4239-4821-a604-5cdb167bde2c</trackback:ping>
      <pingback:server>http://kemmou.com/pingback.aspx</pingback:server>
      <pingback:target>http://kemmou.com/PermaLink,guid,eb8b59f0-4239-4821-a604-5cdb167bde2c.aspx</pingback:target>
      <dc:creator />
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p dir="ltr">
      Can memery allocation (non garbage collected) be done with VB .Net ?
   </p>
        <blockquote dir="ltr" style="MARGIN-RIGHT: 0px">
          <p dir="ltr">
            <strong>Regular answer : </strong>No. C# can do unsafe (non garbage collected) code,
      and VB.Net cannot
   </p>
          <p dir="ltr">
            <strong>Hideous Answer :</strong> Well, yes it is far from being Elegant, but as my
      good friend and impressively clever RD <a href="http://staff.newtelligence.net/clemensv">Clemens</a> once
      told me in the middle of a discussion on .Net vs. COM : "There can be no purity in
      software development". So here it is :
   </p>
          <p dir="ltr" style="MARGIN-RIGHT: 0px">
          There is full set of Memory management APIs (<a href="http://msdn.microsoft.com/library/en-us/memory/base/memory_management_reference.asp">http://msdn.microsoft.com/library/en-us/memory/base/memory_management_reference.asp</a>)
      that can be used to do memory alocation (both on the heap and on the stack), copy
      memory, get a handle to allocated memory, ...etc.
   </p>
          <p dir="ltr" style="MARGIN-RIGHT: 0px">
          VB can do PInvoke ...
   </p>
          <p dir="ltr" style="MARGIN-RIGHT: 0px">
         PInvoking into Kernel32.dll (or Coredll.dll in Windows Mobile) makes
      VB capable of dealing with such issues... which is only usefull in very special cases
      (using other APIs accessible through PInvoke and making sure there is no garbage collection
      on the arguments passed to the native APIs is the only use I ever needed them for
      - and only because I had to show VB.Net code (besides C# code) in presentations ...).
   </p>
          <p dir="ltr" style="MARGIN-RIGHT: 0px">
         It is not very hard to wrap those calls into some Utility class, and
      then use it for allocating memory and geting the handles to the objects, which can
      easily make the code somewhat more elegant ...
   </p>
          <p dir="ltr" style="MARGIN-RIGHT: 0px">
         Example (MSDN Article by Derek Mitchell) : 
   </p>
          <p dir="ltr" style="MARGIN-RIGHT: 0px">
            <a href="http://msdn.microsoft.com/library/en-us/dnnetcomp/html/netcfphoneapi.asp">http://msdn.microsoft.com/library/en-us/dnnetcomp/html/netcfphoneapi.asp</a>
          </p>
          <p dir="ltr" style="MARGIN-RIGHT: 0px">
         Have Fun ...
   </p>
          <p dir="ltr" style="MARGIN-RIGHT: 0px">
       
   </p>
        </blockquote>
        <br />
        <hr />
   This weblog is sponsored by <a href="http://www.newtelligence.com">newtelligence AG</a>. 
</body>
      <title>Trivia Answer : Memory allocation management in VB.Net</title>
      <guid>http://kemmou.com/PermaLink,guid,eb8b59f0-4239-4821-a604-5cdb167bde2c.aspx</guid>
      <link>http://kemmou.com/PermaLink,guid,eb8b59f0-4239-4821-a604-5cdb167bde2c.aspx</link>
      <pubDate>Wed, 04 Feb 2004 13:39:07 GMT</pubDate>
      <description>&lt;p dir=ltr&gt;
   Can&amp;nbsp;memery allocation (non garbage collected) be done with VB .Net ?
&lt;/p&gt;
&lt;blockquote dir=ltr style="MARGIN-RIGHT: 0px"&gt; 
&lt;p dir=ltr&gt;
   &lt;strong&gt;Regular answer : &lt;/strong&gt;No. C# can do unsafe (non garbage collected) code,
   and VB.Net cannot
&lt;/p&gt;
&lt;p dir=ltr&gt;
   &lt;strong&gt;Hideous Answer :&lt;/strong&gt; Well, yes it is far from being Elegant, but as my
   good friend and impressively clever RD &lt;a href="http://staff.newtelligence.net/clemensv"&gt;Clemens&lt;/a&gt; once
   told me in the middle of a discussion on .Net vs. COM : "There can be no purity in
   software development". So here it is :
&lt;/p&gt;
&lt;p dir=ltr style="MARGIN-RIGHT: 0px"&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp; There is full set of Memory management APIs (&lt;a href="http://msdn.microsoft.com/library/en-us/memory/base/memory_management_reference.asp"&gt;http://msdn.microsoft.com/library/en-us/memory/base/memory_management_reference.asp&lt;/a&gt;)
   that can be used to do memory alocation (both on the heap and on the stack), copy
   memory, get a handle to allocated memory, ...etc.
&lt;/p&gt;
&lt;p dir=ltr style="MARGIN-RIGHT: 0px"&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp; VB can do PInvoke ...
&lt;/p&gt;
&lt;p dir=ltr style="MARGIN-RIGHT: 0px"&gt;
   &amp;nbsp;&amp;nbsp; PInvoking into Kernel32.dll (or Coredll.dll in Windows Mobile) makes
   VB capable of dealing with such issues... which is only usefull in very special cases
   (using other APIs accessible through PInvoke and making sure there is no garbage collection
   on the arguments passed to the native APIs is the only use I ever needed them for
   - and only because I had to show VB.Net code (besides C# code) in presentations ...).
&lt;/p&gt;
&lt;p dir=ltr style="MARGIN-RIGHT: 0px"&gt;
   &amp;nbsp;&amp;nbsp; It is not very hard to wrap those calls into some Utility class, and
   then use it for allocating memory and geting the handles to the objects, which can
   easily make the code somewhat more elegant ...
&lt;/p&gt;
&lt;p dir=ltr style="MARGIN-RIGHT: 0px"&gt;
   &amp;nbsp;&amp;nbsp; Example (MSDN Article by Derek Mitchell) : 
&lt;/p&gt;
&lt;p dir=ltr style="MARGIN-RIGHT: 0px"&gt;
   &lt;a href="http://msdn.microsoft.com/library/en-us/dnnetcomp/html/netcfphoneapi.asp"&gt;http://msdn.microsoft.com/library/en-us/dnnetcomp/html/netcfphoneapi.asp&lt;/a&gt;
&lt;/p&gt;
&lt;p dir=ltr style="MARGIN-RIGHT: 0px"&gt;
   &amp;nbsp;&amp;nbsp; Have Fun ...
&lt;/p&gt;
&lt;p dir=ltr style="MARGIN-RIGHT: 0px"&gt;
   &amp;nbsp;
&lt;/p&gt;
&lt;/blockquote&gt;
&lt;br /&gt;
&lt;hr /&gt;
This weblog is sponsored by &lt;a href="http://www.newtelligence.com"&gt;newtelligence AG&lt;/a&gt;. </description>
      <category>.Net;main;Trivia</category>
    </item>
    <item>
      <trackback:ping>http://kemmou.com/Trackback.aspx?guid=68bb007b-cac2-43a4-9388-ce3a1af2e23f</trackback:ping>
      <pingback:server>http://kemmou.com/pingback.aspx</pingback:server>
      <pingback:target>http://kemmou.com/PermaLink,guid,68bb007b-cac2-43a4-9388-ce3a1af2e23f.aspx</pingback:target>
      <dc:creator />
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p dir="ltr">
      Can memery allocation (non garbage collected) be done with VB .Net ?
   </p>
        <p dir="ltr">
      Use the comments to answer ...
   </p>
        <br />
        <hr />
   This weblog is sponsored by <a href="http://www.newtelligence.com">newtelligence AG</a>. 
</body>
      <title>Trivia Question : unsafe code in VB.Net ?</title>
      <guid>http://kemmou.com/PermaLink,guid,68bb007b-cac2-43a4-9388-ce3a1af2e23f.aspx</guid>
      <link>http://kemmou.com/PermaLink,guid,68bb007b-cac2-43a4-9388-ce3a1af2e23f.aspx</link>
      <pubDate>Sat, 31 Jan 2004 15:00:54 GMT</pubDate>
      <description>&lt;p dir=ltr&gt;
   Can&amp;nbsp;memery allocation (non garbage collected) be done with VB .Net ?
&lt;/p&gt;
&lt;p dir=ltr&gt;
   Use the comments to answer ...
&lt;/p&gt;
&lt;br /&gt;
&lt;hr /&gt;
This weblog is sponsored by &lt;a href="http://www.newtelligence.com"&gt;newtelligence AG&lt;/a&gt;. </description>
      <category>.Net;main;Trivia</category>
    </item>
    <item>
      <trackback:ping>http://kemmou.com/Trackback.aspx?guid=ff30d93f-4cd6-401b-8d23-f46ec4864f31</trackback:ping>
      <pingback:server>http://kemmou.com/pingback.aspx</pingback:server>
      <pingback:target>http://kemmou.com/PermaLink,guid,ff30d93f-4cd6-401b-8d23-f46ec4864f31.aspx</pingback:target>
      <dc:creator>malekblog@kemmou.com (Malek!)</dc:creator>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p dir="ltr">
      What is the Sphinks looking at (the credits go to my friend Patrick Hynds for thinking
      of it)
   </p>
        <p dir="ltr">
          <img style="WIDTH: 356px; HEIGHT: 276px" height="390" hspace="12" src="http://p.vtourist.com/144606.jpg" width="560" vspace="12" border="1" />
          <img style="WIDTH: 329px; HEIGHT: 286px" height="224" src="http://www.delange.org/Sphinx/PizzaHutKFC.jpg" width="298" />
        </p>
        <p dir="ltr">
      Pizza Hut and KFC ...
   </p>
        <br />
        <hr />
   This weblog is sponsored by <a href="http://www.newtelligence.com">newtelligence AG</a>. 
</body>
      <title>Trivia Question Answer</title>
      <guid>http://kemmou.com/PermaLink,guid,ff30d93f-4cd6-401b-8d23-f46ec4864f31.aspx</guid>
      <link>http://kemmou.com/PermaLink,guid,ff30d93f-4cd6-401b-8d23-f46ec4864f31.aspx</link>
      <pubDate>Wed, 28 Jan 2004 21:43:23 GMT</pubDate>
      <description>&lt;p dir=ltr&gt;
   What is the Sphinks looking at (the credits go to my friend Patrick Hynds for thinking
   of it)
&lt;/p&gt;
&lt;p dir=ltr&gt;
   &lt;img style="WIDTH: 356px; HEIGHT: 276px" height=390 hspace=12 src="http://p.vtourist.com/144606.jpg" width=560 vspace=12 border=1&gt; &lt;img style="WIDTH: 329px; HEIGHT: 286px" height=224 src="http://www.delange.org/Sphinx/PizzaHutKFC.jpg" width=298&gt; 
&lt;/p&gt;
&lt;p dir=ltr&gt;
   Pizza Hut and KFC ...
&lt;/p&gt;
&lt;br /&gt;
&lt;hr /&gt;
This weblog is sponsored by &lt;a href="http://www.newtelligence.com"&gt;newtelligence AG&lt;/a&gt;. </description>
      <category>main;Travel;Trivia</category>
    </item>
    <item>
      <trackback:ping>http://kemmou.com/Trackback.aspx?guid=f5eaf66a-ff76-4983-bda6-bc4d72b6c872</trackback:ping>
      <pingback:server>http://kemmou.com/pingback.aspx</pingback:server>
      <pingback:target>http://kemmou.com/PermaLink,guid,f5eaf66a-ff76-4983-bda6-bc4d72b6c872.aspx</pingback:target>
      <dc:creator />
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p dir="ltr">
      What is the Sphinks looking at (the credits go to my friend Patrick Hynds for thinking
      of it)
   </p>
        <p>
          <img style="WIDTH: 356px; HEIGHT: 276px" height="390" hspace="12" src="http://p.vtourist.com/144606.jpg" width="560" vspace="12" border="1" />
        </p>
        <br />
        <hr />
   This weblog is sponsored by <a href="http://www.newtelligence.com">newtelligence AG</a>. 
</body>
      <title>A trivia question</title>
      <guid>http://kemmou.com/PermaLink,guid,f5eaf66a-ff76-4983-bda6-bc4d72b6c872.aspx</guid>
      <link>http://kemmou.com/PermaLink,guid,f5eaf66a-ff76-4983-bda6-bc4d72b6c872.aspx</link>
      <pubDate>Sun, 25 Jan 2004 23:13:03 GMT</pubDate>
      <description>&lt;p dir=ltr&gt;
   What is the Sphinks looking at (the credits go to my friend Patrick Hynds for thinking
   of it)
&lt;/p&gt;
&lt;p&gt;
   &lt;img style="WIDTH: 356px; HEIGHT: 276px" height=390 hspace=12 src="http://p.vtourist.com/144606.jpg" width=560 vspace=12 border=1&gt;
&lt;/p&gt;
&lt;br /&gt;
&lt;hr /&gt;
This weblog is sponsored by &lt;a href="http://www.newtelligence.com"&gt;newtelligence AG&lt;/a&gt;. </description>
      <category>main;Travel;Trivia</category>
    </item>
  </channel>
</rss>