SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 4 of 4

Thread: help..RPC error

  1. #1
    Junior Member
    Join Date
    Jun 2002
    Posts
    24
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    help..RPC error

    User venky_vjti (venky_vjti@yahoo.com.nospam) posted:

    I get RPC error when i run this at GetMenuString(Menuhwnd,SubMenuhwnd
    [i],menu_string,1024,MF_BYPOSITION);
    m[i]=menu_string;

    other functions work fine


    i get the error at
    GUI_load("E:\\wrpres\\maps\\MenuApi.gui");
    load_dll("shell32.dll");
    extern unsigned int GetMenu(unsigned int);
    extern int GetMenuItemID(unsigned int,int);
    extern int GetSubMenu(unsigned int,int);
    extern int GetMenuString(unsigned int,int, out string<128>,int,int);
    win_get_info("Flight Reservation","handle",hWnd);
    Menuhwnd=GetMenu(hWnd);
    for(i=0;i <10;i++)
    SubMenuhwnd[i]=GetSubMenu(Menuhwnd,i);
    menu_item_count=GetMenuItemCount(Menuhwnd);
    for(i=1;i <11;i++)
    menuitemID[i]=GetMenuItemID(SubMenuhwnd[i],i);
    id1=SubMenuhwnd[1];
    for(i=1;i <11;i++)
    {
    menureturn=GetMenuString(Menuhwnd,SubMenuhwnd
    [i],menu_string,1024,MF_BYPOSITION);
    m[i]=menu_string;
    }
    GUI_unload("E:\\wrpres\\maps\\MenuApi.gui");
    GUI_close("E:\\wrpres\\maps\\MenuApi.gui");



  2. #2
    Junior Member
    Join Date
    Dec 2001
    Posts
    23
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: help..RPC error

    Use the following extern deklaration and it will work:

    extern int GetMenuStringA(int, int, out string<1024>, int, int);

    Hope this helps, Juergen


    ------------------

  3. #3
    SQA Council
    Join Date
    Mar 2001
    Posts
    8,591
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: help..RPC error

    User Shum, Garry (garry.shum@rbc.com.nospam) posted:

    ------_=_NextPart_001_01C24F71.77012E20
    Content-Type: text/plain;
    charset=iso-8859-1
    Content-Transfer-Encoding: quoted-printable

    Looks like a string overflow because the string you want to retrieve exceed=
    s
    the maximum string size defined in the extern declaration of the
    GetMenuString function. Change the "<128>" part of the...

    extern int GetMenuString(unsigned int,int, out string<128>,int,int);

    ...line to a larger value like <512> or <1024> or whatever size you need so
    that the full string you are tryuing to retrieve is not larger than what th=
    e
    GetMenuString can handle.


  4. #4
    Senior Member
    Join Date
    Jul 2001
    Posts
    216
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: help..RPC error

    User Misha (mm_ke@yahoo.com.nospam) posted:

    RPC error usually means that either you are passing incorrect parameters, or
    the function is not defined correctly, or WR cant handle the results.

    You are defining a max of 128 characters in your function definition, you
    should not then call the function telling it to use a max of 1024.

    Have you checked:
    the value of the constant MF_BYPOSITION is correct (1024)
    did you really want MF_BYCOMMAND (0) instead?
    the function exists in the dll you are loading

    By the way, SubMenuhwnd is a misleading name for a menu id.

    Kind regards,
    Misha

    ----- Original Message -----
    From: venky_vjti <venky_vjti@yahoo.com>
    To: <winrunner@yahoogroups.com>
    Sent: 29 August 2002 10:21
    Subject: [winrunner] help..RPC error


    I get RPC error when i run this at GetMenuString(Menuhwnd,SubMenuhwnd
    [i],menu_string,1024,MF_BYPOSITION);
    m[i]=menu_string;

    other functions work fine


    i get the error at
    GUI_load("E:\\wrpres\\maps\\MenuApi.gui");
    load_dll("shell32.dll");
    extern unsigned int GetMenu(unsigned int);
    extern int GetMenuItemID(unsigned int,int);
    extern int GetSubMenu(unsigned int,int);
    extern int GetMenuString(unsigned int,int, out string<128>,int,int);
    win_get_info("Flight Reservation","handle",hWnd);
    Menuhwnd=GetMenu(hWnd);
    for(i=0;i <10;i++)
    SubMenuhwnd[i]=GetSubMenu(Menuhwnd,i);
    menu_item_count=GetMenuItemCount(Menuhwnd);
    for(i=1;i <11;i++)
    menuitemID[i]=GetMenuItemID(SubMenuhwnd[i],i);
    id1=SubMenuhwnd[1];
    for(i=1;i <11;i++)
    {
    menureturn=GetMenuString(Menuhwnd,SubMenuhwnd
    [i],menu_string,1024,MF_BYPOSITION);
    m[i]=menu_string;
    }
    GUI_unload("E:\\wrpres\\maps\\MenuApi.gui");
    GUI_close("E:\\wrpres\\maps\\MenuApi.gui");


 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 10.71%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 05:32 AM.

Copyright BetaSoft Inc.