Subject: Calling an ActiveX DLL in a UserControl
Posted By: arvindkrishnan Post Date: 2/6/2004 12:50:20 AM
Hi all,
 
we have been looking out for a solution for the problem mentioned below.... PLEASE HELP
 
We have a problem with us here. We have created a dll which will externalize the font for an internationalization project. Based on the LocaleID it will change the language for the form.. This works perfectly in the form once the DLL is registered and referenced.
 
We would like to implement the same in a Usercontrol which we have by the dozen in each VBP. We are trying to do this in the UserControl_Initialize which gives an error
 
The code in the externalization in the class module is as follows:
ChangeFont.dll > Class Module
Public Sub SetFont(ByRef objClient As Object)
  If TypeOf objClient Is Form Then
    Call mdlChangeFont.SetFormFonts(objClient) 'For Forms
  Else
    Call mdlChangeFont.SetControlFonts(objClient) 'For UserControl
  End If
End Sub
 
For the Form we implement it in the Form_Load() as:
Private Sub Form_Load()
   Dim ext As New ChangeFont.clsChangeFont
   ext.SetFont Me
End Sub

Please let me know in which event of the UserControl should this be put whether UserControl_Initialize or UserControl_InitProperties or UserControl_ReadProperties or should we go ahead with the tedious process of changing the Font and the script in the UserControl to MS UI Gothic and Japanese.
 
This is an urgent requirement... HELP.............................
 
Regards
Arvind Krishnan
Reply By: jlick Reply Date: 2/6/2004 11:28:32 AM
What error does it give?

John R Lick
JohnRLick@hotmail.com
Reply By: marcostraf Reply Date: 2/6/2004 3:13:35 PM
I set the font in the Initialize event with no problems at all... what error do you get?
Marco
Reply By: arvindkrishnan Reply Date: 2/8/2004 10:26:42 PM
Hi,

   The user control has got a text box and a label and a command button... The command button transfers what is presnt in the Textbox to the Label.... The point I am tyring to make here is my LocaleID and the associated Regional IDs are all in Japanese... When I put the code in the Form Load
Private Sub Form_Load()
   Dim ext As New ChangeFont.clsChangeFont
   ext.SetFont Me
End Sub
   the code works for a form i.e when i enter japanese characters in the textbox it takes it as Japanese but when the same code
Dim ext As New ChangeFont.clsChangeFont
ext.SetFont Me         
    is set to any control event of the user control and the code is run... and when Japanese characters are inserted in the Text box it gives out strange gibberish characters.

I want to know how to set this right... So that when Japanese Characters are eneterd in the Textbox of the user Control it appears in Japanese and does not give out gibberish characters.

Arvind

Reply By: marcostraf Reply Date: 2/9/2004 2:38:35 PM
Maybe the problem is in the clsChangeFont itself, that works for Forms but not for UserControls. Revise you code, or add ChangeFont to yout project and debug it.
Marco

Go to topic 9421

Return to index page 952
Return to index page 951
Return to index page 950
Return to index page 949
Return to index page 948
Return to index page 947
Return to index page 946
Return to index page 945
Return to index page 944
Return to index page 943