Information générale
Catégorie:
Fonctions Windows API
Titre:
Cpptimer.fll and COM dll problems
I downloaded the cpptimer.fll from the win32api files section to try and use as a replacement for VFP timers in a COM multi-threaded dll.
I have built a COM server based upon the the VFP sample pool manager. I am having some difficulties in using the cpptimer.fll.
I have written a small test program to see if it will meet my needs and I keep getting the same error from VFP 'internal error' when I try to use the cpptimers inittimers() function in a multi-threaded COM dll. Here is the catch. It works fine if I just instantiate my class from a procedure file or a COM exe, but if I instantiate it from a COM DLL, I get the 'internal error.' It also fails as a single threaded DLL. This is very similiar to the problems I was having using native VFP timers.
The full error text is: OLE IDispatch exception code 98 from (mydll) error in line 4 Internal error! 98...
The cpptimer version I am using was dated 12-29-99 in the zip file. I am using VFP 6 with SP3. I just read about 3 days ago that this .fll was suppose to work in .dlls
I am not sure what is going on here. I am hoping it is something I am doing wrong. I really need the functionality that cptimer.fll provides. I am using a dll so that I can deploy it with MTS.
I am including the test program I am running.
Thanks for taking a look at this.
Ron Hadler
hadlerboysen@earthlink.net
**********************************************************
define class dlltimer as custom olepublic
procedure setup
set library to cpptimer.fll additive
inittimers(1,100)
makepubvar(this)
setuptimer(1,1500,'gServer.timer()')
endproc
procedure timer
select 0
use test
insert into test (datetime, message) ;
values(datetime(), "Hit timer function")
use in test
endproc
procedure cleanup
release gServer
set library to
endproc
enddefine
procedure makepubvar(oServer)
*-make the class a public variable so that timer can call
*-the timer method of the class.
public gServer
gServer = OServer
return
* test table has two fields: datetime t, message c(25)
*
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement