Jump to content

Mark-

Members
  • Content Count

    297
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Mark-

  1. Mark-

    Alignment of group of controls

    I would guess at or near the bottom of the object inspector.
  2. Hello, The Wiki page https://wiki.overbyte.eu/wiki/index.php/TWSocket Addr Client: The host to connect to. Server: The interface to listen on. LocalAddr The local address to which the socket is bound. Is this true for TCP and UDP? For a client, Addr is the remote (host) address and LocalAddr, if specified, is the interface to bind the socket. For a server, Addr specifies the interface to listen on so LocalAddr is not used. Mark
  3. Mark-

    UDP bind...

    Thanks. Industrial application, lots of networks, binding is necessary in some instances.
  4. Mark-

    UDP bind...

    Using UDP, how to bind the socket to a NIC or other interface device? > For UDP client, TWSocket LocalAddr and LocalPort may be set but are usually left blank,... Does that bind the socket (UDP) to the NIC or whatever the interface device type? I am trying to make sure I understand, for what I am trying to accomplish, and I want to update the Wiki with more data.
  5. Mark-

    UDP bind...

    Thanks for the response. So, for a UDP server, setting the addr is the interface address and LocalAddr is ignored? For a UDP client, how to bind the socket to an interface device? Using LocalAddr? Mark
  6. Hello, Delphi 10.2.3, (VCL) current version of ICS (V9.4). Testing to verify I caught and handled the issue of the customer entering a bad IP address for binding. The IP address is formatted correctly, just not a valid IP address for any present interface. I was using the OnError callback. Call connect, onError is called but, "LastError" was zero. Switched to catching it as an exception try Connect except end; LastError is still zero. Looked in the source at procedure TCustomWSocket.BindSocket; ... if WSocket_Synchronized_bind(HSocket, PSockAddrIn(@LocalSockName)^, SockNamelen) <> 0 then begin and the correct error code 10049 (WSAEADDRNOTAVAIL) is present but, it is never assigned to LastError, that I could see. Perhaps there is something different I should be doing. Any ideas? Thanks, Mark
  7. You are correct, thank you.
  8. Thank you Remy. This: WsocketErrorDesc(ESocketException(exceptObject).ErrorCode) works. I am hoping Angus reads the post.
  9. Hello, A computer with multiple networks interfaces. The "port" and "addr" are set. "LocalAddr" is not set. No SSL. "Connect" command is called. The question, how to determine the IP address of the network interface used. Cheers, Mark
  10. Mark-

    TWSocket,,,

    Thank you Angus.
  11. Mark-

    TWSocket,,,

    Thank you. Not being on the stack is the only difference I see at the moment. I will give it a go and post the result.
  12. Mark-

    TWSocket,,,

    No problem. I found this on SO. "... that illustrates that in fact SO_BSP_STATE requires a buffer more than sizeof(CSADDR_INFO), which is in direct contrast to the Microsoft published documentation: ... Still looking for a working example in any language.
  13. Mark-

    TWSocket,,,

    Thanks for the response. Same result.
  14. Mark-

    TWSocket,,,

    Well, the wall has been hit. Not sure what is going on. Using what I "think" should work ends with: Replacing add_info:CSADDR_INFO; with add_info:CSADDR_INFO2 and no error. type SOCKET_ADDRESS = record lpSockaddr:PSOCKADDR; iSockaddrLength:integer; end; type CSADDR_INFO = record LocalAddr:SOCKET_ADDRESS; RemoteAddr:SOCKET_ADDRESS; iSocketType:Integer; iProtocol:Integer; end; type CSADDR_INFO2 = record space:array [0..127] of byte; end; procedure TForm3.FormDestroy(Sender: TObject); begin WSocket1.Abort; end; function GetLastSocketErrorMessage: string; var ErrorCode:integer; Buffer:array[0..255] of Char; begin ErrorCode := WSAGetLastError; if ErrorCode <> 0 then begin FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM or FORMAT_MESSAGE_IGNORE_INSERTS, nil, ErrorCode, 0, Buffer, SizeOf(Buffer), nil ); Result := Format('Socket Error %d: %s', [ErrorCode, StrPas(Buffer)]); end else Result := 'No socket error.'; end; procedure TForm3.FormShow(Sender: TObject); var optLen:integer; add_info:CSADDR_INFO; begin WSocket1.Connect; OptLen:=SizeOf(add_info); FillChar(add_info,OptLen,#0); if WSocket_getsockopt(WSocket1.HSocket, SOL_SOCKET, SO_BSP_STATE, @add_info, OptLen) = SOCKET_ERROR then ShowMessage(GetLastSocketErrorMessage); Any ideas? Mark
  15. Mark-

    TWSocket,,,

    Thanks Angus.
  16. Mark-

    EnumFontFamiliesEx...

    Hello, Delphi 10.2.3. I have worked out how to collect the character sets (scripts) for each font name. Now I am trying to convert the byte values returned from EnumFontFamiliesEx to the name of the character set like is seen below under Script. Web searching, no joy. WIN32 Programmer's Reference, no joy. Any ideas? Thanks, Mark
  17. Mark-

    EnumFontFamiliesEx...

    I did, after my last post. Thanks for your time.
  18. Mark-

    EnumFontFamiliesEx...

    I guess you are not comparing them. Not sure what you are trying to do Remy. I wrote in the first post, I wanted to use the same script names that TFontDialog displayed. The matrix I produced has the descriptions, the post you refer to does not have any descriptions used by TFontDialog. I had to create a few descriptions because TFontDialog did not show the font. Remy, I know you provide a lot of help on this forum and on other sites. And I have, many times, read your post and thought it was great. I am not sure you are helping in this thread.
  19. Mark-

    EnumFontFamiliesEx...

    No, it is not the same.
  20. Mark-

    VCL Styles Utils...

    Hello, Anyone using it with success? (https://github.com/RRUZ/vcl-styles-utils) Or have another solution to style common dialogs? Mark
  21. Mark-

    VCL Styles Utils...

    It was an API call that had wrong parameters.
  22. Mark-

    EnumFontFamiliesEx...

    Right, that is what I was searching for, "...OS wants to display". Then regardless of language, I assume, it would be correct. But, no joy. So I went through all the fonts on my computer, which TFontDialog does not show them all, and created this matrix,
  23. Mark-

    EnumFontFamiliesEx...

    Thanks for the response. Yeah, I could not find anything. The issue is multiple languages. I wonder what TFontDialog displays on French/Spanish/etc. machines.
  24. Mark-

    EnumFontFamiliesEx...

    Thanks for the response. I have the table and is it is not the text that appears in TFontDialog. I am seeking the text "description".
  25. Mark-

    VCL Styles Utils...

    Thanks for the response. It is the code from the current release on github that fails. For now, I will keep looking about.
×