| William DePalo [MVP VC++ ] 2005-11-25, 7:02 pm |
| <russell.allbritain@gmail.com> wrote in message
news:1132943550.134425.215090@z14g2000cwz.googlegroups.com...
>I am porting some functions to VC++ .net, it was written to be windows
> compatible but in the original program it did its WSAS calls in main()
> but when i do them in _tmain they don't seem to be workiing.
Functions whose names start with WSA. are typically asynchrous extensions to
WinSock which are intened to be used in native applications (i.e. unmanaged)
rather than .Net applications.
> I am still getting the following type errors for the close() and
> write() functions
>
> access.c
> access.c(119) : error C2692: 'close' : fully prototyped functions
> required in C compiler with the '/clr' option
Is the /clr compiler option checked? If you don't know how tell then choose
the Properties item from the Project menu. Open up the "Configuration
Properties" folder in the left pane and select the General item beneath it.
In the right pane look for "Use Managed Extensions". If Yes is selected then
that is likely to be your problem - you are inadvertently targetting the
..Net platform.
Note that I am not telling you that you can't use WinSock in a .Net
application. You can with some work but it is rarely what you want. More
often, the Socket classes would be a better choice.
To fix the problem, I'd suggest that you have the wizard start a Win32
project and then add your source files to the new project.
Regards,
Will
> access.c(119) : error C2197: 'close' : too many arguments for call
> through pointer-to-function
> access.c(130) : error C2197: 'close' : too many arguments for call
> through pointer-to-function
> access.c(236) : error C2692: 'write' : fully prototyped functions
> required in C compiler with the '/clr' option
> access.c(236) : error C2197: 'write' : too many arguments for call
> through pointer-to-function
> access.c(236) : error C2197: 'write' : too many arguments for call
> through pointer-to-function
> access.c(236) : error C2197: 'write' : too many arguments for call
> through pointer-to-function
>
> any thoughts?
>
|