[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

08/13/2008 at 11:45AM PDT, ID: 23645808
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.2

Vb 6 using clipboard with Unicode

Asked by Maritimer in VB Objects, VB Database Programming, VB Controls

Tags: vb6

I have a function for exporting data from a FlexGrid. However I have attempted to modifiy it to export with Unicode. (We have found when someone in China has there PC set to Chinese it only export have the grid, because it uses 2 bytes) I need to be able to let my users export the full grid. My new function works with out any errors, but it still only exports half the data.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
Declare Function WideCharToMultiByte Lib "kernel32" (ByVal CodePage As Long, ByVal dwFlags As Long, ByVal lpWideCharStr As String, ByVal cchWideChar As Long, ByVal lpMultiByteStr As String, ByVal cchMultiByte As Long, ByVal lpDefaultChar As String, ByVal lpUsedDefaultChar As Long) As Long
 
 
Private Declare Function OpenClipboard Lib "user32" (ByVal hWnd As Long) As Long
Private Declare Function SetClipboardData Lib "user32" (ByVal Format As Long, ByVal hMem As Long) As Long
Private Declare Function CloseClipboard Lib "user32" () As Long
Private Declare Function EmptyClipboard Lib "user32" () As Long
 
Private Declare Function GlobalAlloc Lib "kernel32" (ByVal Flags As Long, ByVal lent As Long) As Long
 
Private Declare Function GlobalLock Lib "kernel32" (ByVal hMem As Long) As Long
Private Declare Function GlobalUnlock Lib "kernel32" (ByVal hMem As Long) As Long
 
Private Declare Sub RtlMoveMemory Lib "kernel32" (ByVal pDest As Long, ByVal pSource As Long, ByVal lent As Long)
 
Private Const CF_UNICODETEXT = &HD&
Private Const GMEM_MOVEABLE = &O2&
Private Const GMEM_ZEROINIT = &O40&
 
 
Sub exportFlexGrid2(grddet As Object, includeHeader As String)
    
    Open pubTempFolder & "\ExportWork.dat" For Output As #10
    
    Dim extStartCol     As Long
    Dim i               As Long
    Dim j               As Long
    Dim MsgString       As String
    Dim expStr          As String
    Dim bulkInput       As String * 25000
    Dim Response        As Integer
    Dim hMem As Long, pMem As Long, StringToCopy As String
    
    If includeHeader = "Y" Then
        extStartCol = 0
    Else
        extStartCol = grddet.FixedRows
    End If
    
    expStr = ""
    
    For i = extStartCol To grddet.Rows - 1
        For j = 0 To grddet.Cols - 1
            expStr = expStr & stripChr10(stripDblQuote(filterCRLF(grddet.TextMatrix(i, j)))) & Chr(9)
        Next j
'FIXIT: Print method has no Visual Basic .NET equivalent and will not be upgraded.         FixIT90210ae-R7593-R67265
        Print #10, expStr
        expStr = ""
    Next i
    Close 10
    
    ' bulk load results
    Open pubTempFolder & "\ExportWork.dat" For Binary As #10
    
    expStr = ""
    i = 0
    Do While Not EOF(10)
        i = i + 1
        Get 10, , bulkInput
        expStr = expStr & bulkInput
    Loop
        
Clipboard.Clear
 
    
    StringToCopy = expStr
    'Call OpenClipboard(Me.hWnd)
    Call OpenClipboard(Form1.grddet)
    Call EmptyClipboard
    hMem = GlobalAlloc(GMEM_MOVEABLE Or GMEM_ZEROINIT, LenB(StringToCopy))
    pMem = GlobalLock(hMem)
    Call RtlMoveMemory(pMem, StrPtr(StringToCopy), LenB(StringToCopy))
    Call GlobalUnlock(hMem)
    Call SetClipboardData(CF_UNICODETEXT, hMem)
    Call CloseClipboard
 
    
    MsgString = ""
    MsgString = MsgString & "Export Successfully Completed " & Chr(13) & Chr(13)
    MsgString = MsgString & "(Data has been cut to the ClipBoard - Typically you paste the data into Excel)"
    Response = MsgBox(MsgString, , "Notification")
    
    Close 10
    
End Sub
[+][-]08/13/08 02:41 PM, ID: 22225897

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08/13/08 03:22 PM, ID: 22226154

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08/27/08 07:45 AM, ID: 22325326

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08/27/08 09:13 AM, ID: 22326474

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08/27/08 09:33 AM, ID: 22326701

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08/27/08 10:14 AM, ID: 22327066

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: VB Objects, VB Database Programming, VB Controls
Tags: vb6
Sign Up Now!
Solution Provided By: danaseaman
Participating Experts: 1
Solution Grade: A
 
 
[+][-]08/27/08 10:44 AM, ID: 22327350

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20090824-EE-VQP-74 / EE_QW_2_20070628