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 / FindFirstChar crash

Author
Message
chunks chunks
17
Years of Service
User Offline
Joined: 2nd Jan 2007
Location: ackworth uk
Posted: 7th Jan 2009 03:18
hi i`ve been making a plugin for the community and i`m stuck on this function.
It compiles fine but crashes in dbpro ,it`s driving me nuts now.

I can return a string with the dbpstring() function and it works so it`s not that.



String returning function.



the similar code in dbpro works fine, thanks in advance for any help.

chunks

nvidia geforce 8600gt + amd athlon 64
windows xp pro.
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 7th Jan 2009 14:04
You need to take care with DBPro strings - an incoming string can be a null pointer, so check for that and deal with it appropriately.

Quote: "dbFindFirstChar"

Are you using the GDK to write DBPro functions?
My best advise is to not do that - I would guess that the majority of the functions would not work correctly (DBPro has it's own copy of the runtime, and the GDK will have it's own copy of the runtime that is separate and has not been initialised).

That function in particular could be written something like this:


chunks chunks
17
Years of Service
User Offline
Joined: 2nd Jan 2007
Location: ackworth uk
Posted: 7th Jan 2009 15:25
i`m calling the dbpro dlls nothing to do with gdk ,just looks like that because of the names .

anyway thanks your function is a lot easier will try that and add your name in .

nvidia geforce 8600gt + amd athlon 64
windows xp pro.
Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 7th Jan 2009 17:16
You need to include an extra first parameter to contain the old string.

[b]Yuor signutare was aresed by a deslyxic mud...
BOX2D V2 HAS HELP FILES! AND A WIKI!
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 7th Jan 2009 19:12
Quote: "just looks like that because of the names"

Ah, Aarons plug-in templates, yes?

Quote: "You need to include an extra first parameter to contain the old string"

I can't believe that I missed that! I guess it's because I just don't return strings in that way.

@chunk chunks,
Take care when using Aarons template - I've just checked it again, and despite me raising this some time ago, the templates STILL don't have the functions that return strings set up correctly. They are missing the first 'old string' parameter, just like you did.

chunks chunks
17
Years of Service
User Offline
Joined: 2nd Jan 2007
Location: ackworth uk
Posted: 7th Jan 2009 20:38
i don`t use the whole template just the header which calls the dll`s. I use some of which i think is your code to get the core and such .

the return string function there actually works ,is it causing a memory leak or something ,i`ll have to check it out .

thanks ..

nvidia geforce 8600gt + amd athlon 64
windows xp pro.
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 7th Jan 2009 21:42 Edited at: 7th Jan 2009 21:43
Ok, I'll clarify my statement - the header file is incorrect

I'll just pick one command to demonstrate - the dbRight function that you used.

Here's are the lines that have anything to do with that function:


Using the same coding convention, the code should be changed as follows:


See the extra parameter?

And just to follow that up, here's the output from a utility provided by Microsoft that decodes the exported function name (Used in the GetProcAddress call):


That shows 3 parameters, not 2 - the first is the old string that is being replaced.

chunks chunks
17
Years of Service
User Offline
Joined: 2nd Jan 2007
Location: ackworth uk
Posted: 8th Jan 2009 10:21 Edited at: 8th Jan 2009 10:45
cool thanks very much that where the crash is then . I guess this affects the other string returning commands .


edit: just tested it it now works ,wish i knew this two days ago ,just fixed the header file .

@at ianm is there any eta on your sdk/interface , i read that you might be bringing it back , at least we will know that works lol.


chunks

nvidia geforce 8600gt + amd athlon 64
windows xp pro.
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 8th Jan 2009 14:13
Quote: "at least we will know that works"

Yes, well I'm not going to comment any further on that - just know that I use it myself all of the time, so if I break it, it gets fixed immediately.

I've got so many things on my plate right now, that I haven't had chance to do any of the documentation I was planning.

But ... it's not really fair to everyone else to keep it to myself and keep you lot hanging, so I may just package everything up and upload it as it is and let you lot sort it out for yourselves - it's mostly self-explanatory anyway.

I'll start with VC++7.1 (which I still use for my plug-ins) and VC++2008, both debug and release versions.

chunks chunks
17
Years of Service
User Offline
Joined: 2nd Jan 2007
Location: ackworth uk
Posted: 8th Jan 2009 15:19
cool thanks , i will wait patiently lol.

nvidia geforce 8600gt + amd athlon 64
windows xp pro.

Login to post a reply

Server time is: 2024-11-23 06:57:41
Your offset time is: 2024-11-23 06:57:41