how to create assembly or a DLL file using command prompt in .NET
Hi All:
I am trying to create a DLL for my .cpp source file using command prompt.
I tired the following:
cl /zi /clr /ld filename.cpp
cl filename.cpp /clr /ld /o filename.cpp
I created VB file and C# file, and want to call this DLL. For clear understanding, the code is as follows:
#using
using namespace System;
__gc public class HelloWorldCPP
{
public:
void SayHelloCPP()
{
Console::WriteLine("Hello world from managed C++!");
}
};
-------------------------------------------------------------------------------------
Imports System
Imports HelloWorldCPP
Public Class HelloWorldVB
Inherits HelloWorldCPP
Sub SayHelloVB()
Console.WriteLine("Hello world from Visual basic!")
End Sub
End Class
----------------------------------------------------------------------------------------
using System;
class HelloWorldCS : HelloWorldVB
{
public void SayHelloCS()
{
String message = "Hello world from C#!";
Console.WriteLine(message);
}
public static int Main()
{
HelloWorldCS h = new HelloWorldCS();
h.SayHelloCPP();
h.SayHelloVB();
h.SayHelloCS();
return 0;
}
}
Could some one help me out please?
Regards,
Anil.