Results 1 to 2 of 2

Thread: referencing a dll

  1. #1

    Thread Starter
    PowerPoster abhijit's Avatar
    Join Date
    Jun 1999
    Location
    Chit Chat Forum.
    Posts
    3,228

    Lightbulb referencing a dll

    i am able to use this in an exe, or even compile it as a dll, but I am not able to use it in other projects.
    any clues?

    regards,
    abhijit

    Code:
    namespace StrClass
    {
    	/*
    	 * My First Class with C#.
    	 * I could not find a function to reverse a string in c# 
    	 * strReverse is only present in VB.NET so I wrote one myself.
    	 * -Abhijit
    	 */
    	public class StrReverse
    	{
    		public string strReverse(string sInput) 
    		{
    			//Function To Reverse a string
    			char[] c;
    			c = sInput.ToCharArray();
    			string revstring = " ";
    			for(int i = c.Length;i != 0;i--)
    			{
    				revstring =  revstring  + c[i-1].ToString();
    			}
    			return revstring;
    		}
    	}
    }
    /*
    namespace testApp
    {
    	class mainapp
    	{
    		public static void Main()
    		{
    			StrClass.StrReverse a = new StrClass.StrReverse();
    			string zzz = a.strReverse("Cool");
    			Console.WriteLine("{0}",zzz);
    		}
    	}
    }
    */

  2. #2

    Thread Starter
    PowerPoster abhijit's Avatar
    Join Date
    Jun 1999
    Location
    Chit Chat Forum.
    Posts
    3,228
    I think its do with the names that I am using. I used the following and it has worked correctly. Any comments please?

    Code:
    using System;
    namespace bbb
    {
    	/*
    	 * My First Class with C#.
    	 * I could not find a function to reverse a string in c# 
    	 * strReverse is only present in VB.NET so I wrote one myself.
    	 * -Abhijit
    	 */
    	public class zzz
    	{
    		public string abc(string sInput) 
    		{
    			//Function To Reverse a string
    			char[] c;
    			c = sInput.ToCharArray();
    			string revstring = " ";
    			for(int i = c.Length;i != 0;i--)
    			{
    				revstring =  revstring  + c[i-1].ToString();
    			}
    			return revstring;
    		}
    	}
    }
    /*
    namespace testApp
    {
    	class mainapp
    	{
    		public static void Main()
    		{
    			StrClass.StrReverse a = new StrClass.StrReverse();
    			string zzz = a.strReverse("Cool");
    			Console.WriteLine("{0}",zzz);
    		}
    	}
    }
    */

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width