ckassab
21st April 2006, 01:58
Hi:

I have create a dll to handle via api the session tdpur4120m000
I have BaaNIVc4 for Windows NT

if i do only this:

dll4120f.put.Receipt_Number( existing.receipt )
dll4120f.end( )

and then return to my main session it hangs, i need to kill the session with the shell.

What could cause this?

Thank you in advance for your help

Carlos Kassab

mr_suleyman
21st April 2006, 08:06
We should check source of your DLL. You didn't give it . Anayway , Did you use 'stpapi.end.sesion("session name")' in your DLL. If you don't use it , try it !

Good Luck

mark_h
21st April 2006, 15:14
Moved to the correct forum. Also if you search this forum for the session you will find several threads (like this one) (http://www.baanboard.com/baanboard/showthread.php?t=7511&highlight=tdpur4120m000) that may help you. And if you include my login (mark_h) you will find some sample code.

ckassab
21st April 2006, 17:32
Thank you for your reply and help.

I have changed my main session to test with a simple maintain session i have creted.

First i created a table with the next fields: Name, Telephone
my table is ectst001, the index is by name.

Then i created a maintain session for this table.
ectst0101m000
now i ran ttstpcreatdll and my dll is ectstdll0101f

My dll source for the functions i am using is the next:
function extern void dll0101f.put.ectst001.name( const domain tcmcs.str70 value )
{
DLLUSAGE
Function to set ectst001.name ( ectst001.name ) in session ectst0101m000
arg: - value to put in ectst001.name
ENDDLLUSAGE
stpapi.put.field( "ectst0101m000", "ectst001.name", value )
}

function extern long dll0101f.find( )
{
DLLUSAGE
Function to find a record in session ectst0101m000
Search fields must be put before calling this function
ENDDLLUSAGE
return( stpapi.find( "ectst0101m000" ) )
}


function extern void dll0101f.end( )
{
DLLUSAGE
Function to end connection to session ectst0101m000
ENDDLLUSAGE
stpapi.end.session( "ectst0101m000" )
}
Now i created a second session ectst0102m000 where i call my dll in the next way:
dll0101f.put.ectst001.name( "RocĂ­o Lopez" )
dll0101f.find( )
dll0101f.end( )
After this the session ectst0102m000 hangs, BaaN never returns the control.
A note here is that if a call this dll from a c# program via OLE, it works fine.

I do not know if i need to update the api or something in BaaN.


Thank you in advance.

Carlos Kassab

mark_h
21st April 2006, 18:46
Read my mantra. :) In reality you do not need to perform any action. You should just be able to start and end the session. For starters get the latest stpapi patches.

ckassab
22nd April 2006, 00:29
Thank you very much for your great help.

I am going to update my api

Carlos Kassab

Paul P
22nd May 2006, 05:30
Hi guys,
What just happened to me is the opposite of what Carlos went through. My API code sequence works fine inside BaanIV but just refused to work all the way through when accessed from outside through OLE. Will be advising update of STP and probably session objects. Anybody else have had similar experience? Thanks
Rgds,
Paul

Paul P
4th September 2006, 11:42
Though I'll update everyone. So, we updated our STP to the latest and greatest from BS, and now the API code works fine from inside and from outside of BaanIV :) . Mark's mantra works well

Rgds,
Paul