cURL in a service

cURL in a service

Postby TimStone » Sun Nov 27, 2022 11:43 pm

I have a windows service fully functional, except that I'm trying to add the ability to send text messages using cURL.

I am using Harbour, MSVC, and FWH.

In a normal windows application I have no problem. I have a SMS texting program using the same libraries and commands, and it works great.

This is the offending line:
hCurl := curl_easy_init()

IF this line exists in the program, then the service will not start. However, without this operation, it works perfectly ( though of course I cannot send the text messages ).

The service does a number of functions, and the job I want it to perform here is to send reminder text messages automatically.

Is Harbour's implementation of cURL not compatible with running in a service ?

Is there an alternative ?
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2904
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: cURL in a service

Postby Antonio Linares » Mon Nov 28, 2022 11:48 am

Dear Tim,

As far as I know it, you can only call curl_easy_init() once from your app.

If you call it more than once, then it will fail
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41314
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: cURL in a service

Postby TimStone » Mon Nov 28, 2022 6:09 pm

Antonio,

First, this is an application running as a Windows Service.

curl_easy_init() is in a function called once a day by a timer. It is released after it is used.

Just having that line in the code results in the SERVICE not being able to start. If I comment out the line the service starts and runs as normal.

Starting the SERVICE does NOT immediately call the function.

For those who might want a sample, the issue is including cURL_easy in a service. Has anyone done this ?

Tim
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2904
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: cURL in a service RESOLVED

Postby TimStone » Mon Nov 28, 2022 10:49 pm

My mistake. I had the 64 bit cURL .dll in place but built the service as 32 bit. Now with the right resource, it's running.
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2904
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: cURL in a service

Postby Antonio Linares » Tue Nov 29, 2022 7:58 am

very good! :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41314
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 86 guests