API Support Forum
OEC API > API Support > C++ COM Wrapper IContractLoadRequestBuilderPtr Crashing When Using WithSkipCount or WithResultCount
Author Topic: C++ COM Wrapper IContractLoadRequestBuilderPtr Crashing When Using WithSkipCount or WithResultCount
(2 messages, Page 1 of 1)
Moderators: VPfau
RWare2020
Posts: 206
Joined: Feb 11, 2020


Posted: May 18, 2020 @ 12:55 PM             Msg. 1 of 2
Hello,

Maybe I'm unsure how to use these methods using the COM Wrapper but this is what is happening:

Below is the block of code that I am using to do a contract load request

'''
GF_Api_COM::IContractLoadRequestBuilderPtr builder;
builder.CreateInstance(__uuidof(GF_Api_COM::ContractLoadRequestBuilder));
IContractLoadExpressionBuilderPtr exprBuilder;
exprBuilder.CreateInstance(__uuidof(GF_Api_COM::ContractLoadExpressionBuilder));
exprBuilder->WithBaseContractID(bc->id);
builder->WithExpression(exprBuilder->Build());
//builder->WithResultCount(10); - currently commented out
//builder->WithSkipCount(0); - currently commented out
GFApi()->Contracts->Load->request(builder->Build());
'''

With the code commented out of WithResultCount and WithSkipCount, the callback function: OnContractLoadRequestReceived gets called, but only one contract for the base contract gets sent back.

So adding the WithResultCount and WithSkipCount, the software crashes.

Here is my callstack if it helps:

KernelBase.dll!_RaiseException@16() Unknown
clr.dll!RaiseTheExceptionInternalOnly(class Object *,int,int) Unknown
clr.dll!UnwindAndContinueRethrowHelperAfterCatch(class Frame *,class Exception *) Unknown
clr.dll!MarshalNative::GetIDispatchForObjectNative(class Object *,bool) Unknown
mscorlib.ni.dll!7002023d() Unknown
[Frames below may be incorrect and/or missing, native debugger attempting to walk managed call stack]
mscorlib.ni.dll!701dc279() Unknown
mscorlib.ni.dll!7002b81c() Unknown
mscorlib.ni.dll!7002b3bd() Unknown
clr.dll!_CallDescrWorkerInternal@4() Unknown
clr.dll!CallDescrWorkerWithHandler(struct CallDescrData *,int) Unknown
clr.dll!MethodDescCallSite::CallTargetWorker(unsigned __int64 const *) Unknown
clr.dll!CLRToCOMLateBoundWorker(class ComPlusMethodFrame *,class ComPlusCallMethodDesc *) Unknown
clr.dll!_CLRToCOMWorker@8() Unknown
clr.dll!_GenericComPlusCallStub@0() Unknown
03ca0595() Unknown
03ca0546() Unknown
03ca3168() Unknown
0ae8cab4() Unknown
0ae8ca3c() Unknown
0ae8c9d8() Unknown
mscorlib.ni.dll!6f8a2e01() Unknown
mscorlib.ni.dll!6f8c8604() Unknown
mscorlib.ni.dll!6f8c8537() Unknown
mscorlib.ni.dll!6f8c84f4() Unknown
mscorlib.ni.dll!6f8a2d5b() Unknown
clr.dll!_CallDescrWorkerInternal@4() Unknown
clr.dll!CallDescrWorkerWithHandler(struct CallDescrData *,int) Unknown
clr.dll!MethodDescCallSite::CallTargetWorker(unsigned __int64 const *) Unknown
clr.dll!ThreadNative::KickOffThread_Worker(void *) Unknown
clr.dll!ManagedThreadBase_DispatchInner() Unknown
clr.dll!ManagedThreadBase_DispatchMiddle() Unknown
clr.dll!ManagedThreadBase_DispatchOuter() Unknown
clr.dll!ManagedThreadBase_FullTransitionWithAD() Unknown
clr.dll!ThreadNative::KickOffThread(void *) Unknown
clr.dll!Thread::intermediateThreadProc(void *) Unknown
kernel32.dll!@BaseThreadInitThunk@12() Unknown
ntdll.dll!__RtlUserThreadStart() Unknown
ntdll.dll!__RtlUserThreadStart@8() Unknown

Thanks for your help.
JSmith5611
Posts: 187
Joined:


Posted: May 19, 2020 @ 01:50 PM             Msg. 2 of 2
The problem seems to be specifically with WithSkipCount. WithResultCount should work, and WithSkipCount will be fixed on the next release.
Jason Smith