CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Guest

    Unable to Call the Methods of the Component

    I have created a Component in VB i.e. a dll. I have registered it. I have created a new class from Type Library Information in VC++ 6.0. I could get all related declarations of the component in the .h file of the newly created Class. But once when I try to Invoke methods of the Component it is Fails. Can any one helpme. A snippet is Highly appreciated.


  2. #2
    Join Date
    Jun 1999
    Posts
    319

    Re: Unable to Call the Methods of the Component

    Did you CoInitialize?
    Best regards,
    Faby


  3. #3
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    96

    Re: Unable to Call the Methods of the Component

    Try using the VC++ 6 #import directive. You may have made a mistake while creating your header files and this will handle the details for you by creating a smart pointer that wraps the component. The smart pointer will be defined as the name of your component with a Ptr suffix added to it. Just use #import to create the declarations, then declare the smart pointer, call CoInitialize, then call a method on your component using the -> operator (the smart pointer will create an instance of your component on the first method call), then call SmartPointer.Release() [notice the (.)] to release the component before calling CoUninitialize().


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

Featured