Click here to Skip to main content
15,920,669 members
Home / Discussions / COM
   

COM

 
GeneralRe: programming autocad : GetAttributes Pin
JP GOBLET18-Aug-03 6:17
JP GOBLET18-Aug-03 6:17 
GeneralRe: programming autocad : GetAttributes Pin
JP GOBLET18-Aug-03 6:46
JP GOBLET18-Aug-03 6:46 
GeneralRe: programming autocad : GetAttributes Pin
JP GOBLET18-Aug-03 21:23
JP GOBLET18-Aug-03 21:23 
GeneralRe: programming autocad : GetAttributes Pin
Steve S18-Aug-03 22:09
Steve S18-Aug-03 22:09 
GeneralRe: programming autocad : GetAttributes Pin
JP GOBLET19-Aug-03 0:25
JP GOBLET19-Aug-03 0:25 
GeneralRe: programming autocad : GetAttributes Pin
Steve S19-Aug-03 0:38
Steve S19-Aug-03 0:38 
GeneralRe: programming autocad : GetAttributes Pin
Steve S19-Aug-03 0:44
Steve S19-Aug-03 0:44 
GeneralRe: programming autocad : GetAttributes Pin
JP GOBLET19-Aug-03 2:58
JP GOBLET19-Aug-03 2:58 
there is progress, but ...

CComPtr<iacadattributereference> myDisp;
CComQIPtr<iacadattributereference ,&__uuidof(iacadattributereference)=""> myAttrib;

result = SafeArrayGetElement(arrayAttrib.parray, &i, &myDisp); // --> S_OK
try
{
myAttrib = myDisp;
if (result == S_OK)
myAttrib->GetColor(); //--> "access violation" in oleaut32.dll
...

What is strange is that, when looking inside myAttrib, it has type IAcadEntity,
and not IAcadAttributeReference; IAcadAttributeReference is derived from IAcadEntity.

GetColor() is a method of IAcadAttributeReference, and it did "access violation" in oleaut32.dll (the catch(_com_error& e) didn't catch anything).

If I try myAttrib->GetHeight(), where GetHeight() is a method of IAcadEntity, the
message is
"The value of ESP was not properly saved across a function call.
This is usually a result of calling a function declared with one
calling convention with a function pointer declared with a different
calling convention."

I don't know if it can give you some light : GetHeight() is :

inline double AutoCAD::IAcadAttributeReference::GetHeight ( )
{
double _result;
HRESULT _hr = get_Height(&_result);
if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this));
return _result;
}

and

struct __declspec(uuid("2928d4a0-ca93-11d1-b60f-0060b087e235"))
IAcadAttributeReference : IAcadEntity
{
...
virtual HRESULT __stdcall get_Height (double * Height ) = 0;
}


-------

My boss, who is a lot more aware of COM than me (but that's easy), has no clue.
So it's up to you, you grouchy Cool | :cool:

JPG
GeneralRe: programming autocad : GetAttributes Pin
JP GOBLET19-Aug-03 3:44
JP GOBLET19-Aug-03 3:44 
GeneralRe: programming autocad : GetAttributes Pin
JP GOBLET19-Aug-03 4:02
JP GOBLET19-Aug-03 4:02 
GeneralRe: programming autocad : GetAttributes Pin
Steve S19-Aug-03 4:37
Steve S19-Aug-03 4:37 
QuestionWhat is wrong with this code!!! Pin
adsilva12-Aug-03 0:36
adsilva12-Aug-03 0:36 
AnswerRe: What is wrong with this code!!! Pin
Stephane Rodriguez.12-Aug-03 0:51
Stephane Rodriguez.12-Aug-03 0:51 
AnswerRe: What is wrong with this code!!! Pin
Steve S12-Aug-03 0:51
Steve S12-Aug-03 0:51 
GeneralRe: What is wrong with this code!!! Pin
Stephane Rodriguez.12-Aug-03 1:00
Stephane Rodriguez.12-Aug-03 1:00 
GeneralRe: What is wrong with this code!!! Pin
Steve S12-Aug-03 1:01
Steve S12-Aug-03 1:01 
GeneralTree Control context menus Pin
Steven M Hunt11-Aug-03 12:36
Steven M Hunt11-Aug-03 12:36 
GeneralRe: Tree Control context menus Pin
Steve S11-Aug-03 22:04
Steve S11-Aug-03 22:04 
GeneralGetting mouse events from Powerpoint Pin
G. Raven11-Aug-03 4:10
G. Raven11-Aug-03 4:10 
GeneralSimilar problem Pin
ScarletEmerald5-Jun-04 16:22
ScarletEmerald5-Jun-04 16:22 
GeneralRecurrence object in Outlook Appointments Pin
Brigg Thorp11-Aug-03 1:44
Brigg Thorp11-Aug-03 1:44 
GeneralPlease help!! Pin
adsilva7-Aug-03 22:15
adsilva7-Aug-03 22:15 
GeneralRe: Please help!! Pin
Stephane Rodriguez.7-Aug-03 23:34
Stephane Rodriguez.7-Aug-03 23:34 
GeneralRe: Please help!! Pin
adsilva7-Aug-03 23:56
adsilva7-Aug-03 23:56 
GeneralRe: Please help!! Pin
Stephane Rodriguez.8-Aug-03 0:00
Stephane Rodriguez.8-Aug-03 0:00 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.