String Property issue

General help with the eC language.
samsam598
Posts: 208
Joined: Thu Apr 14, 2011 9:44 pm

Re: String Property issue

Post by samsam598 »

Also I can't help but suggest you use the Ecere functions instead of the WinSock API directly, to fulfill Ecere's aspiration for cross-platform applications:

GetAddressFromName, GetNameFromAddress and GetHostName will help you do what you're doing here with much ease.
I tried the sample code from the sample eCom but I got blank strings for hostName and hostAddress.Was I missing something?

Code: Select all

 
Button button1
   {
      this, text = "button1", position = { 184, 112 };
 
      bool NotifyClicked(Button button, int x, int y, Modifiers mods)
      {
         char hostName[256], address[64];
         GetHostName(hostName, sizeof(hostName));
         GetAddressFromName(hostName, address); 
         MessageBox{contents=hostName}.Modal();
         MessageBox{contents=address}.Modal();    
         return true;
      }
   };          
 
 
jerome
Site Admin
Posts: 604
Joined: Sat Jan 16, 2010 11:16 pm

Re: String Property issue

Post by jerome »

Sam, good catch!

It seems that the networking system needs to be initialized first for these functions to work.
An easy way is by declaring a global Service or Socket object:

Code: Select all

Socket socket { };
That will get them to work.
Would you please file a Mantis bug report? :)

Thanks!

-Jerome
samsam598
Posts: 208
Joined: Thu Apr 14, 2011 9:44 pm

Re: String Property issue

Post by samsam598 »

Done!
http://ecere.com/mantis/view.php?id=655

It is 2am at your side,right?Please take good care of yourselve.We are looking forward to the updates and improvements of ec SDK! :)
Post Reply