Pocket PC Networking >> Convert.ToDouble

by SXJlcGFu » Wed, 28 Sep 2005 09:16:02 GMT

does anybody know how to change the global IFormatProvider of my project so
everycall to Convert.ToDouble on it uses this format provider instead of the
one the one on the computer's regional configuration, there is no
Thread.CurrenThread.CurrentCulture here, and i don't want to be declaring new
IFormatProvider on every call i do for Convert.ToDouble.



Similar Threads

1. convert a database and send it over the internet - External Data - Access

2. convert "int" to "LPINT lpFromLen" at WSPRecvFrom()

Hi
I like to hard-code sockaddr in WSPRecvFrom and I keep getting error...
apparently the way I fill the lpFromLen (which contains the size of
sockaddr) is wrong... would you please help me
here is what I do
[code]

memset(&pSockAddrIn, '\0', sizeof(pSockAddrIn));
 pSockAddrIn.sin_family = AF_INET;
 pSockAddrIn.sin_port = htons(u_short(2024));
 pSockAddrIn.sin_addr.s_addr = inet_addr("90.1.1.20");

 lpFrom = (SOCKADDR *)(&pSockAddrIn);
 LPINT lpFromLen = NULL;
int test = sizeof(struct sockaddr);
 *lpFromLen = ?????????
[/code]


lpFromLen is an LPINT I've tried all sort of things but non worked...

would much appreciate your help in advance:)



3. To convert the double value into network byte order

4. Convert SOCKET to HANDLE?

Hi,

How do I convert a SOCKET to a HANDLE value with WinSock?

We're porting a BSD style socket server from UNIX to WinSock.  It takes the 
descriptor returned by accept() and duplicates/binds it to stdin/stdout.  The 
server then reads client messages from stdin and sends messages by writing to 
stdout.

I'd like to figure out how to take the SOCKET value returned by accept() 
under WinSock() and convert it to a HANDLE value like STD_OUTPUT_HANDLE and 
STD_INPUT_HANDLE.

Any pointers would be most appreciated?

-mike

5. How to convert VARIANT to char*/CStringArray?

6. Problems Converting Object to Byte[]

I am having problems trying to convert an object to a byte[]. Here is
the situation. I have the the exact same code producing a byte array in
two different solution. When I send a byte stream to the other solution
it tells me that it could not find the assembly for the first solution.
When I add the assembly for the first solution, then I am having
problems of accessing the data when the byte[] is converted to an
object. Here is the code:

class ProgramA
{
    static void Main(string[] args)
    {
        Program p = new Program();
        DataObject dataObj = new DataObject();

        dataObj.Name = "Bob";
        dataObj.Password = "Seger";

        byte[] temp = p.getByteArray((object)(dataObj));

        // send to ProgramB //
    }

    public byte[] getByteArray(object data)
    {
        // memory stream that will hold the object in terms of bytes //
        MemoryStream memStream = new MemoryStream();

        // format to convert object into //
        BinaryFormatter binaryFormatter = new BinaryFormatter();

        // conversion process //
        binaryFormatter.Serialize(memStream, data);

        // return the stream //
        return (memStream.ToArray());
    }
    public object getObject(byte[] data)
    {
        object result = null;

        // load byte array into the stream for manipulation //
        MemoryStream memStream = new MemoryStream(data);

        // byte array is in binary format, so use a binary formatter
for conversion //
        BinaryFormatter binaryFormatter = new BinaryFormatter();

        // set the cursor to the beginning of the data //
        memStream.Position = 0;

        // try to use the formatter to convert the byte array into an
object //
        try
        {
            result = binaryFormatter.Deserialize(memStream);
        }
        catch (Exception ex)
        {
            Console.WriteLine(ex.Message);
        }

        return (result);
    }
}

[Serializable()]
class DataObject
{
    private string name;
    private string password;


    public string Name
    {
        get { return (this.name); }
        set { this.name = value; }
    }
    public string Password
    {
        get { return (this.password); }
        set { this.password = value; }
    }
}
------------------- Break -------------------
class ProgramA
{
    static void Main(string[] args)
    {
        Program p = new Program();
        DataObject dataObj = new DataObject();
        byte[] temp;

        // receive from ProgramA a byte stream and put into temp //
       System.Reflection.Assembly.Load("Test1, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=844b9b730465d71d");

        byte[] temp = p.getObject(temp);
    }

    // ***** the same as above ***** //




p.getObject returns an object but when I cast it to a DataObject, it
states that it can't make a conversion from DataObject to DataObject. I
am stymied on how to send serialized data from one computer to another.

~thanks in advance

7. converting the byte order of strings

8. Convert System::Net::Sockets::Socket to winsock2's SOCKET?

Does anyone know how to do this?

Working on app that has new front end using old back end.  New front end 
uses System::Net::Sockets::Socket.  Old back end uses winsock2's SOCKET.  
Huge major extremely time-consuming PITA (and so not feasible) effort to 
convert either of the ends.

Take care,
Melody