DesignCAD 3D Max 2027 box
Now available

DesignCAD 2027

Hatches that follow their boundaries, an on-screen dial to turn your model, and a way to find any command by name, in a clean Windows 11 look.

A null reference pointer was passed to the stub

Started by Rifolino, September 21, 2009, 09:08:54 AM

Previous topic - Next topic

0 Members and 0 Guests are viewing this topic.

Rifolino

Hello,
I worked with DesignCad15 and the samples SDK-Delphi-Samples (Delphi6)worked well.
After I have installed DesignCad17 I get with some of the Delphi-Samples the Error "A null reference pointer was passed to the stub" when I am comiling the delphi-samples.
For example the sample HATCHTEST
The error "A null reference pointer was passed to the stub" appeares here:
      SetLength(HatchObj, 11);
     DcHatch.DrawType := dcHatchDefault;
Does anyone has an solution for this problem?
Thanks
Regards
Rifolino

DrollTroll

Hrmmm... just tried it, worked fine for me.

Did you change the code to
GetActiveOleObject('DesignCAD.Application.17')
and
CreateOleObject('DesignCAD.Application.17')
?

Otherwise it may be trying to target the wrong (possibly not-installed) version of DesignCAD...
25 years with DesignCAD

dcadRob

Could this be caused by linking to the wrong type library in the Delphi program?

DrollTroll

That is a possibility. I suggest removing DesignCAD_TLB from your uses clauses, then re-import the type library, making sure it's for the correct version, and add back in your DesignCAD_TLB uses. Mark where you save the imported _TLB.pas file, also -- you may need to adjust your directory paths in the project options.
25 years with DesignCAD

Rifolino

Thanks dcabRob and DollTroll,
You gave me the correct advice. It was the wrong library.
Regards from Germany!
Rifolino