PDA

Click to See Complete Forum and Search --> : MTS programming


gmcbath
Jul 27th, 2000, 07:05 PM
Most MTS books have simplistic examples, and of all the sample sources I have looked at I cant find an answer to my question. Can someone please help?

Should I make a call to GetObjectContext() in every function in my DLL?

Obviously you are going to do that in your "main" methods, but does calling GetObjectContext() in every function (main and helper functions) make your code more efficient?

In the following example I've called GetObjectContext() in each function. Is that overkill or quality coding practice?


Function Sum(nNumber1, nNumber2) as Integer

'--- this is the main function a client would call
GetObjectContext()

'--- now call helper function to do the work
nAnswer = TotalThem(nNumber1, nNumber2)

Sum = nAnswer

End Function

Function TotalThem(nNumber1, nNumber2) as Integer

GetObjectContext()
TotalThem = nNumber1 + nNumber2

End Function