Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calling a PRG from a COM server - results is it does nothing

Status
Not open for further replies.

cfsjohn

Programmer
Sep 1, 2016
66
US
In almost 30 years of writing foxpro, I've never seen this.

I have a project compiled to an exe that is my main app.
I have a separate project compiled to a MTDLL. This "program" has no user interface. I call it a COM object.
I call the MTDLL from the main app. Works great. Been working for 30 years.

There is lots of code in my COM object. One thing there is NOT is it does not call any prg's simply because I never had any need to do so.
I have a prg that contains a lot of code to do one particular function. I call that prg from many places in my main app. This prg is named disbursedeposit.prg

Recently I modified my COM object to ALSO call disbursedeposit()

Here is the code from my COM object, where it makes a call to disbursedeposit:

lnhndl=FCREATE("c:\vfe2005\dev\itf\temp\testingcomleft1.txt")
FPUTS(lnhndl,"lycurrentbalance="+STR(lycurrentbalance,12,2))
FCLOSE(lnhndl)
lnretval=100
lnretval=disbursedeposit2(lycurrentbalance,"",lopurchrec.cinmates_id,this.loparent.oposdebitsbo,this.loparent.ooipymtspercdbobo,this.loparent.oposdebitpymtsbo,this.loparent.ooinewdepositsbo,.f.,"",0.00,lopurchrec.cbookings_id,lopurchrec.cshiftlog_id,lopurchrec.cuserid,.f.,0.00)
lnhndl=FCREATE("c:\vfe2005\dev\itf\temp\testingcomleft2.txt")
FPUTS(lnhndl,"lnretval="+STR(lnretval,12,0))
FCLOSE(lnhndl)

When I run my main app and access a screen that calls the COM object, the code above gets exectued. It creates the text file named c:\vfe2005\dev\itf\temp\testingcomleft1.txt as it should.
The line lnretval=disbursedeposit2(lycurrentbalan..... gets executed
For this question I have changed disbursedeposit to do nothing except after the parameters statement, return 0
My app has no errors and it generates c:\vfe2005\dev\itf\temp\testingcomleft2.txt which contains the value of lnretval. The value is 100.

That tells me disbursedeposit is not really getting called or executed. I do not get any errors. It is as if it is just ignored at runtime.

I can only assume calling disbursedeposit from my COM object is not the same as calling it from my main app but I have no clue what to do about it.

Thanks for any advice,
John

 
Is there a copy of DisburseDeposit() within the com, because I think the main procedure can 'see' the functions
that are public in the com, but it can't 'see' the one ones in the calling procedure unless it in turn opens that
from it's side (not even sure that is possible). But if there were a copy of DisburseDeposit() (and anything it relies upon)
in your com (or if they perhaps SHARED the code file DisburseDeposit() is in) it MIGHT work...

Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.

I'm trying to cut down on the use of shrieks (exclamation marks), I'm told they are !good for you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top