Results 1 to 5 of 5

Thread: richtext... class is not licensed for use

  1. #1

    Thread Starter
    Member McBain2's Avatar
    Join Date
    Sep 2003
    Location
    UK, Glos.
    Posts
    60

    richtext... class is not licensed for use

    Can anyone help me with this…

    I am converting a VB6 application to .NET which using the RichTextBox control heavily for formatted text. Being that there is no easy way to print RTF text using the .NET control I reverted to using the VB6 control for this functionality (adding the reference RichTextLib)

    This works fine – on my development PC! But as soon as I try to print on another PC I get the error "class is not licensed for use".

    I’ve tried registering DLL’s and so on as suggested by other people with this error but to no avail.

    Can anyone give me any clues on this one?
    Thanks.

  2. #2

    Thread Starter
    Member McBain2's Avatar
    Join Date
    Sep 2003
    Location
    UK, Glos.
    Posts
    60

    Unhappy

    Don't suppose there is anyone with any clue on this problem - it's giving me a major head-ache and is now in danger of having to put back an entire project?
    Help!!!!

  3. #3

    Thread Starter
    Member McBain2's Avatar
    Join Date
    Sep 2003
    Location
    UK, Glos.
    Posts
    60
    One last chance...

    anyone? please!

  4. #4
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    Do you have VB6 installed? I believe this is a licensing issue with VB6. It is how they prevented you from using certain controls without VB6. Of course this is just a guess but I remember similiar things happening with Winsock and the Trial Version of VB6. Sorry but I think you are out of luck. Maybe you could transfer the RTF to a crystal report and see if it will print it properly.

  5. #5

    Thread Starter
    Member McBain2's Avatar
    Join Date
    Sep 2003
    Location
    UK, Glos.
    Posts
    60
    Thanks for the reply.

    Yeah, I have both VS.NET 2002 and VS 6 together as I support applications written in both.

    This project is converting an old VB6 app to VB.NET and using the exact same bit of of code that the VB 6 app uses to print RTF - which works on all PC's. The only difference being that I've had to manually add in the old OCX rich text control to .NET.

    The old VB6 code goes...
    VB Code:
    1. Private Sub btnPrintJob_Click()
    2. 'PURPOSE: Print the job detail
    3. On Error GoTo ErrorHandler
    4.    
    5.    CommonDialog.Flags = cdlPDReturnDC + cdlPDNoPageNums
    6.    If rtbJobDetail.SelLength = 0 Then
    7.       CommonDialog.Flags = CommonDialog.Flags + cdlPDAllPages
    8.    Else
    9.       CommonDialog.Flags = CommonDialog.Flags + cdlPDSelection
    10.    End If
    11.    CommonDialog.CancelError = True
    12.    On Error GoTo Canceled
    13.    CommonDialog.ShowPrinter
    14.    SetMousePointer vbArrowHourglass, "Printing job detail..."
    15.    rtbJobDetail.SelPrint CommonDialog.hDC
    16.    RestoreMousePointer
    17. Exit Sub

    Which I have ended up having to covert as...

    Dim RTF As New RichTextLib.RichTextBox()
    Dim ComDialog As New MSComDlg.CommonDialog()

    'configure and show the printer selection dialog...
    With ComDialog
    RTF.SelStart = 0
    RTF.SelLength = Len(RTF.Text)
    .Flags = MSComDlg.PrinterConstants.cdlPDReturnDC + MSComDlg.PrinterConstants.cdlPDAllPages + MSComDlg.PrinterConstants.cdlPDNoSelection
    .CancelError = True
    On Error GoTo Cancelled
    .ShowPrinter()
    'print the text... (if cancel was selected, it would cause an error and exit via the error handler)
    RTF.SelPrint(.hDC)
    End With

    Cancelled:
    Exit Sub





    I will look into alternative ways however such is the way of the world this was a quickest way possible type of project so I'll probably have to shelve it for a bit until I have suffcient time.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width