Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DLL Talk / Problem - Possibly DLL Related

Author
Message
Floophead III
17
Years of Service
User Offline
Joined: 23rd Jan 2007
Location:
Posted: 24th Jan 2007 02:28
Ok, I'm not sure what this problem is, but I think it may be a result of a memory allocation issue. I'm not even sure it's .dll related but since I am using a .dll I figured there's a good shot that it is, especially as I am a terrible c++ coder (I didn't actually do most of the coding on it because I know very little about c++)

The project is a planetary model and works as follows:
-I generate data for planets, either randomized or user-input.
-The data is sent to a constructor in the .dll for objects there that have the planet data (mass,position,speed,name).
-The data is updated in this code here:


-The data is sent back to the program with these Functions:


-The position data is used to update graphical object positions and is outputted to a file

The problem is that object positions are ending up all at bizzare values such as:
Object:1
xpos:1.15081e+009
zpos:1.16872e+009

They don't update, they jump to that value instantly after 1 run of the program, and they are what looks like completely random numberes. The weirdest part of this problem is that it keeps surfacing randomly, and I've managed to make it go away a few times, but I don't know how I did that. I know one time I rewrote some code in the DB program and it worked fine, but that isn't working anymore. I've done debugging at every point and I can't even find out where the problem is, because whenever I type in the call dll commands as it appears in the program it gives different (sometimes correct) results, whereas the program running gives completely wacky things.

Please can someone shed some light as to what may be going on before I cry.
Torrey
20
Years of Service
User Offline
Joined: 20th Aug 2004
Location: New Jersey
Posted: 25th Jan 2007 02:11
What does your string table look like? From the quick glance I had, I didn't notice anything wrong.

IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 25th Jan 2007 14:17
Can we see your structures and arrays?

Floophead III
17
Years of Service
User Offline
Joined: 23rd Jan 2007
Location:
Posted: 26th Jan 2007 07:57
Ok, I'm not using a string table as I'm running in DB classic at the moment. Perhaps I should migrate to pro and see if the problem persists? As for structures:

DB is sending the parameters for "construction", I know that works correctly, or at least was the last time I checked.
and for arrays(I assume you mean the ones in the .dll):


I'm wondering whether using memory allocation (malloc) will help. I don't think using DBs memblocks will help me here, but if you can think of a way it will, please let me know.

Login to post a reply

Server time is: 2024-11-22 17:13:30
Your offset time is: 2024-11-22 17:13:30