Hi All, this is my first test with Delphi7 and SDK3.0 but i'm missing some basilar informations i think..
1) i've imported from c:\program file\common files\nokia\adapters\nclmsg.dll in delphi 7 using "project" "import type library"
2) i've added in my project the new compiled unit NokiaCLMessaging_CLB
3) i'm writing this Source code (trying to translating from VB example in the PDF guide of SDK3.0)
Private
{ Private declarations }
//nokia declarations
smsObj: ShortMsgAdapter;
submitObj: IGSMSubmit;
...
Procedure TfrmMain.FormCreate(Sender: TObject);
Begin
//nokia init
smsObj := CoShortMsgAdapter.Create;
End;
Procedure TfrmMain.FormClose(Sender: TObject; Var Action: TCloseAction);
Begin
//nokia destructor
smsObj := Nil;
End;
Procedure TfrmMain.btnMobileSendClick(Sender: TObject);
Var
smsEntry: IShortMessageItem;
headerArray: Array[0..5] Of Byte;
app : IInterface;
Begin
//nokia sendsms
Try
smsEntry := CoShortMessageItem.Create;
smsEntry.Set_type_(SHORTMESSAGE_TYPE_GSM_SUBMIT);
smsEntry.Get_TypeProperties(app);
submitObj := (app as IGSMSubmit);
submitObj.Set_Message('test this sms');
submitObj.Set_DestinationAddress('+39347xxxxxxx');
submitObj.Set_ServiceCenterAddress('+39349xxxxxxx');
submitObj.Set_ProtocolID(0);
submitObj.Set_DataCodingScheme(0);
submitObj.Set_ValidityPeriodRelative(255);
headerArray[0] := 5; //header length
headerArray[1] := 0; //concatenated sms
headerArray[2] := 3; //length of information element A
headerArray[3] := 48; //reference number
headerArray[4] := 1; //no of messages
headerArray[5] := 1; //sequence num,ber of sms
//submitObj.Set_UserDataHeader(headerArray); ??????????????
smsObj.SendSMS(SHORTMESSAGE_ROUTE_TYPE_ANY, submitObj);
Except
On e: exception Do
showmessage(e.message);
End;
End;
but nothing happens.. no sms received and no error shown..
My trouble is: how can smsObj.SendSMS know with port (in my case usb port) send through this SMS?
Opening HyperTerminal the first question is choosing the correct port (COM1, COM2, Nokia GSM Modem USB..) and with AT+CMGS command the SMS start normally..
thanks in advance and sorry for my english (..i'm italian..)




