error in basic brew program using C++ | developer.brewmp.com error in basic brew program using C++ | developer.brewmp.com

Developer

error in basic brew program using C++

Forums:

hi,
I am getting "unresolved external symbol _AEEApplet_New referenced in function _AEEClsCreateInstance" error while compiling code.My program is

// ShapeApp.cpp
//

#include "ShapeApp.h"
#include "ShapeApp.bid"

extern "C"
{
int AEEClsCreateInstance(AEECLSID ClsId,IShell * pIShell,IModule * po,void ** ppObj)
{
*ppObj = NULL;

if(ClsId == AEECLSID_SHAPEAPP)
{
if(AEEApplet_New(sizeof(ShapeApp), ClsId, pIShell,po,(IApplet**)ppObj,
(AEEHANDLER)ShapeApp::HandleEvent,(PFNFREEAPPDATA)ShapeApp::freeAppData))
{
if(ShapeApp::initAppData((IApplet *) *ppObj))
{
return (AEE_SUCCESS);
}
}

}
return (EFAILED);

boolean ShapeApp::HandleEvent(ShapeApp * pi, AEEEvent eCode, uint16 wParam, uint32 dwParam)
{
return pi->onEvent(eCode, wParam, dwParam);

boolean ShapeApp::initAppData(IApplet * pIApplet)
{
return ((ShapeApp *) pIApplet)->initData();

void ShapeApp::freeAppData(ShapeApp * pApp)
{
pApp->freeData();

boolean ShapeApp::initData()
{
return TRUE;

void ShapeApp::freeData()
{

}
boolean ShapeApp::onEvent(AEEEvent eCode, uint16 wParam, uint32 dwParam)
{
//AECHAR szText[] = {'H','e','l','l','o',' ','W','o', 'r', 'l', 'd', '\0'};

switch (eCode){
case EVT_APP_START:
/*IDISPLAY_DrawText(pMe->m_pIDisplay, // Display instance
AEE_FONT_BOLD, // Use BOLD font
szText, // Text - Normally comes from resource
-1, // -1 = Use full string length
0, // Ignored - IDF_ALIGN_CENTER
0, // Ignored - IDF_ALIGN_MIDDLE
NULL, // No clipping
IDF_ALIGN_CENTER | IDF_ALIGN_MIDDLE);
IDISPLAY_Update (pMe->m_pIDisplay);*/

return(TRUE);

case EVT_APP_STOP:
return(TRUE);

default:
break;
}
return FALSE;

//ShapeApp.h

#if !defined(ShapeApp_h)
#define ShapeApp_h

#include "AEEModGen.h" // Module interface definitions
#include "AEEAppGen.h" // Applet interface definitions

class ShapeApp : public AEEApplet
{
public:
static boolean HandleEvent(ShapeApp * pApp, AEEEvent eCode, uint16 wparam, uint32 dwParam);
static boolean initAppData(IApplet * pIApplet);
static void freeAppData(ShapeApp * pApp);

protected:
void freeData();
boolean onEvent(AEEEvent evt, uint16 wParam, uint32 dwParam);
boolean initData();

private:

};

#endif

plz help me

Add source files AEEAppGen.c and AEEModGen.c to your workspace.
And make sure u include your "BREW\SDK\Inc" directory path in the project settings.

Add source files AEEAppGen.c and AEEModGen.c to your workspace.
And make sure u include your "BREW\SDK\Inc" directory path in the project settings.

abhimanyu wrote:Add source files AEEAppGen.c and AEEModGen.c to your workspace.
And make sure u include your "BREW\SDK\Inc" directory path in the project settings.
Thanks for ur reply.But i have added both file and also i have included inc file in properties.

abhimanyu wrote:Add source files AEEAppGen.c and AEEModGen.c to your workspace.
And make sure u include your "BREW\SDK\Inc" directory path in the project settings.
Thanks for ur reply.But i have added both file and also i have included inc file in properties.

Hi madhu, i tried with the source code provided by you, and it dosent give any errors for me.
i created a ShapeApp project, using wizards, generated the .bid and added to project, removed the .c file created by wizard, and added both the .h and .cpp files provided by you. and it works fine, try adding the .bdf file to project and rebuild the application.
Mujeeb.

Hi madhu, i tried with the source code provided by you, and it dosent give any errors for me.
i created a ShapeApp project, using wizards, generated the .bid and added to project, removed the .c file created by wizard, and added both the .h and .cpp files provided by you. and it works fine, try adding the .bdf file to project and rebuild the application.
Mujeeb.