Archive for November, 2009

log tools for programmer

you could use:

log4net: http://logging.apache.org/log4net/index.html

common logging: http://netcommon.sourceforge.net/index.html

System.Diagnostic trace in visual studio

November 11, 2009 at 1:55 pm Leave a comment

How to do an ActiveX DLL in VB6 Visual Studio 2005

Open visual studio 2005
create a new project ClassLibrary
 
on Project->Properties->Build
choose “Register for COM interop”
modify assemblyinfo.cs

[assembly: ComVisible(true)]

Add an interface file (IProvaNet.cs):
using System;
using System.Runtime.InteropServices;
 
namespace provanet
{
        [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIDispatch)]
        public interface Iprovanet
        {
            void provaMetodo(string strValue);
            string provaProprieta { get; set; }
        }
}
 
Add a class file (CprovaNet.cs):
 
using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;
 
namespace provanet
{
    [ClassInterface(ClassInterfaceType.None)]
    public class Cprovanet : Iprovanet
    {
            private string m_prova = “empty”;
 
            public void provaMetodo(string strValue)
            {
                m_prova = strValue;
            }
 
            public string provaProprieta
            {
                get { return m_prova; }
                set { m_prova = value; }
            }
    }
}

Test in .NET
Add the class library on reference:
public partial class FormTest : Form
{
        private Centera.CCentera m_Centera;
        public FormTest()
        {
            InitializeComponent();
            m_Centera = new Centera.CCentera();
        }
}
 

Test in VB6

Add the class library on reference:
Dim m_Centera As centera.CCentera
Private Sub Form_Load()
    Set m_Centera = New centera.CCentera
End Sub
 
Create a “strong name”:
 
run cmd
cd “C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin”
 
create a public/private key pair:                      
sn -k keypair.snk
 
(If you intend to delay sign an assembly extract the public key:
sn -p keypair.snk public.snk)
 
on Project->Properties->Signing choose “Sign the assembly” and choose the .snk filename created 
 
Release the Class Library:
 
compile provanet
 
set the PATH with the following command:
 
set PATH=C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin;C:\WINNT\Microsoft.NET\Framework\v2.0.50727;C:\Program Files\Microsoft Visual Studio 8\VC\bin;C:\Program Files\Microsoft Visual Studio 8\Common7\IDE;C:\Program Files\Microsoft Visual Studio 8\VC\vcpackages;%PATH%
 
use regasm to register (C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\regasm.exe)
REGASM provanet.dll
 
To create the tlb use:
 
REGASM provanet.dll /tlb:provanet.tlb
 
Use gacutil to add to Global Assembly Cache if you want to use .dll in a different folder of .exe (C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin\gacutil.exe)
Gacutil /i provanet.dll

November 3, 2009 at 4:18 pm Leave a comment

Free Technical Online Courses

In the article:

http://www.onlinecourses.org/2009/10/28/100-incredible-open-courses-for-the-ultimate-tech-geek/

you can find 100 free online courses from:

MIT: http://ocw.mit.edu/OcwWeb/Electrical-Engineering-and-Computer-Science/index.htm

Openlearn: http://openlearn.open.ac.uk/course/category.php?id=7

and some other sites…

Bye

November 3, 2009 at 3:47 pm Leave a comment

Snippet Compiler & other else

reading an old article from MSDN

“Ten Must-Have Tools Every Developer Should Download Now”

http://msdn.microsoft.com/it-it/magazine/cc300497%28en-us%29.aspx

I found an interesting tool to avoid to use visual studio for few line test code:

Snippet Compiler:

http://www.sliver.com/dotnet/SnippetCompiler.

I repromise also to see:

NUnit for unit testing

http://www.nunit.org/index.php

NDoc: for auto generated project documentation

http://ndoc.sourceforge.net/

Nant: for automated building (for example every night)

http://sourceforge.net/projects/nant/

Bye

November 3, 2009 at 3:45 pm Leave a comment


Calendar

November 2009
M T W T F S S
« Oct   Oct »
 1
2345678
9101112131415
16171819202122
23242526272829
30  

Posts by Month

Posts by Category


Follow

Get every new post delivered to your Inbox.