//in spctl.h pjmedia_snd_dev_info m_DevInfos[255]; //in sipctl.cpp int CSipCtl::GetNumSoundDevs() { unsigned int result = 255; pj_status_t status; status = pjsua_enum_snd_devs(m_DevInfos,&result); // this line fails! :O if(status) { return -1; } return result; } The problem I'm having is when I set count to anything other than zero, I get an access violation in memcpy.asm - I've tried the usual suspects (checking pointers etc) but no luck - any ideas?