don't access ActiveX

jahuer1

Newcomer
Joined
Oct 23, 2003
Messages
9
I have a problem accessing the ActiveX control msmask32.ocx when creating MaskedEdit-components dynamically.
The program has to run on a machine where only the .NET-Framework is installed. The msmask32.ocx is registered. Static programed MaskedEdit's work fine there.
(On my machine with the dev.env. no problem occurs!)

This is my class:

Public Class QuestTextPanel
Inherits System.Windows.Forms.Panel
...

Private Sub init(ByVal qNr As Integer)
...
Select Case question.kind
...
Case 3
Dim dateText As AxMSMask.AxMaskEdBox = _
New AxMSMask.AxMaskEdBox
dateText.Parent = Me
dateText.Mask = "####-##-##"
...
End Select
End Sub

Here the following error occurs:

"You do not have a licence to use this ActiveX Control!"

Where is the bug?
 
No bug - it's as the error says you don't have a licence to use the control at design time. The control shipped as part of VB6 - you will need VB6 installed on the same machine as your VS.Net ide to get it to work.
Also you may need to check the EULA to see if you are legally allowed to redistribute the control depending on how you aquire your copy of VB6.
 
I think this is not quite the point. Everything works fine I use the MaskedEdit hardcoded: means I put a MaskedEdit at design-time on my form.

My problem occurs when I want to create it dynamically at run time!
The bug is at the line (see initial text, too):

dateText.Mask = "####-##-##"

VB.NET help file says this is possible.
 
I have been having the same problem with MSComm32.ocx.

After reading what you said about making the control at runtime, as I have been doing, I tried newing it up at declaration.

It works!!!!

Cheers,

Ander

:D
 
ActiveX is unmanaged code, so try not to use it in .NET apps, you can find controls that can emulate the masked edit control, but the .NET way, try looking for it in Planet Source Code or Code Project, even better, code your own control, will be fun for you, and then you can post it :)
 
Back
Top