Thread Tools Display Modes
Prev Previous Post   Next Post Next
01/14/16, 11:16 PM   #1
vandel212
Join Date: Jan 2016
Posts: 17
Illegal Call CopyAllTextToClipboard

First off let me appologize, it seems as though I have taken over the forum with all my posts. I truely do look for solutions before posting here (Google + Forum search tool + Wiki + API documentation), but being that this isn't the most common programming language, and it revolves around a MMO's API the available info is limited (espeically compared to straight up c# (my bread and butter)). I really appreciate all the help, you guys/gals are fantastic!

Ok, so I found this nifty little thread here with some code on how to copy text to the clipboard. When I run the code, it tells me an addon is trying to make an illegal call to [CopyAllTextToClipboard]. Being that there are addons here that do exactly that, there must be something I'm missing. Any help would be greatly appreciated.

Here is the code that uses it, so when I open up my inbox I get the error (starting at line 12). Right now I'm just trying to get it to copy "Hello World" to the clipboard:

Lua Code:
  1. function CopyMailStuff.ReadableMail(eventCode, mailId) 
  2.     AttachmentsString = ""
  3.     local mail = {}
  4.     mail.senderDisplayName, mail.senderCharacterName, mail.subject, mail.icon, mail.unread, mail.fromSystem, mail.fromCustomerService,
  5.     mail.returned, mail.numAttachments, mail.attachedMoney, mail.codAmount, mail.expiresInDays, mail.secsSinceReceived = GetMailItemInfo(mailId)
  6.  
  7.     if mail.numAttachments > 0 then
  8.         local intAttachmentCounter = 1     
  9.         local intNumberOfAttachments = mail.numAttachments
  10.         AttachmentsString = mailId .. "<,|,>" ..    mail.senderDisplayName .. "<,|,>" .. mail.subject ..
  11.        
  12.         clipBoardControl = WINDOW_MANAGER:CreateControl("Chat2ClipboardControl", GuiRoot, CT_EDITBOX)
  13.         clipBoardControl:SetHidden(true)
  14.         clipBoardControl:SetMaxInputChars(1000)
  15.        
  16.         clipBoardControl:SetText("Hello World")
  17.         clipBoardControl:CopyAllTextToClipboard()  
  18.        
  19.     end
  20. end

Last edited by vandel212 : 01/14/16 at 11:18 PM.
  Reply With Quote
 

ESOUI » Developer Discussions » Lua/XML Help » Illegal Call CopyAllTextToClipboard


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off