2009-01-13 04:45 AM - last edited on 2024-09-09 10:51 AM by Doreena Deng
BNZeroMemory (&element, sizeof (API_Element)); BNZeroMemory(&element, sizeof(API_ElementMemo)); element.header.typeID = API_ObjectID; ACAPI_Element_GetDefaults(&element, &memo); for(int j = 0; j < addParNum; j++) { API_AddParType &addPar = (*addPars); if(CHEqualCStrings(addPar.name, "AC_MarkerText_1")) { GS::ucscpy(addPar.value.uStr, L("A")); } } element.object.pos.x = c.x; element.object.pos.y = c.y; element.object.libInd = libPart.index; element.object.angle = 0; memo.params = addPars; err = ACAPI_Element_Create(&element, &memo); ACAPI_DisposeElemMemoHdls(&memo);it returns the error "APIERR_BADPARS".
2009-01-14 02:05 PM
wcyoot wrote:You haven't shown all your source code, so the problem may be outside of this, e.g how did you obtain
I have found the 'LibPart' of the element of Axis Net. But when I create, it error.
BNZeroMemory(&element, sizeof(API_ElementMemo));That should be:
BNZeroMemory(&memo, sizeof(API_ElementMemo));That bug alone may be causing the problem (because the memo fields are not initialised to zero). I recommend starting with code from the examples bundled with the API. You could look at the code for
2009-01-16 08:21 AM
2009-01-16 03:55 PM
wcyoot wrote:OK. Can you confirm you are using
I am sure I have got thelibPartand addPars, because I have debug it step and step.I also correct that bug. But has no effect.
2009-01-20 08:29 AM
2009-02-05 04:54 PM
wcyoot wrote:Where are the addPar and the libPart.index coming from? Is it possible that you really have a bad set parameters?
I'm sure I have usedACAPI_OpenUndoableSession, I have used the same way to create another LibPart, but I cannot create this by the same way.