I am relatively new to programming and could use some assistance. I am reading in a CString of c0a85c45 which is an IP address. I need to break it down into its four parts and convert to decimal in order to send its data to a windows IP dialog box. I do not need to change the order of the Bytes. I have tried several solutions I have found on the web; all with poor results. Any solutions would be appreciated.
I am going to say you could start by showing us some of your code, at least to the point where it seems to be working the way you expect. Then ask questions about where you get stuck.
Ok, maybe I should start smaller now that you know what I am attempting. The part I am getting stuck on is how do I parse the Cstring into four values. From there I may be able to figure the rest out. Unfortunately I have deleted all the previous attempts. Most attempts using functions from the internet I end up with problems due to char type used with CString
here is working code that I was able to get working. I am sure there are much easier ways to do this but it works for now.
Any comments would be appreciated
I found the same one and it gave issues with char type cast to CString. I am not familiar enough to know what that was about.
Thanks.
Any Idea what a better Conversion than"strtol" would be?
I get warnings because Windows control is looking for Byte, Or I could be confused about that.