Results 1 to 4 of 4

Thread: non-zero reference count! why?

  1. #1

    non-zero reference count! why?

    the error appears right after the
    D3DXCreateBox(m_pd3dDevice,1,1,1, thefbox.Themesh,nil);

    the class that represents thefbox is:

    type

    TMyD3DMesh = class
    TheMesh : ID3DXMesh;
    TheMatrix : TD3DXMatrix;
    end;

    var thefbox : TMyD3DMesh;

    where is the error?
    well i cant see it cous when i create a box this way:
    D3DXCreateBox(m_pd3dDevice,1,1,1 , fBox,nil);
    there is no error but when i try to use the class i get the non-zero reference count
    why is that?

  2. #2

    non-zero reference count! why?

    As I've already writen to you - please read basics of MS COM architecture; delphi way of implementing COM (interfaces, smart pointers); what are Delphi "classes" and how to use them.

    You should:

    [pascal]

    begin
    thefbox := TMyD3DMesh.Create; // This call allocates class on heap and clears internal class members - in our case interface pointers
    D3DXCreateBox(m_pd3dDevice,1,1,1, thefbox.Themesh,nil);
    end;
    [/pascal]
    There are only 10 types of people in this world; those who understand binary and those who don't.

  3. #3

    non-zero reference count! why?

    have you actually tried to debug your app - seems error message is showing because exception is raized at D3DXCreateBox(...) and error message is generated by destructor of CD3DApplication class... :shock:
    There are only 10 types of people in this world; those who understand binary and those who don't.

  4. #4

    non-zero reference count! why?

    i've found my error ....
    and clootie yeah i used .create method
    the error was technical.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •