Calling VB.NET DLL from C++

Can anyone tell me how to call a VB.NET DLL from C++.
The VB.NET DLL is registered for COM Interop.
This is simply test code...  Simplify if necessary...

=========> The VB.NET DLL code is :

Imports System
Imports System.Runtime.InteropServices

Namespace CCCVblib

  <Guid("89439AD1-756F-4f9c-BFB4-18236F63251E"), _
  InterfaceType(ComInterfaceType.InterfaceIsIDispatch)> _
 Public Interface _CCCVblib
    <DispId(1)> Function GetMonth() As Integer
  End Interface

  <Guid("1376DE24-CC2D-46cb-8BF0-887A9CAF3014"), _
   ClassInterface(ClassInterfaceType.None), _
   ProgId("CCCVblib.VBClass")> Public Class VBClass
    Implements _CCCVblib

    Public CCCVblib()

    Public Function GetMonth() As Integer Implements _CCCVblib.GetMonth
      GetMonth = DateTime.Now.Month
    End Function

  End Class

End Namespace

=========>The C++ Calling code is :

#import "CCCVblib.tlb"
using namespace CCCVblib;

int cpptest(void)
{
int res;
HRESULT hresult;
CLSID clsid;

CoInitialize(NULL);      //initialize COM library
hresult=CLSIDFromProgID(OLESTR("CCCVblib.VBClass"), &clsid);    //retrieve CLSID of component
VBClass* t=NULL;
hresult=CoCreateInstance(clsid,NULL,CLSCTX_INPROC_SERVER,__uuidof(VBClass),(LPVOID *) &t);
if(FAILED(hresult))
   return true;
res = t->GetMonth ();  //call method  <-------------- Error 'Use of undefined type CCCVblib::VBClass
t->Release();   //call method    <--------------  Error 'Use of undefined type CCCVblib::VBClass
CoUninitialize();  //Unintialize the COM library
return false;
}

The C++ does not find a function in Class VBClass.  What am doing wrong.
PSernzAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

nonubikCommented:
Try
#import "CCCVblib.tlb" raw_interfaces_only named_guids no_namespace
0
PSernzAuthor Commented:
No go...
It's got to be something basic.
0
PSernzAuthor Commented:
Found the problem myself..

The C++ function was referencing the VB DLL by the Class rather than by the assembly.
Rather than VBClass simply use the reference _CCCVblib.
0
nonubikCommented:
This seems to me like a PAQ/refund.
0
moduloCommented:
PAQed with points refunded (500)

modulo
Community Support Moderator
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C++

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.