Re: Copy problem in VT100 - WeOnlyDo Discussion board

Re: Copy problem in VT100 (General questions)

by vbiggar, Monday, June 12, 2006, 07:00 (6537 days ago) @ wodDrazen

Hi Vincent,


It would be best if you can provide us access to some server where we can test your problem.
Please send private information to techsupport@weonlydo.com.

Hope I helped.


Regards,
Drazen

I don't have a server you can have access to. I tried to find a vt100 test server but I was unable to find anything. I will try to find a Unix/Linux command that sets up the VT100 formatting. There are some VT100 test environments that can be installed to a Linux server.

This much I can tell you: The copy works fine with the SelectedText property but doesn't when you use the built in COPY option from the OCX menu. What I do to work around this problem is I set up a seperate menu option for VT100 that uses the SelectedText.

Here is the code:


'############# popup menu items ############

Dim hMenu As Long, hSubMenu As Long

Private Declare Function AppendMenu Lib User32 Alias AppendMenuA (ByVal hMenu As Long, ByVal wFlags As Long, ByVal wIDNewItem As Long, ByVal lpNewItem As String) As Long

'#############################################

Private Sub Form_Load()

hMenu = wod1.ContextMenu
AppendMenu hMenu, 0, 32770, VT100 Copy
AppendMenu hMenu, 0, 32768, Commands

End Sub

'##################################################

Private Sub wod1_MenuClick(ByVal ID As Long)

Dim aa As String

Dim frmComm As frmcommander

On Error Resume Next

'This code removes the extra VBCRLF and copies the selected text to the clipboard
'without loosing the VT100 formatting

If ID = 32770 Then
aa = Mid(wod1.SelectedText, 1, Len(wod1.SelectedText) - 2)

' Copy selected text to Clipboard.
Clipboard.Clear
Clipboard.SetText aa

End If


'This is another menu option I added which opens a form

If ID = 32768 Then

stringdata = Clipboard.GetText()

Set frmComm = New frmcommander
frmComm.Show

End If
End Sub


Complete thread: