I am writing a pyd to control backlight using CHWRMLight, here's the code in my pyd:
Code:
void SetLight(TInt aOn)
    {
    CHWRMLight* iLight = CHWRMLight::NewLC();
    if(aOn == 1){
        iLight->LightOnL(CHWRMLight::EPrimaryDisplay | CHWRMLight::EPrimaryKeyboard);
    }
    else if (aOn == 0){
        iLight->LightOffL(CHWRMLight::EPrimaryDisplay | CHWRMLight::EPrimaryKeyboard);    
    }
    }
When I try to turn off/on the backlight using my pyd, my program crash at once after the backlight off/on successfully.
Then I tested only with this line:
Code:
    CHWRMLight* iLight = CHWRMLight::NewLC();
The program crash again. I don't know what cause the problem. Any hints please? Thank you~