Results 1 to 5 of 5

Thread: .NET component in VB6

Hybrid View

  1. #1

    Thread Starter
    Fanatic Member wildcat_2000's Avatar
    Join Date
    Nov 2000
    Location
    Italy
    Posts
    727

    .NET component in VB6

    dear all,

    as many here, i am new to .NET though i am an experienced VB programmer.

    for integration purposes with an existing software engine, i need to provide this engine with hooking abilities to the RichTextBox component of .NET.

    since i have a very complicated project in VB6, i do not want to upgrade all this project to .NET (i have no other need to than this requisite). the idea is then to find a way to use the RichTextBox .NET component in VB6.

    to do so, i am trying to build a Windows Control Library with a graphical interface which will have the RichTextBox .NET component in it, and then use this control in my VB application.

    i am totally able to register a .NET Windows Control Library as COM, so that i can see it in my 'References' Tab of my VB6 development environment.

    the question is: how would i go to actually use a 'visible' component? references are computation routines, i need the graphical aspect of it. should i add a reference to my NET component and then create them in VB6 dynamically with something like:
    VB Code:
    1. .Controls.Add("MyNETcontrol", "ctlName")
    any suggestions MORE than welcomed...

    thank you in advance,

    wc.
    Last edited by wildcat_2000; Aug 11th, 2005 at 07:18 AM.
    When your car breaks down,
    close all windows and retry

    => please rate all users posts! <=

  2. #2

    Thread Starter
    Fanatic Member wildcat_2000's Avatar
    Join Date
    Nov 2000
    Location
    Italy
    Posts
    727

    Re: .NET component in VB6

    mendak, this what i tried.

    i created and successfully registered a ASP.NET component.

    i included it in the references of my VB project, and tried creating it dynamically:

    VB Code:
    1. Dim newObject As ARTEC.ARTEC
    2. Set newObject = Form1.Controls.Add("ARTEC.ARTEC", "TESTCTL")
    3.  
    4. With newObject
    5.     .Visible = True
    6.     .Width = 1000
    7.     .Height = 1000
    8.     .BackColor = &H0
    9. End With

    weird enough, i get a 'Type mismatch' error 13 on the Set instruction...

    no typos though, this works perfectly if i use Labels for instance. furthermore, it DID recognize the ARTEC.ARTEC class, as if i change that i get a 'could not find reference...'.

    ...hummm...
    When your car breaks down,
    close all windows and retry

    => please rate all users posts! <=

  3. #3

    Thread Starter
    Fanatic Member wildcat_2000's Avatar
    Join Date
    Nov 2000
    Location
    Italy
    Posts
    727

    Re: .NET component in VB6

    trying this...
    When your car breaks down,
    close all windows and retry

    => please rate all users posts! <=

  4. #4
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: .NET component in VB6

    Quote Originally Posted by wildcat_2000
    trying this...
    Your second post in this thread looks good. Did you find a way to add it to the components toolbar though?

    I have been through both of Scott Swigart's links, but nowhere could I find him trying to do what you did... he's been adding to references both times.

  5. #5

    Thread Starter
    Fanatic Member wildcat_2000's Avatar
    Join Date
    Nov 2000
    Location
    Italy
    Posts
    727

    Re: .NET component in VB6

    yep exactly, that is the whole point.

    even though he does reference to .NET components, in the end when he needs to avtually 'display' something he is then using standard VB objects.

    damn.

    what is it you actually need? a generic .NET component or you need a richedit20.dll wrapper for VB6?
    When your car breaks down,
    close all windows and retry

    => please rate all users posts! <=

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