Reputation: 1583
In MFC I see it's possible to pass CStringA/CStringW
to functions that get CHAR*/WCHAR*
So for example how it is possible to create a class to act as unsigned char*
or int
for the functions that get unsigned char*
or int
as argument ?
Upvotes: 0
Views: 80
Reputation: 20993
You need to create some means of automatic conversion of your class to the type you need. The easiest way is to create a cast operator, e.g.:
operator int()
{
...
return <the int value based of your object>;
}
Upvotes: 2