.comment-link {margin-left:.6em;}

.code

.. Hello Earthling .. \o/ :)

Ajax.net free library with source code
Tuesday, October 25, 2005

Check this Ajax library which comes free with source code. Its available for 1.1 and 2.0 versions of the .net. I have yet to check it out but the examples on the page looks really cool.


Quake III Source Code
Monday, October 24, 2005

I've been playing Quake III for almost four years. Few minutes back I was on the Id web site and there were lot of great news. Most exciting is the source code release of quake III under GPL license. You can easily build the source code in Visual Studio 2k3 and also on Unix systems I believe. Next exciting news is that work on Quake 4 for PC has been done, its probably shipping by now. Waiting it to be available in my city. Next exciting news :) is that one of the best all time first-person-shooter game Return to Castle Wolfenstein has gone in development for XBox 360 & PC. Thats simply awesome. Cant even imagine how id's latest graphical engine is going to perform on the so-powerful hardware of xbox 360. It'll definitely be a killer game. Next big news is that the Doom movie has been released. Great to know that "The Rock" is the main action guy in it. I like all his movies and he is a real good actor.


Delegates to Value Type Members in Rotor 1.0
Friday, October 14, 2005

In rotor 1.0, you cannot call a value type's struct method through a delegate. This is a restriction in v1.0 of the .net framework that was removed from the later versions. For example, if you compile and execute the following code:

using System;
namespace intro

{
struct mystruct
{
public void valuetypemethod()
{
Console.WriteLine("method called from delegate.");
}

}
class CMain
{
public delegate void dlgassign ();
public static void Main()
{
mystruct at = new mystruct();
dlgassign fnptr = new dlgassign ( at.valuetypemethod );
fnptr ();
}

}
}
It'll give you the following error:
----------
Unhandled Exception: System.NotSupportedException: Delegates on value classes can only be formed on virtual methods
at System.Delegate.NeverCallThis(Object target, IntPtr slot)
at intro.CMain.Main()
----------
If you look at where it is raised, you'll come to \sscli\clr\src\vm\comdelegate.cpp COMDelegate::DelegateConstruct which is declared as

------------
// This is the single constructor for all Delegates. The compiler
// doesn't provide an implementation of the Delegate constructor. We
// provide that implementation through an ECall call to this method.
FCIMPL3(void,
COMDelegate::DelegateConstruct,
ReflectBaseObject* refThisUNSAFE,
Object* targetUNSAFE,
SLOT method)
------------
The following code raises the error:
pMeth = pTarg->GetUnboxingMethodDescForValueClassMethod(pMeth);
if (pMeth == NULL) COMPlusThrow(kNotSupportedException,
L"NotSupported_NonVirtualValueClassDelegates");

if you comment the line:
pMeth = pTarg->GetUnboxingMethodDescForValueClassMethod(pMeth);

and than build corlibs again, it fixes the error. To quickly rebuild the sscli with this change, goto \sscli\clr\src\vm and type "build -c". Once the build is complete, goto \sscli\clr\src and type "build" (without -c option) and press enter. This will build the sscli with your changes. Now try running the above application again (you do not need to the compile the exe again with csc because the error was generated by the vm and we just built it again). It'll give the following message:
method called from delegate.

Now you can have delegates to value type's methods and call them too.





Blogs:

MSDN Blogs
Joel Pobar
Don Syme

Friends:
Adeel
Aqeel
#Fahad
Haroon
Omer
Muhammad Ali
Lahore Food Blog

Links:
Rotor
CodeGuru
Mozilla
OpenSourceNokia
Tech Blog

Languages:
IronPython
F#

Archives

June 2004   July 2004   August 2004   September 2004   October 2004   November 2004   December 2004   February 2005   April 2005   June 2005   July 2005   September 2005   October 2005   November 2005   June 2007   December 2007   January 2008   March 2008   April 2008   June 2008   October 2008   February 2009   May 2009   June 2009   July 2009   August 2009   March 2011   June 2011   July 2011   September 2011   October 2011   November 2011   December 2012   May 2013   October 2013   May 2014   March 2015   July 2015   August 2015   December 2015   March 2016   July 2016   October 2016   November 2016   July 2017  

This page is powered by Blogger. Isn't yours?