Thanks,
             I will try it out tonight.

Milind


On Fri, Jul 10, 2015 at 11:41 AM, Antonio Scuri <sc...@tecgraf.puc-rio.br>
wrote:

>  Try this:
>
> int iuplua_isihandle(lua_State *L, int pos)
> {
>   lua_getmetatable(L, pos);   /* t2 = metatable(stack(pos)) */
>   lua_pushstring(L, "iupHandle");
>   lua_gettable(L, LUA_REGISTRYINDEX);  /* t = registry["iupHandle"] */
>   if (lua_rawequal(L, -2, -1))   /* check (t2==t)? */
>   {
>     lua_pop(L, 2);
>     return 1;
>   }
>   else
>     return 0;
> }
>
>   Just commit to the SVN.
>
> Best,
> Scuri
>
>
> On Fri, Jul 10, 2015 at 12:57 PM, Milind Gupta <milind.gu...@gmail.com>
> wrote:
>
>> Hi,
>>          I wanted to pass a ihandle to C but I don't want it to throw an
>> error if it is not a ihandle but return nil and a error message. How can I
>> do that? Do I have to use the lua_touserdata function? How can I then check
>> whether I have received a ihandle without throwing an error?
>>
>> Thanks,
>> Milind
>>
>>
>>
>> ------------------------------------------------------------------------------
>> Don't Limit Your Business. Reach for the Cloud.
>> GigeNET's Cloud Solutions provide you with the tools and support that
>> you need to offload your IT needs and focus on growing your business.
>> Configured For All Businesses. Start Your Cloud Today.
>> https://www.gigenetcloud.com/
>> _______________________________________________
>> Iup-users mailing list
>> Iup-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/iup-users
>>
>>
>
>
> ------------------------------------------------------------------------------
> Don't Limit Your Business. Reach for the Cloud.
> GigeNET's Cloud Solutions provide you with the tools and support that
> you need to offload your IT needs and focus on growing your business.
> Configured For All Businesses. Start Your Cloud Today.
> https://www.gigenetcloud.com/
> _______________________________________________
> Iup-users mailing list
> Iup-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/iup-users
>
>
------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
Iup-users mailing list
Iup-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/iup-users

Reply via email to