Click here to Skip to main content
15,038,451 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a c++ dll which needs to be ported onto c#. There is structure under which there is a nested structure which is pointed by a pointer.
Code Snippet is as follows:
Struct Application
{
struct hostent *hp;
};

Since i am new to the concept of marshalling, please let me know i anybody had hands on this kind of structure.
Posted

1 solution

Instead of porting the code over to C# byte for byte, look for equivalent functionality in the .NET framework.

The hostent structure is usually used to associate hostname and IP address.

For example ...

C++
System.Net.IPAddress[] list = System.Net.Dns.GetHostAddresses("www.codeproject.com");
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900