Results 1 to 5 of 5

Thread: Stumper...

  1. #1
    Zaei
    Guest

    Stumper...

    Can anyone tell me why the statements in bold will not execute?
    Code:
    ...
    RESULT EFFECTS_API ConstructParticleSystem(HANDLE emitter,INT numParts, UpdateFunction* uFunc, HANDLE texture, HANDLE attach, DWORD param, HANDLE* PSys)
    {
    	RESULT r;
    	IEmitter* em = NULL;
    	GetObjectPointer(mod, emitter, OBJ_EMITTER, (CObject**)&em);
    	if(em == NULL)
    		return INVALIDEMITTER;
    	if(em->EmitterType == IEmitter::_3D)
    ...
    em is never set to NULL. Also, the parameter "emitter" in the function call shown is not preserved (it should be 0x440d001b, and it becomes 0x0000000a). The only reason I can imagine that this is happening is that, since this is in a DLL, it is getting loaded incorrectly... I have cleaned, and rebuilt several times, as well as rebuilding all of the DLLs that use this one. I can only imagine that somehow, some memory is getting overwritten, somehow...

    Z.

  2. #2
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    what does the asm listings for the function look like?
    shouldn't you pass a pointer/reference to emitter?
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  3. #3
    Zaei
    Guest
    emitter is just a HANDLE to an object in another object. GetObjectPointer() actually returns the Object. I dont know about the assembly, because I just deleted the thing, and am going to start over =).

    Z.

  4. #4
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    Heheh lol
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  5. #5
    Zaei
    Guest
    It does seem that I was overwriting memory somewhere incorrectly, and I think that I have figured it out =).

    Z.

Posting Permissions

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



Click Here to Expand Forum to Full Width