TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
ksmloh
NA
42
0
setting peer information the c# way
Dec 28 2003 12:19 PM
Can anyone convert the following codes to C#? HRESULT CDirectPlay8Peer::SetPlayerName( char *pPlayerName ) { HRESULT hr; WCHAR wszData[ STR_MAX ]; mbstowcs( wszData, pPlayerName, STR_MAX ); DPN_PLAYER_INFO dpnPlayerInfo; ZeroMemory( &dpnPlayerInfo, sizeof( DPN_PLAYER_INFO) ); dpnPlayerInfo.dwSize = sizeof( DPN_PLAYER_INFO ); dpnPlayerInfo.dwInfoFlags = DPNINFO_NAME; dpnPlayerInfo.pwszName = wszData; hr = m_pDP->SetPeerInfo( &dpnPlayerInfo, 0, 0, DPNSETPEERINFO_SYNC ); return true; } I know we can import [DllImport("msvcrt.dll", CharSet=CharSet.Ansi)] public unsafe static extern int mbstowcs(string wcstr, char* mbstr, int count ); but i dont know how to continue the rest... in C#, the dpnPlayerInfo has SetData(byte[]) but I could not find any doc. that would point out where I should put the name.
Reply
Answers (
2
)
VMR9, Plug- in Compositor/Allocator-Presenter, Which is best ?
!!!!For Mahesh Chand!!!!