CString Function from DLL

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



i have a function inside class MyClass
here:

MyClass::SayHello(CString strName)
{
return "Hello " + strName;
}


that CString function return string Hello + strName (whatever the string par
ameter the calling application will put)

now,

i want to access that function from other application, say Visual Basic- i f
ound out that class wrapper is the answer

i know wrapping function without parameter, say
function:
quote:--------------------------------------------------------------------------------
//function
MyClass::Calculate()
{
return 1+1;
}

//wrapper, so that app like VB can access function
int __stdcall CalculateFromOtherApp(void * objMyClass)
{
MyClass *dll = (MyClass *) objMyClass;
if(dll) // all went well
return dll->Calculate(); // which is 1+1 = 2
else
return 0;
}

--------------------------------------------------------------------------------
whew!, that alls, now back to my problem
how can i make a wrapper for my SayHello function???
its hard because it has PARAMETER, strName.



.



Relevant Pages

  • CString Function from DLL
    ... i have a function inside class MyClass ... MyClass::SayHello(CString strName) ... that CString function return string Hello + strName (whatever the string par ... ound out that class wrapper is the answer ...
    (microsoft.public.vc.language)
  • CString function in a DLL
    ... i have a function inside class MyClass ... MyClass::SayHello(CString strName) ... string parameter the calling application will put) ... Basic- i found out that class wrapper is the answer ...
    (microsoft.public.vc.mfc)
  • Re: CString Function from DLL
    ... BSTR is similiar to VB String so instead of MyClass:SayHelloo(CString ... strname) you have to use MyClass::SayHelloo. ... support for CString class in VB ... > ound out that class wrapper is the answer ...
    (microsoft.public.vc.mfc)