You don't need to convert anything. LONG*
is a pointer to a LONG
, and you can assign an int
to a LONG
. Simply dereference the pointer so you can then assign it:
*m_OpenPortResult = Open(c); // <-- note the *
Or safer:
if (!m_OpenPortResult) return E_POINTER;
*m_OpenPortResult) = Open(c);
Or even:
LONG ret = Open(c);
if (m_OpenPortResult) *m_OpenPortResult = ret;