Problem with a class library (ActiveX)

I am using Visual Basic 2005 Express Edition and I'm having a problem with an ActiveX control that I want to use for my programs. To use it's functions in the library I created an instance
'Dim MPQControl As New MPQCONTROLLib.MpqControl'. After that I tested it by just using a random function. So I used 'MPQControl.AboutBox()' (AboutBox is the box that tells you about the control (author, etc.)). So I went on debugging, and clicked the MenuItem in the MenuStrip that I created so when you click it the AboutBox comes up. When I clicked it I have gotten this error:

COMException was unhandled
Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))

Image:



This happens for every function.
I am stumped. If anyone wants the sample application to look at it just give me your e-mail and I will send it to you.

Thanks.


Answer this question

Problem with a class library (ActiveX)

  • progames25

    What did he use to create it. If its a COM control then you should be able to use it from any language/application that supports COM component.

    As your in touch with the developer and VB Express is free - I would suggest that they confirm that trying VB Express on a machine where he knows that the COM component can be used. ie. The component is registered and working on that machine with whatever he used to create the component and test it.

    Put VB Express on and try to consume it.

    .


  • mpswaim

    If its an activex component have you registered the assembly

    regsvr32.exe <Filename>

    This puts all the COM registry entries in place so then you can use the component.

    Also word to the wise: dont call your variables the same name as the type - it confuses things for other when they are looking at your code as to whether your using the instance or a shared method of the type,


  • Mark Benningfield

    I used Microsoft Visual C++ 6 to create it. It is working fine on my system when using it in existing programs that use it, which are mostly written in VB versions ranging from 4 to 6.

    I have not tried it in VB 2005 Express; however, I have tried it in a VB.NET program in Visual Studio 2005 Pro and did get the same error.

  • Vladimir Chtepa

    Thanks,
    Where can I find regsvr32.exe and would I just put 'regsvr32.exe MpqCtl.ocx'


  • St&amp;#233;phane Beauchemin

    Ok, I found regsvr32.exe, but when I run it, I get this:


    I ran cmdline and did 'C:\WINDOWS\system32\regsvr32.exe /i MpqCtl.ocx' and got this:



    Or I just went to Run... and typed 'regsvr32.exe MpqCtl.ocx' but got:


    Even then I tried debugging again but I kept getting the COM error.

    How do I register it up when I run regsvr32.exe I've tried both cmdline and run as you see above. Can you help me out




  • srinivasintouch

    It should be already on your machine - do a search but normally in windows\system32 folder


  • RichLeyshon

    I'm going to move to the interop forum as its something specific to COM Interop as if you wrote it in C++ and consuming in VB and its registered using Regsvr32 then possibly this forum is more specific.


  • David Maynard

    Well you've registered the COM component now using Regsvr32 but there could be other requirements you are missing.

    What is this component If its a 3rd party component have you asked there technical support about the issue

    Normally these would come with a setup which should copy all requirements and set them up meaning you shouldnt have to concern yourself about these.


  • traimo

    The Creator of the Control has never used VBExpress or VB.net, when he got the same error as me, he does not know what is causing it. So he is actually stumped too..
    I could try re-installing the control and the registry for it again.


  • Problem with a class library (ActiveX)