Receiving text from the windows clipboard with C/AL

Steeve_globetrotter
Member Posts: 46
Hi everybody,
Sorry but in fact I have a little problem with the clipboard OCX that I donwnloaded here : http://www.mibuso.com/dlinfo.asp?FileID=149
We can use this like : t = Clipboard.TextFromClipboard;
In fact, we have to take care concerning the length of t because Navision does not allow strings largers than 250 chars. Ok...So...I have the problem and I would like a solution please because if t is larger than 250 chars I have always an error message...
Do you have other solutions like :
Count_Char := STRLEN(Clipboard.TextFromClipboard); --> Apparently, this doesn't work with the OCX directly... :-(
IF (Count_Char < 250) THEN BEGIN blablabla END
Thanks a lot for your help and I hope I will have answer about this because the deadline of the project is not far away...:-)
Sorry but in fact I have a little problem with the clipboard OCX that I donwnloaded here : http://www.mibuso.com/dlinfo.asp?FileID=149
We can use this like : t = Clipboard.TextFromClipboard;
In fact, we have to take care concerning the length of t because Navision does not allow strings largers than 250 chars. Ok...So...I have the problem and I would like a solution please because if t is larger than 250 chars I have always an error message...
Do you have other solutions like :
Count_Char := STRLEN(Clipboard.TextFromClipboard); --> Apparently, this doesn't work with the OCX directly... :-(
IF (Count_Char < 250) THEN BEGIN blablabla END
Thanks a lot for your help and I hope I will have answer about this because the deadline of the project is not far away...:-)
Steeve Le Provost
http://www.steeve-leprovost.fr.cx
http://www.steeve-leprovost.fr.cx
0
Comments
-
YourTextVar := COPYSTR(Clipboard.TextFromClipboard,1,MAXSTRLEN(YourTextVar);
Timo Lässer
Microsoft Dynamics NAV Developer since 1997
MSDynamics.de - German Microsoft Dynamics Community - member of [clip]0 -
Timo Lässer wrote:
YourTextVar := COPYSTR(Clipboard.TextFromClipboard,1,MAXSTRLEN(YourTextVar);
Thanks a lot Timo for your answer...
But it doesn't work...
This is what I have:
Variables:
String_GED - Text 250
GED_Entete - Text - 50
String_GED := COPYSTR(Clipboard.TextFromClipboard, 1, MAXSTRLEN(String_GED));
GED_Entete := SELECTSTR(1, String_GED);
IF (GED_Entete = '#*_*#GED#*_*#') THEN
BEGIN
Start := DIALOG.CONFIRM(GED detected, do you want to import it ?');
END
Try it and you will see...pffffff, I would like to resolve it...HELPPPPPPP...lol
Thanks againSteeve Le Provost
http://www.steeve-leprovost.fr.cx0 -
-
probably the line of code SELECTSTR(1, String_GED); fails because there are no commas in the String_GED or the STRPOS of the first comma >500
-
Hello,
I think this OCX is very limited usable in NAV, no offense of cource
I've did some c# coding:using System; using System.Windows.Forms; namespace ConsoleClipB { class Program { [STAThread] static void Main(string[] args) { if (Clipboard.GetDataObject() != null) { if (Clipboard.GetDataObject().GetDataPresent(DataFormats.Text)) { Console.WriteLine("{0}", Clipboard.GetDataObject().GetData(DataFormats.Text).ToString()); } else Console.WriteLine("The clipboad does not contain any text"); Console.ReadLine(); } } } }
Combine this code in : How to create a Navision dll/ocx in Visual Studio 2005 .NET AND maby Access Navision Stream From DotNet ..and you're done..
You can access the clipboard form a stream or text file..Met vriendelijke groet, best regards,
Rvduuren0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions