Not logged in. · Lost password · Register
Forum: agsXMPP SDK Support RSS
Avatar
toula #1
Member since Mar 2008 · 2 posts
Group memberships: Members
Show profile · Link to this post
Subject: typecasting C# to VC++
Hi all:
I am trying to use a C# array type in a visual C++ testcase. How do I cast something like ,RosterItem[] items, which is defined in Roster.cs (namespace agsXMPP.protocol.iq.roster) to an equivalent RosterItem array in C++.
Doing this in my C++
.
.
.
Roster ^ r = iq->Query::get();
RosterItem[]  items = r->GetRoster();

is giving the following compilation error:

Compiling...
test_console.cpp
.\test_console.cpp(69) : error C2143: syntax error : missing ';' before '['
.\test_console.cpp(69) : error C3409: empty attribute block is not allowed
.\test_console.cpp(69) : error C2146: syntax error : missing ';' before identifier 'items'
.\test_console.cpp(69) : error C2065: 'items' : undeclared identifier

Any info that can help solve this problem are greately appreciated.
Thanks
Avatar
Alex #2
Member since Feb 2003 · 4245 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
here is a small code snippet. Let me know if it helps

  1. agsXMPP::protocol::iq::roster::Roster ^ r = gcnew agsXMPP::protocol::iq::roster::Roster();
  2. r->AddRosterItem(gcnew agsXMPP::protocol::iq::roster::RosterItem(gcnew agsXMPP::Jid("test@server.com")));
  3. r->AddRosterItem(gcnew agsXMPP::protocol::iq::roster::RosterItem(gcnew agsXMPP::Jid("test2@server.com")));
  4. array<agsXMPP::protocol::iq::roster::RosterItem^, 1> ^ items = r->GetRoster();

Alex
Alexander Gnauck
AG-Software
Avatar
toula #3
Member since Mar 2008 · 2 posts
Group memberships: Members
Show profile · Link to this post
Subject: Need Examples of how to interact with XMPP
Thanks, your fix worked. I was able to compile without the type qualification which would make the code more readable.
After getting familiar with the general structure of the AG Software API, I need to understand what are the logical steps in the process. Can someone point me to examples or any other information that describe for starters how to setup+interact with the Jebber server using the agsXMPP API.
Thanks
Avatar
Jabberer #4
Member since Feb 2006 · 249 posts
Group memberships: Members
Show profile · Link to this post
the SDK ships with many examples. The MiniClient is a great example to get started with. It supports many xmpp features.
Software Developer
AG-Software
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Forum: agsXMPP SDK Support RSS