|
-
Nov 18th, 2023, 02:35 PM
#7
Re: [VB6] How to embed console in a VB6 form
 Originally Posted by xxdoc123
thanks,Your code is great
I made a little modification as per my needs
Code:
Private Declare Function WriteFile _
Lib "kernel32" (ByVal hFile As Long, _
ByVal lpBuf As Long, _
ByVal cToWrite As Long, _
ByRef cWritten As Long, _
ByVal lpOverlapped As Any) As Long
Public Function WriteInput(sValue As String) As Boolean
Dim lWritten As Long
Dim BtTest() As Byte
Dim Buflen As Long
BtTest = StrConv(sValue, vbFromUnicode)
Buflen = UBound(BtTest) + 1
If m_hWriteInput <> 0 Then
If WriteFile(m_hWriteInput, StrPtr(BtTest), Buflen, lWritten, 0&) <> 0 Then
Call FlushFileBuffers(m_hWriteInput)
WriteInput = True
End If
End If
End Function
Fixed this using CharToOemBuffA API instead of StrConv as it was not working here w/ cyrillic characters unless using the correct API in WriteInput.
cheers,
</wqw>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|