T
TBass
Lots of c, new to c++, yada yada yada. You've heard it all before....
Here's my problem:
typedef struct loDriver
{
void (*ldSubscribe)(const loCaller *, int count, loTagPair til[]);
....
} loDriver;
class COPCServer
{
void
mysubscribe (const loCaller *, int count, loTagPair* til);
....
};
COPCServer::mServerInit( int lflags )
{
loDriver ld;
ld.ldSubscribe = mysubscribe;
/* compiler error */
/********************************************
* COPCServer.cpp(178) : error C2440: '=' : cannot convert from
'void (__thiscall
* COPCServer::*)(const struct loCaller *,int,struct loTagPair *)'
to 'void (__cd
* ecl *)(const struct loCaller *,int,struct loTagPair [])'
********************************************** /
...
}
I understand that the return types are not the same because the
mysubscribe function is within a class. What I don't know is how to
cast them to the same type.
Any help is greatly appreciated.
Thanks!
TBJ
Here's my problem:
From the header for a library:
typedef struct loDriver
{
void (*ldSubscribe)(const loCaller *, int count, loTagPair til[]);
....
} loDriver;
class COPCServer
{
void
mysubscribe (const loCaller *, int count, loTagPair* til);
....
};
COPCServer::mServerInit( int lflags )
{
loDriver ld;
ld.ldSubscribe = mysubscribe;
/* compiler error */
/********************************************
* COPCServer.cpp(178) : error C2440: '=' : cannot convert from
'void (__thiscall
* COPCServer::*)(const struct loCaller *,int,struct loTagPair *)'
to 'void (__cd
* ecl *)(const struct loCaller *,int,struct loTagPair [])'
********************************************** /
...
}
I understand that the return types are not the same because the
mysubscribe function is within a class. What I don't know is how to
cast them to the same type.
Any help is greatly appreciated.
Thanks!
TBJ