Ecere SDK/eC Forums • View topic - String Property issue




Ecere SDK/eC Forums

Ecere Developers Community

String Property issue

General help with the eC language.

Re: String Property issue

Postby samsam598 » Thu Oct 13, 2011 1:34 am

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;
      }
   };         
 
 
samsam598
 
Posts: 208
Joined: Thu Apr 14, 2011 9:44 pm

Re: String Property issue

Postby jerome » Thu Oct 13, 2011 2:10 am

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
jerome
Site Admin
 
Posts: 623
Joined: Sat Jan 16, 2010 11:16 pm

Re: String Property issue

Postby samsam598 » Thu Oct 13, 2011 4:13 am

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! :)
samsam598
 
Posts: 208
Joined: Thu Apr 14, 2011 9:44 pm

Previous

Return to eC Language

Who is online

Users browsing this forum: No registered users and 2 guests

cron