Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB Components
|
VB Components Issues specific to components in VB.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB Components section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 6th, 2004, 01:50 AM
Registered User
 
Join Date: Feb 2004
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Calling an ActiveX DLL in a UserControl

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
 
Old February 6th, 2004, 12:28 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 101
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to jlick
Default

What error does it give?

John R Lick
JohnRLick@hotmail.com
 
Old February 6th, 2004, 04:13 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 627
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I set the font in the Initialize event with no problems at all... what error do you get?
Marco
 
Old February 8th, 2004, 11:26 PM
Registered User
 
Join Date: Feb 2004
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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

 
Old February 9th, 2004, 03:38 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 627
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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





Similar Threads
Thread Thread Starter Forum Replies Last Post
Calling a dll inside from a dll tiredcat Visual Basic 2005 Basics 2 August 30th, 2007 11:02 PM
Advantages /Disadvantages of ActiveX DLL & ActiveX priyank Beginning VB 6 6 February 19th, 2007 11:34 AM
Calling activeX from c# jinohere Beginning VB 6 1 August 29th, 2006 10:39 AM
HOW TO - Calling an ActiveX DLL in a UserCont arvindkrishnan VB How-To 2 August 3rd, 2005 01:14 PM
Calling an ActiveX.EXE in C++ xgbnow Visual C++ 4 March 31st, 2004 08:12 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.