psehouri
24th July 2002, 08:49
Hi,

I just discover AFS and I read AFS.doc that I've found in this forum. It looks great...

In fact, I'm losssssssssst...

At the begining, I just would like to make a report print, through the session : tcmcs0401m000 (print units).
Someone could send me a full example I could test and debug, etc.... ??? :confused: ???

mark_h
24th July 2002, 16:54
Attached is a simple little function server I did. The way it works is that the user provides a file of part numbers on the client or PC side. I copy this file to the server, read through it, print the BOM. Once all parts are processed I then copy the file back down to the client. I also included the library I created for tibom1411m000. We are on 4c3 so I do not make any promises that this will work on 4c4. You will have to create the form and files to feed the program.

When the first f1411m000 command executes you should be able to goto a shell and see that tibom1411m000 is running as a sub-process to your session. It continues to run until the f1411m000.end is executed. Usually I end programs after execution, but this one worked just fine as is.

Good Luck!

Mark

psehouri
25th July 2002, 08:25
Hi,

I thank you for this example, but !!!
the problem is that I don't have development Licence to create forms in BaaN.
Don't you have an interface wrote in C or Java ??? using the same dll ???
About your dll, it's ok, you have generated with ttstpcreatdll. But this dll is not compiled. Do you use bic.exe to do this ???

Darren Phillips
25th July 2002, 12:10
I have the same problem with no developer licence but you can get round it by calling the complied dll from vb like this
Function exchange()

Set BaanObj = CreateObject("Baan4.Application")
BaanObj.Timeout = 30
BaanObj.ParseExecFunction "otudllolemps", "exchangemps()"
BaanObj.Quit
End Function
if you use Set BaanObj = CreateObject("Baan4.Application")
then it will use whatever BWC file is default but to call a specific one use
Set BaanObj = CreateObject("Baan4.Application.name of bwc file")

I have compiled the object with
bic d:\mpsimport.bc -o otudllolemps


the mpsimport.bc file looks like this
#pragma used dll ottstpapihand

function extern void exchangemps()
{
DLLUSAGE
import mps data
ENDDLLUSAGE
wait.and.activate("tuxch0223m000","TMUK_MPS","TMUK_MPS","WEEKLY","WEEKLY",10,10,0,1,100)
}
I use this to activate an exchange scheme from my program, although this example doesn't use stpapi commands it does show how to call your complied script using VB.

Take a look at the code and utilities section as there are examples there.

mark_h
25th July 2002, 14:35
Try searching on OLE, Visual Basic, Excel. There are most posts covering this topic. Here is one with a sample in it - follow this link (http://www.baanboard.com/baanboard/showthread.php?s=&threadid=1231&highlight=tisfc0408m000). Here (http://www.baanboard.com/baanboard/showthread.php?s=&threadid=5540) is another that may be useful.

When I use ttstpcreatdll it automatically compiles the library for me. Sometimes I have to make changes and compile it myself. If you are using the stpapi commands from VB then you really do not need to create a DLL.

Good Luck!

Mark

psehouri
25th July 2002, 16:04
Ok,

I'm very happy you sent me these links, they are very usefull and I didn't find them ... may be I have a bug ;)

Than you very much... All works wonderfull, and I precise just to who wants to know that it works directly with VBScrip... (without compilation)...

Thank you again.

fosterjr
23rd October 2003, 22:05
Under BaanIVc4 the dll to include for client2server and server2client is ottdllbw


Originally posted by mark_h
Attached is a simple little function server I did. The way it works is that the user provides a file of part numbers on the client or PC side. I copy this file to the server, read through it, print the BOM. Once all parts are processed I then copy the file back down to the client. I also included the library I created for tibom1411m000. We are on 4c3 so I do not make any promises that this will work on 4c4. You will have to create the form and files to feed the program.

When the first f1411m000 command executes you should be able to goto a shell and see that tibom1411m000 is running as a sub-process to your session. It continues to run until the f1411m000.end is executed. Usually I end programs after execution, but this one worked just fine as is.

Good Luck!

Mark