1. dll.e error while doing tcp stuff

hey......

Is there a problem with the  EU 3.0 dll.e library?

<quote>
C:\Euphoria\include\dll.e:56 in function define_c_func()
Invalid argument type
    lib = 1907163136
    routine_name = {87'W',83'S',65'A',67'C',108'l',101'e',97'a',110'n',117'u',
112'p'}
    arg_types = {0}
    return_type = 16777220

... called from C:\euphoria\tcp\tcpdemos\tcp.ew:32
</quote>
--
duke
SW of Calgary - near the Rockies
http://www.rootshell.be/~perlster/euphoria/

new topic     » topic index » view message » categorize

2. Re: dll.e error while doing tcp stuff

I  think it would be helpful if you could post the smallest working
example code that demonstrates this behaviour.

Regards,
   Juergen

new topic     » goto parent     » topic index » view message » categorize

3. Re: dll.e error while doing tcp stuff

duke normandin wrote:
> Is there a problem with the  EU 3.0 dll.e library?
> 
> <quote>
> C:\Euphoria\include\dll.e:56 in function define_c_func()
> Invalid argument type
>     lib = 1907163136
>     routine_name = {87'W',83'S',65'A',67'C',108'l',101'e',97'a',110'n',117'u',
> 112'p'}
>     arg_types = {0}
>     return_type = 16777220
> 
> ... called from C:\euphoria\tcp\tcpdemos\tcp.ew:32
> </quote>

0 is not a valid argument type.
You have to choose an argument type from the list
at the top of dll.e. Apparently this C routine takes
one argument of some type, e.g. C_INT, C_DOUBLE etc.
You have to say what the type is.

I think, a few releases ago, 0 was quietly accepted 
as an argument type, without any error message. 
I'm not sure what that really meant though - perhaps equivalent to C_INT. 
So maybe this used to "work". Just fix the call to define_c_func()
in tcp.ew at line 32.

Regards,
   Rob Craig
   Rapid Deployment Software
   http://www.RapidEuphoria.com

new topic     » goto parent     » topic index » view message » categorize

4. Re: dll.e error while doing tcp stuff

The error is not in dll.e but tcp.ew

The problem is in the declaration of the c_func "WSACleanup" on line 32:

xWSACleanup = define_c_func( ws2_32, "WSACleanup", {0}, C_INT ),

It should read:

xWSACleanup = define_c_func( ws2_32, "WSACleanup", {}, C_INT ),

A function that takes no parameters should be defined with a null sequence {},
not {0}.
It appears that Eu3.0 has improved the error detection here.

Larry Miller

new topic     » goto parent     » topic index » view message » categorize

5. Re: dll.e error while doing tcp stuff

Larry Miller wrote:
> 
> The error is not in dll.e but tcp.ew
> 
> The problem is in the declaration of the c_func "WSACleanup" on line 32:
> 
> xWSACleanup = define_c_func( ws2_32, "WSACleanup", {0}, C_INT ),
> 
> It should read:
> 
> xWSACleanup = define_c_func( ws2_32, "WSACleanup", {}, C_INT ),
> 
> A function that takes no parameters should be defined with a null sequence {},
> not {0}.
> It appears that Eu3.0 has improved the error detection here.
> 
> Larry Miller

That did it! Thanks! The tcp demo worked OK except for squaking about:

Warning: local constant txt1 in MyIPAddr.exw is not used
Warning: local constant txt2 in MyIPAddr.exw is not used

as in:

   txt1 = create(LText, "IP Address:", Win, 5, 5, 54, 20, 0),
   txt2 = create(LText, "Computer name:", Win, 5, 25, 77, 20, 0),

How do I get rid of the messages?

BTW, any ideas where I could get a simple CLI tcp demo, i.e. no Windows? This is
my first attempt at "winsock" programming, so I want to unclutter things as much
as possible. Thanks again.
--
duke
SW of Calgary - near the Rockies
http://www.rootshell.be/~perlster/euphoria/

new topic     » goto parent     » topic index » view message » categorize

6. Re: dll.e error while doing tcp stuff

duke normandin wrote:
> 
> Larry Miller wrote:
> > 
> > The error is not in dll.e but tcp.ew
> > 
> > The problem is in the declaration of the c_func "WSACleanup" on line 32:
> > 
> > xWSACleanup = define_c_func( ws2_32, "WSACleanup", {0}, C_INT ),
> > 
> > It should read:
> > 
> > xWSACleanup = define_c_func( ws2_32, "WSACleanup", {}, C_INT ),
> > 
> > A function that takes no parameters should be defined with a null sequence
> > {},
> > not {0}.
> > It appears that Eu3.0 has improved the error detection here.
> > 
> > Larry Miller
> 
> That did it! Thanks! The tcp demo worked OK except for squaking about:
> 
> Warning: local constant txt1 in MyIPAddr.exw is not used
> Warning: local constant txt2 in MyIPAddr.exw is not used
> 
> as in:
> 
>    txt1 = create(LText, "IP Address:", Win, 5, 5, 54, 20, 0),
>    txt2 = create(LText, "Computer name:", Win, 5, 25, 77, 20, 0),
> 
> How do I get rid of the messages?
> 
> BTW, any ideas where I could get a simple CLI tcp demo, i.e. no Windows? This
> is my first attempt at "winsock" programming, so I want to unclutter things
> as much as possible. Thanks again.
> --
> duke
> SW of Calgary - near the Rockies
> <a
> href="http://www.rootshell.be/~perlster/euphoria/">http://www.rootshell.be/~perlster/euphoria/</a>

You can prevent all warning messages with the statement "without warning"
at the beginning of the program. But in this case it would be best to simply
delete the declarations of the offending constants.

Larry Miller

new topic     » goto parent     » topic index » view message » categorize

7. Re: dll.e error while doing tcp stuff

Larry Miller wrote:
 
> > Warning: local constant txt1 in MyIPAddr.exw is not used
> > Warning: local constant txt2 in MyIPAddr.exw is not used
> > 
> > as in:
> > 
> >    txt1 = create(LText, "IP Address:", Win, 5, 5, 54, 20, 0),
> >    txt2 = create(LText, "Computer name:", Win, 5, 25, 77, 20, 0),
>
> 
> You can prevent all warning messages with the statement "without warning"
> at the beginning of the program. But in this case it would be best to simply
> delete the declarations of the offending constants.

Yep. I thought of nuking the two assignments above, but I thought that in so
doing, I'd break the widget. I'll give it a shot. Thanks.
--
duke
SW of Calgary - near the Rockies
http://www.rootshell.be/~perlster/euphoria/

new topic     » goto parent     » topic index » view message » categorize

8. Re: dll.e error while doing tcp stuff

duke normandin wrote:
> worked OK except for squaking about:
> 
> Warning: local constant txt1 in MyIPAddr.exw is not used
> Warning: local constant txt2 in MyIPAddr.exw is not used
> 
> as in:
> 
>    txt1 = create(LText, "IP Address:", Win, 5, 5, 54, 20, 0),
>    txt2 = create(LText, "Computer name:", Win, 5, 25, 77, 20, 0),
> 
> How do I get rid of the messages?

Being lazy, I usually just add
if txt1 or txt2 then end if -- suppress warnings


The better answer is to change it from say:
constant Win=create(),
         blah=create(),
         txt1=create(),
         txt2=create(),
         blah=create()

to:
constant Win=create(),
         blah=create()
         VOID=create()
         VOID=create()
constant blah=create()

Watch those commas, you'll need to remove 3 of them.
Obviously, if you just start deleting create statements, things will have gone
missing from the screen when you run it.

Regards,
Pete

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu