SAP R/3 форум ABAP консультантов
Russian ABAP Developer's Club

Home - FAQ - Search - Memberlist - Usergroups - Profile - Log in to check your private messages - Register - Log in - English
Blogs - Weblogs News

Ошибка при работе с WORD



 
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> ABAP
View previous topic :: View next topic  
Author Message
ppp680
Участник
Участник



Joined: 14 Jun 2008
Posts: 1

PostPosted: Sat Jun 14, 2008 4:30 pm    Post subject: Ошибка при работе с WORD Reply with quote

В Abap программе формируется отчет в WORD’е.
Но у пользователей периодически возникает странная ошибка. Сообщает, что метод не определен:
Метод или свойство недоступны, поскольку некоторые или все объекты не ссылаются на таблицу
, хотя на предыдущем этапе номер метода был успешно определен
(GetIDsOfNames of 'HomeKey' returned : 504 )
Смоделировать ситуацию не удается.
С чем может быть связанна эта ошибка.
Заранее благодарен.


Quote:
TRACE

<6770=Automation : SAPAWRFC entering FLUSH with RFC_HANDLE 3
<6770=Automation : SAPAWRFC VERBS = 1 HomeKey 0 C
<6770=Automation : SAPAWRFC VARS = 000000000O17
<6770=Automation : SAPAWRFC PARAMS = 1 3 #1 2
<6770=Automation : SAPAWRFC VARS = 000000000 10
<6770=Automation : CALL METHOD "HomeKey" OF [#17/0x0BC76A7C/101/0x0A8CCEE0/<CALL METHOD "SELECTION"[DispID=5] OF [#12/0x0BC566D4/101/0x0A8CCEE0/Word.Application.11]>]
#0: LONG "10"
<6770=Automation(16.04.08 17:20:27.039): GetIDsOfNames of 'HomeKey' returned : 504
<6770=Automation(Error) : CALL METHOD "HomeKey"[DispID=504] OF [#17/0x0BC76A7C/101/0x0A8CCEE0/<CALL METHOD "SELECTION"[DispID=5] OF [#12/0x0BC566D4/101/0x0A8CCEE0/Word.Application.11]>]
#0: LONG "10"
IDispatch::Invoke raised exceptionОшибка
<6770=Automation(Error) :
<6770=Automation(Error) : *****************************ERROR OCCURED IN MODULE: [<CALL METHOD "SELECTION"[DispID=5] OF [#12/0x0BC566D4/101/0x0A8CCEE0/Word.Application.11]>]**********************************************
<6770=Automation(Error) : PROGRAM_ID |MODULE_NAME |METHOD_NAME |ERROR DESCRIPTION |VERSION |GUI VERSION |MODULE_PATH |
<6770=Automation(Error) : *******************************************
<6770=Automation(Error) : <CALL METHOD "SELECTION"[DispID=5] OF [#12/0x0BC566D4/101/0x0A8CCEE0/Word.Application.11]> |Class name not found |HomeKey |Метод или свойство недоступны, поскольку некоторые или все объекты не ссылаются на таблицу |Version info not found |6405.5.29.1035 |Module doesnot exist |
<6770=Automation(Error) : ************************************************
<6770=Automation(Error) :

<6770=Automation(Error) : Exception fire by :Microsoft Word
<6770=Automation(Error)(16.04.08 17:20:27.055): Exception info:Метод или свойство недоступны, поскольку некоторые или все объекты не ссылаются на таблицу
<6770=Automation(Error) : Exception code:0
<6770=Automation(Error) : Error occured at Verb : HomeKey
<6770=Automation(Error) : Object: 17
<6770=Automation(Error) : SAPAWRFC leaving RfcFlushOle with RfcRaise(CALL_METHOD_FAILED)
<6770=Performance : OLE_FLUSH_CALL (+ RFC queue): 22072 microsec
Back to top
View user's profile Send private message
vga
Мастер
Мастер


Age: 85
Joined: 04 Oct 2007
Posts: 1218
Location: Санкт-Петербург

PostPosted: Sat Jun 14, 2008 9:21 pm    Post subject: Reply with quote

ppp680 wrote:
, хотя на предыдущем этапе номер метода был успешно определен
(GetIDsOfNames of 'HomeKey' returned : 504 )


504 - это не успешно.
Успешно S_OK = 0:
#define S_OK ((HRESULT)0x00000000L)

Проверьте, что у предшествующих вызовов
CALL METHOD OF obj m
не стоит NO FLUSH, в противном случае источником ошибок могут быть вышестоящие операторы.

Quote:

IDispatch::GetIDsOfNames
Maps a single member and an optional set of argument names to a corresponding set of integer DISPIDs, which can be used on subsequent calls to IDispatch::Invoke. The dispatch function DispGetIDsOfNames provides a standard implementation of GetIDsOfNames.

HRESULT GetIDsOfNames(
REFIID riid,
OLECHAR FAR* FAR* rgszNames,
unsigned int cNames,
LCID lcid,
DISPID FAR* rgDispId
);
Parameters
riid
Reserved for future use. Must be IID_NULL.
rgszNames
Passed-in array of names to be mapped.
cNames
Count of the names to be mapped.
lcid
The locale context in which to interpret the names.
rgDispId
Caller-allocated array, each element of which contains an identifier (ID) corresponding to one of the names passed in the rgszNames array. The first element represents the member name. The subsequent elements represent each of the member's parameters.
Return Value
The return value obtained from the returned HRESULT is one of the following:

Return value Meaning
S_OK Success.
E_OUTOFMEMORY Out of memory.
DISP_E_UNKNOWNNAME One or more of the names were not known. The returned array of DISPIDs contains DISPID_UNKNOWN for each entry that corresponds to an unknown name.
DISP_E_UNKNOWNLCID The locale identifier (LCID) was not recognized.

Comments
An IDispatch implementation can associate any positive integer ID value with a given name. Zero is reserved for the default, or Value property; –1 is reserved to indicate an unknown name; and other negative values are defined for other purposes. For example, if GetIDsOfNames is called, and the implementation does not recognize one or more of the names, it returns DISP_E_UNKNOWNNAME, and the rgDispId array contains DISPID_UNKNOWN for the entries that correspond to the unknown names.

The member and parameter DISPIDs must remain constant for the lifetime of the object. This allows a client to obtain the DISPIDs once, and cache them for later use.

When GetIDsOfNames is called with more than one name, the first name (rgszNames[0]) corresponds to the member name, and subsequent names correspond to the names of the member's parameters.

The same name may map to different DISPIDs, depending on context. For example, a name may have a DISPID when it is used as a member name with a particular interface, a different ID as a member of a different interface, and different mapping for each time it appears as a parameter.

GetIDsOfNames is used when an IDispatch client binds to names at run time. To bind at compile time instead, an IDispatch client can map names to DISPIDs by using the type information interfaces described in Type Description Interfaces. This allows a client to bind to members at compile time and avoid calling GetIDsOfNames at run time. For a description of binding at compile time, see Type Description Interfaces.

The implementation of GetIDsOfNames is case insensitive. Users that need case-sensitive name mapping should use type information interfaces to map names to DISPIDs, rather than call GetIDsOfNames.

Examples
The following code from the Lines sample file Lines.cpp implements the GetIDsOfNames member function for the CLine class. The ActiveX or OLE object uses the standard implementation, DispGetIDsOfNames. This implementation relies on DispGetIdsOfNames to validate input arguments. To help minimize security risks, include code that performs more robust validation of the input arguments.

STDMETHODIMP
CLine::GetIDsOfNames(
REFIID riid,
OLECHAR FAR* FAR* rgszNames,
UINT cNames,
LCID lcid,
DISPID FAR* rgDispId)
{
return DispGetIDsOfNames(m_ptinfo, rgszNames, cNames, rgDispId);
}
The following code might appear in an ActiveX client that calls GetIDsOfNames to get the DISPID of the CLine Color property.

HRESULT hresult;
IDispatch FAR* pdisp = (IDispatch FAR*)NULL;
DISPID dispid;
OLECHAR FAR* szMember = "color";

// Code that sets a pointer to the dispatch (pdisp) is omitted.

hresult = pdisp->GetIDsOfNames(
IID_NULL,
&szMember,
1, LOCALE_SYSTEM_DEFAULT,
&dispid);
See Also
IDispatch Interface, CreateStdDispatch, DispGetIDsOfNames, ITypeInfo::GetIDsOfNames

Судя из примерной реализации этого метода
Code:
STDMETHOD(GetIDsOfNames)(
      /*[in]*/ REFIID riid,
      /*[in,size_is(cNames)]*/ LPOLESTR* rgszNames,
      /*[in]*/ UINT cNames,
      /*[in]*/ LCID lcid,
      /*[out,size_is(cNames)]*/ DISPID* rgDispId)
   {
      VSL_DEFINE_MOCK_METHOD(GetIDsOfNames)

      VSL_CHECK_VALIDVALUE(riid);

      VSL_CHECK_VALIDVALUE_MEMCMP(rgszNames, cNames*sizeof(rgszNames[0]), validValues.cNames*sizeof(validValues.rgszNames[0]));

      VSL_CHECK_VALIDVALUE(cNames);

      VSL_CHECK_VALIDVALUE(lcid);

      VSL_SET_VALIDVALUE_MEMCPY(rgDispId, cNames*sizeof(rgDispId[0]), validValues.cNames*sizeof(validValues.rgDispId[0]));

      VSL_RETURN_VALIDVALUES();
   }

идет сначала сравнение, а потом копирование областей памяти. Поэтому падение возможно при NULL указателях на объекты откуда-куда копируется или ссылке на несуществующую память.

Пример кода, если можно?
Back to top
View user's profile Send private message Blog Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> ABAP All times are GMT + 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG.
SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG.
Every effort is made to ensure content integrity. Use information on this site at your own risk.