inline BOOL GetMenuInfoWin50( HMENU hmenu, const MENUINFO_WIN50* lpcmi )
{
    typedef BOOL ( WINAPI* GETMENUINFO )( HMENU hmenu, const MENUINFO_WIN50* lpcmi );
    GETMENUINFO pfGetMenuInfo = ( GETMENUINFO )::GetProcAddress( _T("USER32"), "GetMenuInfo" );
    ASSERT( pfGetMenuInfo != 0 );    return pfGetMenuInfo( hmenu, lpcmi );
}

解决方案 »

  1.   

    typedef, 定义一个函数指针,一般当显示连接一个dll时,可用到这种方法
      

  2.   

    typedef
    typedef type-declaration synonym;The typedef keyword defines a synonym for the specified type-declaration. The identifier in the type-declaration becomes another name for the type, instead of naming an instance of the type. You cannot use the typedef specifier inside a function definition.A typedef declaration introduces a name that, within its scope, becomes a synonym for the type given by the decl-specifiers portion of the declaration. In contrast to the class, struct, union, and enum declarations, typedef declarations do not introduce new types — they introduce new names for existing types.Example// Example of the typedef keyword
    typedef unsigned long ulong;ulong ul;     // Equivalent to "unsigned long ul;"typedef struct mystructtag
    {
       int   i;
       float f;
       char  c;
    } mystruct;mystruct ms;   // Equivalent to "struct mystructtag ms;"typedef int (*funcptr)();  // funcptr is synonym for "pointer
                               //    to function returning int"funcptr table[10];   // Equivalent to "int (*table[10])();"--------------------------------------------------------------------------------
    Send feedback to MSDN.Look here for MSDN Online resources.
      

  3.   

    定义一种函数指针类型,这种指针能指向返回是WINAPI* 类型,参数是HMENU hmenu, const MENUINFO_WIN50* lpcmi的函数。这样便能利用GETMENUINFO 定义一个指针变量,再利用它来存放函数地址,之后再利用这指针就可以调用相应的函数了。只是不知WINAPI*是何数据类型。
      

  4.   

    这就是定义GETMENUINFO类型的指针变量,再利用GetProcAddress的得到USER32库里的GetMenuInfo函数的地址,再把返回值存入这个指针变量,这样便能在运行的时候装入DLL的函数。
      

  5.   

    BOOL WINAPI GETMENUINFO( HMENU hmenu, const MENUINFO_WIN50* lpcmi )
      

  6.   

    hi, jiangsheng(蒋晟.Net), 还记得我吗,你已经三颗星了,厉害!!!,呵呵