Solved

Sending using UDP from a DLL...

Posted on 2006-07-23
6
348 Views
Last Modified: 2010-04-24
Hi

Iam writing a DLL (in c++.net) which i would like to use from my VB program.. is it possible to send data using UDP from the DLL. If how would i connect and how would i send data ?
0
Comment
Question by:mSchmidt
  • 3
6 Comments
 
LVL 15

Accepted Solution

by:
lakshman_ce earned 500 total points
ID: 17167751
0
 

Author Comment

by:mSchmidt
ID: 17182098
Ya okay i see that ComctSerializedObjects should work but i dont quite get it..
Can you give an example on how to open a Connection to a specific port and ip and send a Struct to it ?

And then afterwards recieve a reply ..
0
 
LVL 15

Expert Comment

by:lakshman_ce
ID: 17184075
This is the sample code from the codeproject link to send data from client

The send method of NetworkUdpClient takes System::Object. So you can pass any type of structure/class derived from System::Object.


<H3>Client side using UDP</H3><PRE lang=mc++>try {

    // opens listener
    Network::NetworkUdpClient* udpClient =
             new Network::NetworkUdpClient(S"localhost", 4567);

    // sends and receives object through the two sides
    udpClient->send(S"Hello World!");
    Object* object = udpClient->receive();

    udpClient->stop();

} catch(Exception* e) {
    Console::WriteLine(S"Error sending receiving messages");
    Console::WriteLine(e->Message);
}</PRE>
0
 
LVL 15

Expert Comment

by:lakshman_ce
ID: 17184089
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

The following diagram presents a diamond class hierarchy: As depicted, diamond inheritance denotes when two classes (e.g., CDerived1 and CDerived2), separately extending a common base class (e.g., CBase), are sub classed simultaneously by a fourt…
In Easy String Encryption Using CryptoAPI in C++ (http://www.experts-exchange.com/viewArticle.jsp?aid=1193) I described how to encrypt text and recommended that the encrypted text be stored as a series of hexadecimal digits -- because cyphertext may…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now