FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Sending SMS help needed.
Posts: 1387
Joined: Fri May 23, 2008 01:33 PM
Sending SMS help needed.
Posted: Fri Nov 20, 2009 01:56 PM
Hi,

I have a MobilusSMS.dll that is supported from my local sms company. I have registered it to my windows using regsvr32 mobilussms.dll. The message is said that It is registered successfully.

I have a ASP code.
Code (fw): Select all Collapse
Sub SendSMS()
    Set objSMS = Server.CreateObject("MobilusSMS.Gateway")
    objSMS.addtosmsbasket "Message 1","05334924505"
    objSMS.addtosmsbasket "Message 2","05334924505"
    strDonus = objSMS.sendsms("test-mb1000","4574","","")
    response.write strDonus
    objSMS.clearsmsbasket
    Set objSMS = Nothing
End Sub


I try to write like this.

Code (fw): Select all Collapse
MSgInfo("I am going to Send SMS")
TRY
    objSMS := CREATEOBJECT( "MobilusSMS.Gateway" )
    objSMS:addtosmsbasket("Message 1","05334924505")
    objSMS:addtosmsbasket("Message 2","05334924505")
    strDonus := objSMS.sendsms("test-mb1000","4574","","")
    MSgInfo(strDonus)
    objSMS.clearsmsbasket()
    objSMS := Nil
CATCH oError
  MsgInfo( "Could not send SMS" + ";"  + ;
         "Error: " + TRANSFORM(oError:GenCode, NIL) + ";" + ;
         "SubC: " + TRANSFORM(oError:SubCode, NIL) + ";" + ;
         "OSCode: " + TRANSFORM(oError:OsCode, NIL) + ";" + ;
         "SubSystem: " + TRANSFORM(oError:SubSystem, NIL) + ";" + ;
         "Message: " + oError:Description )
END
oError:=NIL


When I try to compile it gives an error.
Code (fw): Select all Collapse
xHarbour Compiler build 1.2.1 (SimpLex) (Rev. 6633)
Copyright 1999-2009, http://www.xharbour.org <!-- m --><a class="postlink" href="http://www.harbour-project.org/">http://www.harbour-project.org/</a><!-- m -->
Generating object output to 'objw\EPosta.obj'...
objw\EPosta.c(23): fatal error: Could not find include file "OBJSMS.xns".


Type: C >>>Couldn't build: EPosta.obj<<<


How Can I solve this? Thanks in advance.
Regards,



Hakan ONEMLI



Harbour & MSVC 2022 & FWH 23.06
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Sendig SMS help needed.
Posted: Fri Nov 20, 2009 08:13 PM
Horizon wrote:objw\EPosta.c(23): fatal error: Could not find include file "OBJSMS.xns".


You are trying to include a non-existent file OBJSMS.xns.

EMG
Posts: 1387
Joined: Fri May 23, 2008 01:33 PM
Re: Sendig SMS help needed.
Posted: Sat Nov 21, 2009 08:31 AM
Hi Enrico,

There is not any line including this file. If I remove objSMS related file, There is not any error.

I think, When the xHB creating c file, It decide and include it. There is not any line prg and ppo files. But the c file as below.

Code (fw): Select all Collapse
#include "OBJSMS.xns"
extern HB_NS_OBJSMS OBJSMS;
/* Skipped DEFERRED call to: 'DIVERTCONSTRUCTORCALL' */
HB_FUNC_EXTERN( GETPROCADD );
HB_FUNC_EXTERN( TACTIVEX );
Regards,



Hakan ONEMLI



Harbour & MSVC 2022 & FWH 23.06
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Sendig SMS help needed.
Posted: Sat Nov 21, 2009 10:53 AM

xHarbour can't invent an include file. Please double check your source code.

EMG

Posts: 1387
Joined: Fri May 23, 2008 01:33 PM
Re: Sendig SMS help needed.
Posted: Tue Nov 24, 2009 12:48 PM
Hi,

This is the sample of my problem. Could any one compile it?

Thanks,

Code (fw): Select all Collapse
#include "FiveWin.ch"

static oWnd

//----------------------------------------------------------------------------//
 
function Main()

   local oBar

   DEFINE WINDOW oWnd TITLE "Sending SMS from FiveWin"

   DEFINE BUTTONBAR oBar _3D OF oWnd

   DEFINE BUTTON OF oBar ACTION SendSMS() TOOLTIP "Send SMS"

   SET MESSAGE OF oWnd TO "Ready" NOINSET DATE TIME KEYBOARD

   ACTIVATE WINDOW oWnd

return nil

//----------------------------------------------------------------------------//

function SendSMS()

    MSgInfo("I am going to Send SMS")
    TRY
        objSMS := CREATEOBJECT( "MobilusSMS.Gateway" )
        objSMS:addtosmsbasket("Message 1","05334924505")
        objSMS:addtosmsbasket("Message 2","05334924505")
        strDonus := objSMS.sendsms("test-mb1000","4574","","")
        MSgInfo(strDonus)
        objSMS.clearsmsbasket()
        objSMS := Nil
    CATCH oError
      MsgInfo( "Could not send SMS" + ";"  + ;
             "Error: " + TRANSFORM(oError:GenCode, NIL) + ";" + ;
             "SubC: " + TRANSFORM(oError:SubCode, NIL) + ";" + ;
             "OSCode: " + TRANSFORM(oError:OsCode, NIL) + ";" + ;
             "SubSystem: " + TRANSFORM(oError:SubSystem, NIL) + ";" + ;
             "Message: " + oError:Description )
    END
    oError:=NIL


return nil

//----------------------------------------------------------------------------//

procedure AppSys  // Xbase++ requirement

return 

//----------------------------------------------------------------------------//
Regards,



Hakan ONEMLI



Harbour & MSVC 2022 & FWH 23.06
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: Sendig SMS help needed.
Posted: Tue Nov 24, 2009 02:22 PM

Hakan,

I did a compile of your sample program and I also get the

include "OBJSMS.xns"

in the C file. I cannot find this in xharbour\include. I couldn't find in in Google either. Perhaps you need to post on the Harbour forum.

James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 1387
Joined: Fri May 23, 2008 01:33 PM
Re: Sendig SMS help needed.
Posted: Tue Nov 24, 2009 02:31 PM

Thank you James.

If you replace objSMS to diffrent one for example oAAA, It try to include the "oAAA.xns"

Regards,



Hakan ONEMLI



Harbour & MSVC 2022 & FWH 23.06
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: Sending SMS help needed.
Posted: Tue Nov 24, 2009 02:41 PM

Hakan,

This is definately a xHarbour issue, and it looks like it may be a bug. Perhaps the code hasn't been completed.

James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Sendig SMS help needed.
Posted: Tue Nov 24, 2009 06:28 PM
Horizon wrote:
Code (fw): Select all Collapse
strDonus := objSMS.sendsms("test-mb1000","4574","","")


Code (fw): Select all Collapse
strDonus := objSMS:sendsms("test-mb1000","4574","","")


Horizon wrote:
Code (fw): Select all Collapse
objSMS.clearsmsbasket()


Code (fw): Select all Collapse
objSMS:clearsmsbasket()


EMG
Posts: 1387
Joined: Fri May 23, 2008 01:33 PM
Re: Sending SMS help needed.
Posted: Tue Nov 24, 2009 09:57 PM

You are right. I have replaced them and I can compile the code. Thanks.

:oops:

Regards,



Hakan ONEMLI



Harbour & MSVC 2022 & FWH 23.06

Continue the discussion