Hi LionScribe,

Thanks for your reply! I have made libRef and clientC variables global in my
main application. But no luck yet! Do I need to make some specific settings
to get this thing done?

I am writing the following code,

UInt16 libRef = sysInvalidRefNum;
UInt32 clientC = 0;
UInt8 response = 0;
        
error = DLib_OpenLibrary(&libRef, &clientC);
        
if(error != errNone || libRef == sysInvalidRefNum || clientC == 0)
{
        FrmCustomAlert(ErrorAlert,"Can not open DLibrary", NULL, NULL);  
        return error;
} 
Else   // COMES HERE
{
        FrmCustomAlert(ErrorAlert,"DLibrary open", NULL, NULL);  
        error = errNone;
        
        x = StrIToA(y, libRef);
        FrmCustomAlert(ErrorAlert,x, NULL, NULL);  // PRINTS 14
                
        x = StrIToA(y, clientC);
        FrmCustomAlert(ErrorAlert,x, NULL, NULL);  // PRINTS -1878916844
                
        response =  DLibHello(libRef);
        
        if(response == 0)  // COMES HERE
        {
                FrmCustomAlert(ErrorAlert,"Error accesing function",
NULL,NULL);  
        }
        else
        {
                FrmCustomAlert(ErrorAlert,"u r good", NULL, NULL);  
        }
}

The function that I defined in the DLib.c file is,

UInt8 DLibHello(UInt16 refNum)
{
        #pragma unused(refNum)
        UInt8 d = 20;
        return d;
}   

clientC holds -ve value which is causing problem.

Thanks,
Keyur.



-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to