Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: henrygev on January 30, 2006, 01:24:21 pm

Title: C++ theElement.SetNotes problem
Post by: henrygev on January 30, 2006, 01:24:21 pm
Hi

I am interfacing the EA from a C++ application.

Currently theElement.SetNotes(COleVariant("STRING"));

Will throw
Unhandled exception at 0x7c2e7c97 (mfc71d.dll) in EA2ReqProSynch.exe: 0xC0000005: Access violation reading location 0xcccc0008.

inside
COleDispatchDriver::InvokeHelperV
{
...
case VT_VARIANT:

*pArg = *va_arg(argList, VARIANT*);<<<
break;
...
}

any ideas?

Thanks ahead
Henri

P.S.

void SetNotes(VARIANT propVal)
{
 SetProperty(0xd, VT_VARIANT, propVal);
}
Title: Re: C++ theElement.SetNotes problem
Post by: henrygev on January 30, 2006, 05:50:15 pm
I am not sure but after following changes it started working (changes)

in my code

theElement.SetName((LPVARIANT)COleVariant
("string"));

in Element.h file

void SetName(VARIANT *  propVal)
{
   SetProperty(0x1, VT_VARIANT, propVal);
}