|
-
Dec 9th, 2001, 04:40 PM
#1
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.
-
Dec 9th, 2001, 06:03 PM
#2
transcendental analytic
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.
-
Dec 9th, 2001, 06:29 PM
#3
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.
-
Dec 9th, 2001, 06:39 PM
#4
transcendental analytic
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.
-
Dec 9th, 2001, 07:24 PM
#5
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|