Results 1 to 5 of 5

Thread: VB.Net and ActiveX

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jun 2005
    Posts
    17

    VB.Net and ActiveX

    I have some VB6 code that I made a ActiveX.dll with and I cannot get it to work properly. If I make a very simple activex dll with a msgbox using binary compatiability and using tlbimp to convert it to .net it works fine. I am trying to pass a value back from the Activex dll when a certain event occurs but when I try to type Public Function Example() as integer or Public Function Example(ByVal x as integer) it gives me a compatibility error and says that I should change it.

    Any ideas?

    Thanks
    J

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

    Re: VB.Net and ActiveX

    You're not clear with your post. Are you trying to use your ActiveX dll in your .net app? If so, how did you reference the DLL in your .net app?

    And what is the exact error message? (When the messagebox pops up you can copy the error message from there)

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Jun 2005
    Posts
    17

    Re: VB.Net and ActiveX

    Yes I am trying to use my activex dll (from vb6) in vb.net. I referenced the dll by going Project -> Add Refernce -> COM tab -> then I browsed to the dll.

    I am not getting a error in .net, but in vb6. I am trying to pass data out of the dll into .net but vb6 gives me a compatibility error. It says that the current function is of type Variant and I am trying to make it type Integer. It wants me to rewrite the code to make it binary compatible.

    Does this help? Do you want a copy of the code or a screenshot?

    Thanks
    J

  4. #4
    Fanatic Member x-ice's Avatar
    Join Date
    Mar 2004
    Location
    UK
    Posts
    671

    Re: VB.Net and ActiveX

    Quote Originally Posted by X7JAY7X
    Yes I am trying to use my activex dll (from vb6) in vb.net. I referenced the dll by going Project -> Add Refernce -> COM tab -> then I browsed to the dll.

    I am not getting a error in .net, but in vb6. I am trying to pass data out of the dll into .net but vb6 gives me a compatibility error. It says that the current function is of type Variant and I am trying to make it type Integer. It wants me to rewrite the code to make it binary compatible.

    Does this help? Do you want a copy of the code or a screenshot?

    Thanks
    J
    Yep, can you paste the code, and exact error with the line of code that is highlighted?

  5. #5
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339

    Re: VB.Net and ActiveX

    The type Integer is different in VB6 then in .NET, this is probably what is causing the error.

    VB6 Integer = .NET Short
    VB6 Long = .NET Integer

    .NET made the Integers hold more so a VB6 Integer does not equal a .NET integer. You can try switching the VB6 definition to Long or the .NET type to Short.

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