windows下开发cocos2dx,该怎么添加qq互联呢

windows下开发cocos2dx,该怎么添加qq互联呢求指教

照着qq互联上的文档写,但是有错,求指教!

/****************************************************************************
Copyright © 2008-2010 Ricardo Quesada
Copyright © 2010-2012 cocos2d-x.org
Copyright © 2011 Zynga Inc.
Copyright © 2013-2014 Chukong Technologies Inc.

http://www.cocos2d-x.org

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the “Software”), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/
package org.cocos2dx.cpp;

import org.cocos2dx.lib.Cocos2dxActivity;
import org.cocos2dx.lib.Cocos2dxGLSurfaceView;
import org.json.JSONObject;

import android.content.Intent;

import com.tencent.tauth.IUiListener;
import com.tencent.tauth.Tencent;
import com.tencent.tauth.UiError;

public class AppActivity extends Cocos2dxActivity {
public Cocos2dxGLSurfaceView onCreateView() {
Cocos2dxGLSurfaceView glSurfaceView = new Cocos2dxGLSurfaceView(this);
glSurfaceView.setEGLConfigChooser(5, 6, 5, 0, 16, 8);
return glSurfaceView;
}
public static final String AppID=“1102009676”;
protected Tencent mTencent;
// private static AppActivity context;
public void initTencent()
{
mTencent= Tencent.createInstance(AppID, this);
}
public void login()
{
//Tencent mTencent = Tencent.createInstance(AppID,context.getApplicationContext());

           // if (!mTencent.isSessionValid()) {
        mTencent.login(this, "all", new IUiListener() {     
         
            public void onError(UiError arg0) {
                // TODO Auto-generated method stub
               // fail(arg0);
            }
 
            public void onComplete(JSONObject arg0) {
                // TODO Auto-generated method stub
               // success(arg0);
            }
 
         
            public void onCancel() {
                // TODO Auto-generated method stub
             //   cancel();
            }

            @Override
            public void onComplete(Object arg0) {
                // TODO Auto-generated method stub
                
            }

            
        });
    }

// }
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
mTencent.onActivityResult(requestCode, resultCode, data) ;
}
}

这部分熟读下sdk应该就ok了。

我写了个连微信的,希望有帮助。

http://www.cocoachina.com/bbs/read.php?tid=224616