|
-
Jan 22nd, 2004, 06:30 AM
#1
Thread Starter
Member
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.
-
Jan 24th, 2004, 08:06 AM
#2
Thread Starter
Member
-
Jan 26th, 2004, 08:23 AM
#3
Thread Starter
Member
One last chance...
anyone? please!
-
Jan 26th, 2004, 11:15 AM
#4
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.
-
Jan 26th, 2004, 11:35 AM
#5
Thread Starter
Member
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:
Private Sub btnPrintJob_Click()
'PURPOSE: Print the job detail
On Error GoTo ErrorHandler
CommonDialog.Flags = cdlPDReturnDC + cdlPDNoPageNums
If rtbJobDetail.SelLength = 0 Then
CommonDialog.Flags = CommonDialog.Flags + cdlPDAllPages
Else
CommonDialog.Flags = CommonDialog.Flags + cdlPDSelection
End If
CommonDialog.CancelError = True
On Error GoTo Canceled
CommonDialog.ShowPrinter
SetMousePointer vbArrowHourglass, "Printing job detail..."
rtbJobDetail.SelPrint CommonDialog.hDC
RestoreMousePointer
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|