Search Results

Search found 5 results on 1 pages for 'divinci'.

Page 1/1 | 1 

  • MSDOS "Hello World" EXE

    - by divinci
    Hi all, An open question - but I cant find anywhere to start!! I want to compile a "Hello World" MS-DOS exe. Not a program that runs in 16bit mode, or in MSDos mode on top of Windows OSs. A HELOWRLD.EXE that I can run on my MSDOS box. Thanksyou!

    Read the article

  • Best way to represent Bit Arrays in C#??

    - by divinci
    Hi all, I am currently building a DHCPMessage class in c#. RFC is available here : http://www.faqs.org/rfcs/rfc2131.html Pseudo public object DHCPMessage { bool[8] op; bool[8] htype; bool[8] hlen; bool[8] hops; bool[32] xid; bool[16] secs; bool[16] flags; bool[32] ciaddr; bool[32] yiaddr; bool[32] siaddr; bool[32] giaddr; bool[128] chaddr; bool[512] sname; bool[1024] file; bool[] options; } If we imagine that each field is a fixed length bit array, what is : The most versitile Best practice way of representing this as a class??? OR.. how would you write this? :)

    Read the article

  • Some Async Socket Code - Help with Garbage Collection?

    - by divinci
    Hi all, I think this question is really about my understanding of Garbage collection and variable references. But I will go ahead and throw out some code for you to look at. // Please note do not use this code for async sockets, just to highlight my question // SocketTransport // This is a simple wrapper class that is used as the 'state' object // when performing Async Socket Reads/Writes public class SocketTransport { public Socket Socket; public byte[] Buffer; public SocketTransport(Socket socket, byte[] buffer) { this.Socket = socket; this.Buffer = buffer; } } // Entry point - creates a SocketTransport, then passes it as the state // object when Asyncly reading from the socket. public void ReadOne(Socket socket) { SocketTransport socketTransport_One = new SocketTransport(socket, new byte[10]); socketTransport_One.Socket.BeginRecieve ( socketTransport_One.Buffer, // Buffer to store data 0, // Buffer offset 10, // Read Length SocketFlags.None // SocketFlags new AsyncCallback(OnReadOne), // Callback when BeginRead completes socketTransport_One // 'state' object to pass to Callback. ); } public void OnReadOne(IAsyncResult ar) { SocketTransport socketTransport_One = ar.asyncState as SocketTransport; ProcessReadOneBuffer(socketTransport_One.Buffer); // Do processing // New Read // Create another! SocketTransport (what happens to first one?) SocketTransport socketTransport_Two = new SocketTransport(socket, new byte[10]); socketTransport_Two.Socket.BeginRecieve ( socketTransport_One.Buffer, 0, 10, SocketFlags.None new AsyncCallback(OnReadTwo), socketTransport_Two ); } public void OnReadTwo(IAsyncResult ar) { SocketTransport socketTransport_Two = ar.asyncState as SocketTransport; .............. So my question is: The first SocketTransport to be created (socketTransport_One) has a strong reference to a Socket object (lets call is ~SocketA~). Once the async read is completed, a new SocketTransport object is created (socketTransport_Two) also with a strong reference to ~SocketA~. Q1. Will socketTransport_One be collected by the garbage collector when method OnReadOne exits? Even though it still contains a strong reference to ~SocketA~ Thanks all!

    Read the article

  • Find First Specific Byte in a Byte[] Array c#

    - by divinci
    Hi there, I have a byte array and wish to find the first occurance (if any) of a specific byte. Can you guys help me with a nice, elegant and efficient way to do it? /// Summary /// Finds the first occurance of a specific byte in a byte array. /// If not found, returns -1. public int GetFirstOccurance(byte byteToFind, byte[] byteArray) { }

    Read the article

  • A Simple C# DLL - how do I call it from Excel, Access, VBA, VB6 ?

    - by divinci
    Hi all, I have a simple class library written in c#. using System; namespace TestDll { public class Test { public string HelloWorld { get { return "Hello World"; } } } } My question is how can I call this HelloWorld function from Microsoft Office Visual Basic (which I think is VB6)? My first step was to add the DLL as a reference - but on browsing and selecting the compiled DLL the message "Can't add a reference to the specified file." was thrown. Can anyone point me in the right direction as to why/how to get this working? Thanks in advance SO!

    Read the article

1