Greetings,

I try to move a function which exist in my VB project over to a ATL project.

In VB my Function looks like
VB Code:
  1. Public Function gstrCreateBarName(ByVal vstrPrivate As String, _
  2.                                     ByVal vstrFirma As String) As String
  3.                                    
  4.     If vstrFirma <> gvDUMMY_EINTRAG Then
  5.         gstrCreateBarName = vstrPrivate & " ( " & vstrFirma & ")"
  6.     Else
  7.         gstrCreateBarName = vstrPrivate
  8.     End If
  9.  
  10. End Function

I tried the following approach in C++ but it will not work


VB Code:
  1. STDMETHODIMP CTools::MakeBarName(BSTR Gast, BSTR Firma, BSTR *BarName)
  2. {
  3.     // TODO: Add your implementation code here
  4.     bstr_t bstrFirma = Firma;
  5.     bstr_t bstrGast = Gast;
  6.     if (BSTR(bstrFirma) != BSTR("-/-"))
  7.     {
  8.         BarName = "Gast + Firma";
  9.     }
  10.     else
  11.     {
  12.         BarName = "Gast";
  13.     }
  14.     return S_OK;
  15. }

any idea how I can the VB Function get over to C++

Many thanks in advance