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 / CreateDeleteString crashes dbpro

Author
Message
harrie215
16
Years of Service
User Offline
Joined: 18th Apr 2008
Location:
Posted: 18th Apr 2008 17:22


I use VC++2008, for some reason CreateDeleteString crashes dbpro.
So far I understand that for returning a string, you return a pointer to that string.

Who has more understanding of C++ then myself. And is willing to change the above code so that CreateDeleteString is gone and changed for other code.
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 18th Apr 2008 19:20
First, move the removal of the old string to the end of the function. If you use lines such as 'a$ = CopyString(a$)', your code will have problems.

Next, check your code to ensure that the Core pointer is being correctly populated. Something like this at the start of the function will do as a quick check:


harrie215
16
Years of Service
User Offline
Joined: 18th Apr 2008
Location:
Posted: 18th Apr 2008 21:06
Quote: "if (!Core) MessageBox(0, "Core not set", "", MB_OK);"


This msg is always displayed. So the core is not set.
I now use testcommands2 from dbpro third party and also the msg is always displayed.

I don't know the ins and outs of c++.
Could you tell me what I should do or change.
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 18th Apr 2008 23:10
Make sure you have the ReceiveCoreDataPtr function defined with exactly the same types as it is in section 6 of the TPC document.

If that doesn't solve the problem can you post the code you have so far - debugging without seeing the code is straining my psychic powers to the limit

harrie215
16
Years of Service
User Offline
Joined: 18th Apr 2008
Location:
Posted: 19th Apr 2008 15:59

IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 19th Apr 2008 17:09
Well, I don't know what you were doing, but I had no problems getting things to work with your code.

The complete project is attached.

Attachments

Login to view attachments
harrie215
16
Years of Service
User Offline
Joined: 18th Apr 2008
Location:
Posted: 19th Apr 2008 19:37
I 've got it working here to.
I really don't know what I did wrong, but I can finish my SQL Server DLL finally.
Thanks alot for the help.

Login to post a reply

Server time is: 2024-11-23 02:31:46
Your offset time is: 2024-11-23 02:31:46