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.

Dark GDK / Can really no one answer these two questions?

Author
Message
thierry st malo
18
Years of Service
User Offline
Joined: 7th Nov 2005
Location: Saint-Malo, France
Posted: 9th Jan 2009 08:13
Hi,
I have purchased the latest version of DGDK.NET and I am very pleased as it is such an improvement. I use VB Express 2008 and I have two questions.
1/ I can check if an object (in the DBPro meaning) with a given Id exists. Good. Now, if it does exist, how can I assign it to an Object3D variable?
2/ I want to start a new session of the game I am working on, and so I must clear the screen. To do so, every Object3D must, first be deleted (otherwise it remains on the screen) then set to Nothing. But, if MyObj is an Object3D variable, MyObj.Delete won't work; every time, I get an error message that says "COM object that has been separated from its underlying RCW cannot be used". First it's a nuisance, and second the object remains on the screen, even though MyObj has been finally set to Nothing. I have the same problem with Images, by the way.
Can you help?
Thanks in advance,
Thierry
APEXnow
Retired Moderator
21
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 12th Jan 2009 20:44
thierry st malo,

If you by some chance accidentally remove an overlaying Object3D class, you can physically remove the underlying 3D object by calling:

CDarkGDK.oDB3D.DeleteObject( iID )

iID is the IDentifier of the 3D object. This will then remove the object from memory.

What has confused me, is this error message - "COM object that has been separated from its underlying RCW cannot be used"

If possible, can you provide me a very simple project that is able to replicate this problem? I can try and find out what's causing it, and sort it.

Cheers

Paul.

Ifandbut
15
Years of Service
User Offline
Joined: 8th Jan 2009
Location:
Posted: 12th Jan 2009 21:54
I am very interested in the the answer to the OP's first question about checking to see if a object ID already exists. It is easy to keep track of what ID numbers are in use when you only have a few objects but, from my understanding, you can have several thousand objects in existence. It would be very hard to keep track of what IDs are in use and what ones are not when you get that many objects in use.
Michael P
18
Years of Service
User Offline
Joined: 6th Mar 2006
Location: London (UK)
Posted: 13th Jan 2009 22:13 Edited at: 13th Jan 2009 23:59
Here is how I manage object creation and deletion in C#:
puppyofkosh
17
Years of Service
User Offline
Joined: 9th Jan 2007
Location:
Posted: 14th Jan 2009 02:34
if (dbObjectExist(ID number) == 1)

would that check if the object exists?
Dark Inferno Studios
17
Years of Service
User Offline
Joined: 7th Nov 2006
Location: United Kingdom
Posted: 14th Jan 2009 20:01 Edited at: 14th Jan 2009 22:33
Quote: "if (dbObjectExist(ID number) == 1)

would that check if the object exists?"


No, that would not work because dbObjectExist(ID) does not exist in DarkGDK.NET.

But, there is a way to use IDs to delete objects:


-Mike
Michael P
18
Years of Service
User Offline
Joined: 6th Mar 2006
Location: London (UK)
Posted: 14th Jan 2009 20:03
Quote: "if (dbObjectExist(ID number) == 1)

would that check if the object exists?"


You are using the C++ version of DGDK, in this thread we are talking about the .Net version.
thierry st malo
18
Years of Service
User Offline
Joined: 7th Nov 2005
Location: Saint-Malo, France
Posted: 16th Jan 2009 08:17
@Paul :
At the moment I can no longer reproduce the problem in a consistent manner. Murphy's law, I guess. Sorry.
One final question: If I delete an object, is it necessary to delete its texture(s) first or can I do it later?
Thanks,
Thierry

Login to post a reply

Server time is: 2024-09-30 15:26:30
Your offset time is: 2024-09-30 15:26:30