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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to resolve Error 1440 in VFP7? (No such thing in VB6 equivalent)

Status
Not open for further replies.

wcglorioso

Programmer
Jul 23, 2003
30
PH
ERROR DESCRIPTION (from Microsoft Visual FoxPro Language Reference - online VFP7 help):

OLE exception error "name". OLE object may be corrupt. (Error 1440)
A COM object or COM control caused a general protection fault, possibly because it was passed bad parameters. Release or reload the COM object or COM control.


I am using the Nokia PC Connectivity SDK version 2.1 downloaded from
I would like to create an application using VFP7 IDE and not the recommended programming IDEs (VB6,VC++6,Delphi) but

I am having trouble resolving the above error.

I see nothing wrong with my VB6 to VFP7 translation.

Please help me figure out what I have missed out.

Thanks for any help.

The following VB6 sample code is working as expected:

[01] ' VISUAL BASIC CODE (WORKING)
[02] Dim objSMS As SMS3ASuiteLib.SMS_SuiteAdapter
[03] Dim objMess As SMS3ASuiteLib.ShortMessage
[04]
[05] Dim CellNum As String
[06] Dim TextMesg As String
[07]
[08] CellNum = '353863982273'
[09] TextMesg = 'TESTING NOKIA DATA SUITE'
[10]
[11] If Len(CellNum) <> 0 And Len(TextMesg) <> 0 Then
[12] Set objSMS = New SMS3ASuiteLib.SMS_SuiteAdapter
[13] Set objMess = objSMS.CreateShortMsg
[14]
[15] objMess.UserDataText = TextMesg
[16] objMess.OtherEndAddress = CellNum
[17]
[18] Call objSMS.Send(objMess)
[19]
[20] Set objMess = Nothing
[21] objSMS.Terminate
[22] Set objSMS = Nothing
[23] Else
[24] If Len(CellNum) = 0 Then
[25]
[26] MsgBox &quot;No Phone number has been entered, please enter in a phone number.&quot;, _
[27] vbCritical + vbOKOnly, _
[28] &quot;Error Management System&quot;
[29]
[30] End If
[31]
[32] If Len(TextMesg) = 0 Then
[33]
[34] MsgBox &quot;No message exists, please enter in a message.&quot;, _
[35] vbCritical + vbOKOnly, _
[36] &quot;Error Management System&quot;
[37]
[38] End If
[39]
[40] End If

The following VFP7 code translation fires up the debugger at line [18] indicating an OLE error 1440:

Note that at line [13a], I assigned objMess to .NULL. to have its data type correctly regarded as an object and not a boolean (which is the case when I leave it as ease).

Note that at line [13b], I used the syntax based on the type library of the COM server I am using.

That is,
IDL:
[helpstring(&quot;method CreateShortMsg&quot;)]
HRESULT _stdcall CreateShortMsg([out, retval] IShortMessage** ppSMS);
VFP7:
CreateShortMsg(ppSMS as IShortMessage @) as VOID

Note that at line [], I used the syntax based on the type library of the COM server I am using.

That is,
IDL:
[helpstring(&quot;method Send&quot;)]
HRESULT _stdcall Send([in] IShortMessage* pSMS);
VFP7:
Send(pSMS as IShortMessage) as VOID

[01] * VISUAL FOXPRO TRANSLATION(WITH ERROR 1440)
[02] LOCAL objSMS As SMS3ASuiteLib.SMS_SuiteAdapter
[03] LOCAL objMess As SMS3ASuiteLib.ShortMessage
[04]
[05] LOCAL CellNum
[06] LOCAL TextMesg
[07]
[08] CellNum = '353863982273'
[09] TextMesg = 'TESTING NOKIA DATA SUITE'
[10]
[11] If Len(CellNum) # 0 And Len(TextMesg) # 0
[12] objSMS = CREATEOBJECTEX('SMSAdapter.SMSAdapter.1','','')
[13a] objMess = .NULL. && objMess is initially a boolean with value = .F.
[13b] objSMS.CreateShortMsg(@objMess)
[14]
[15] objMess.UserDataText = TextMesg
[16] objMess.OtherEndAddress = CellNum
[17]
[18] objSMS.Send(objMess)
[19]
[20] objMess = .NULL.
[21] objSMS.Terminate
[22] objSMS = .NULL.
[23] Else
[24] If Len(CellNum) = 0 Then
[25]
[26] MessageBox(&quot;No Phone number has been entered, please enter in a phone number.&quot;, ;
[27] 48 + 0, ;
[28] &quot;Error Management System&quot;
[29]
[30] EndIf
[31]
[32] If Len(TextMesg) = 0
[33]
[34] MessageBox(&quot;No message exists, please enter in a message.&quot;, ;
[35] 48 + 0, ;
[36] &quot;Error Management System&quot;
[37]
[38] EndIf
[39]
[40] EndIf

Here is the Type Library of the COM Server I am working on:

// Generated .IDL file (by the OLE/COM Object Viewer)
//
// typelib filename: Sms3aS.dll

[
uuid(3369A2B7-E58F-11D1-B1FC-006097838405),
version(1.0),
helpstring(&quot;Nokia SMS Adapter (PC Suite 3.7)&quot;)
]
library SMS3ASuiteLib
{
// TLib : // TLib : OLE Automation : {00020430-0000-0000-C000-000000000046}
importlib(&quot;stdole2.tlb&quot;);

// Forward declare all types defined in this typelib
interface ISMSSend;
interface IShortMessage;
interface ISMSMemory;
interface ISMSSettings;
interface ISMSReceiveNotify;
interface IGraphicalMS;
interface IGMSPicture;

[
uuid(2E6EB774-804D-11D1-B1FC-006097838405),
helpstring(&quot;Nokia SMS (PC Suite 3.7)&quot;)
]
coclass SMS_SuiteAdapter {
[default] interface ISMSSend;
interface ISMSMemory;
interface ISMSSettings;
[default, source] interface ISMSReceiveNotify;
interface IGraphicalMS;
};

[
odl,
uuid(3369A2C4-E58F-11D1-B1FC-006097838405),
helpstring(&quot;ISMSSend Interface&quot;),
oleautomation
]
interface ISMSSend : IUnknown {
[helpstring(&quot;method CreateShortMsg&quot;)]
HRESULT _stdcall CreateShortMsg([out, retval] IShortMessage** ppSMS);
[helpstring(&quot;method Send&quot;)]
HRESULT _stdcall Send([in] IShortMessage* pSMS);
[helpstring(&quot;method GetLastError&quot;)]
HRESULT _stdcall GetLastError([out, retval] NmpAdapterError* pErr);
[helpstring(&quot;method Terminate&quot;)]
HRESULT _stdcall Terminate();
[helpstring(&quot;method StartListeningEvents&quot;)]
HRESULT _stdcall StartListeningEvents();
};

[
odl,
uuid(3369A2C5-E58F-11D1-B1FC-006097838405),
helpstring(&quot;IShortMessage Interface&quot;),
oleautomation
]
interface IShortMessage : IUnknown {
[propget, helpstring(&quot;property ValidityPeriodFormat&quot;)]
HRESULT _stdcall ValidityPeriodFormat([out, retval] VALIDITY_PERIOD_FORMAT* pVal);
[propput, helpstring(&quot;property ValidityPeriodFormat&quot;)]
HRESULT _stdcall ValidityPeriodFormat([in] VALIDITY_PERIOD_FORMAT pVal);
[propget, helpstring(&quot;property ValidityPeriodRelative&quot;)]
HRESULT _stdcall ValidityPeriodRelative([out, retval] unsigned char* pVal);
[propput, helpstring(&quot;property ValidityPeriodRelative&quot;)]
HRESULT _stdcall ValidityPeriodRelative([in] unsigned char pVal);
[helpstring(&quot;method put_ValidityPeriodAbsolute&quot;)]
HRESULT _stdcall put_ValidityPeriodAbsolute(
[in] long year,
[in] long month,
[in] long day,
[in] long hour,
[in] long minute,
[in] long second,
[in] long timeZone);
[helpstring(&quot;method get_ValidityPeriodAbsolute&quot;)]
HRESULT _stdcall get_ValidityPeriodAbsolute(
[out] long* pYear,
[out] long* pMonth,
[out] long* pDay,
[out] long* pHour,
[out] long* pMinute,
[out] long* pSecond,
[out] long* pTimeZone);
[helpstring(&quot;method put_ValidityPeriodEnhanced&quot;)]
HRESULT _stdcall put_ValidityPeriodEnhanced(
[in] unsigned char functionalityIndicator,
[in] unsigned char byte2,
[in] unsigned char byte3,
[in] unsigned char byte4,
[in] unsigned char byte5,
[in] unsigned char byte6,
[in] unsigned char byte7);
[helpstring(&quot;method get_ValidityPeriodEnhanced&quot;)]
HRESULT _stdcall get_ValidityPeriodEnhanced(
[out] unsigned char* pFunctionalityIndicator,
[out] unsigned char* pByte2,
[out] unsigned char* pByte3,
[out] unsigned char* pByte4,
[out] unsigned char* pByte5,
[out] unsigned char* pByte6,
[out] unsigned char* pByte7);
[propget, helpstring(&quot;property DataCodingScheme&quot;)]
HRESULT _stdcall DataCodingScheme([out, retval] unsigned char* pVal);
[propput, helpstring(&quot;property DataCodingScheme&quot;)]
HRESULT _stdcall DataCodingScheme([in] unsigned char pVal);
[propget, helpstring(&quot;property OtherEndAddress&quot;)]
HRESULT _stdcall OtherEndAddress([out, retval] BSTR* pVal);
[propput, helpstring(&quot;property OtherEndAddress&quot;)]
HRESULT _stdcall OtherEndAddress([in] BSTR pVal);
[propget, helpstring(&quot;property ProtocolIdentifier&quot;)]
HRESULT _stdcall ProtocolIdentifier([out, retval] unsigned char* pVal);
[propput, helpstring(&quot;property ProtocolIdentifier&quot;)]
HRESULT _stdcall ProtocolIdentifier([in] unsigned char pVal);
[propget, helpstring(&quot;property SCAddress&quot;)]
HRESULT _stdcall SCAddress([out, retval] BSTR* pVal);
[propput, helpstring(&quot;property SCAddress&quot;)]
HRESULT _stdcall SCAddress([in] BSTR pVal);
[helpstring(&quot;method get_SCTimeStamp&quot;)]
HRESULT _stdcall get_SCTimeStamp(
[out] long* pYear,
[out] long* pMonth,
[out] long* pDay,
[out] long* pHour,
[out] long* pMinute,
[out] long* pSecond,
[out] long* pTimeZone);
[helpstring(&quot;method put_SCTimeStamp&quot;)]
HRESULT _stdcall put_SCTimeStamp(
[in] long year,
[in] long month,
[in] long day,
[in] long hour,
[in] long minute,
[in] long second,
[in] long timeZone);
[propget, helpstring(&quot;property StorageStatus&quot;)]
HRESULT _stdcall StorageStatus([out, retval] STORAGE_STATUS* pVal);
[propput, helpstring(&quot;property StorageStatus&quot;)]
HRESULT _stdcall StorageStatus([in] STORAGE_STATUS pVal);
[propget, helpstring(&quot;property MessageType&quot;)]
HRESULT _stdcall MessageType([out, retval] SMS_MESSAGE_TYPE* pVal);
[propput, helpstring(&quot;property MessageType&quot;)]
HRESULT _stdcall MessageType([in] SMS_MESSAGE_TYPE pVal);
[propget, helpstring(&quot;property UserDataFormat&quot;)]
HRESULT _stdcall UserDataFormat([out, retval] USER_DATA_FORMAT* pVal);
[propput, helpstring(&quot;property UserDataFormat&quot;)]
HRESULT _stdcall UserDataFormat([in] USER_DATA_FORMAT pVal);
[propget, helpstring(&quot;property UserDataText&quot;)]
HRESULT _stdcall UserDataText([out, retval] BSTR* pVal);
[propput, helpstring(&quot;property UserDataText&quot;)]
HRESULT _stdcall UserDataText([in] BSTR pVal);
[propget, helpstring(&quot;property UserData&quot;)]
HRESULT _stdcall UserData(
[in] long index,
[out, retval] unsigned char* pVal);
[propput, helpstring(&quot;property UserData&quot;)]
HRESULT _stdcall UserData(
[in] long index,
[in] unsigned char pVal);
[propget, helpstring(&quot;property UserDataHeader&quot;)]
HRESULT _stdcall UserDataHeader(
[in] long index,
[out, retval] unsigned char* pVal);
[propput, helpstring(&quot;property UserDataHeader&quot;)]
HRESULT _stdcall UserDataHeader(
[in] long index,
[in] unsigned char pVal);
[propget, helpstring(&quot;property MessageReference&quot;)]
HRESULT _stdcall MessageReference([out, retval] unsigned char* pVal);
[propput, helpstring(&quot;property MessageReference&quot;)]
HRESULT _stdcall MessageReference([in] unsigned char pVal);
[propget, helpstring(&quot;property StatusReportRequest&quot;)]
HRESULT _stdcall StatusReportRequest([out, retval] long* pVal);
[propput, helpstring(&quot;property StatusReportRequest&quot;)]
HRESULT _stdcall StatusReportRequest([in] long pVal);
[propget, helpstring(&quot;property ReplyPath&quot;)]
HRESULT _stdcall ReplyPath([out, retval] long* pVal);
[propput, helpstring(&quot;property ReplyPath&quot;)]
HRESULT _stdcall ReplyPath([in] long pVal);
[propget, helpstring(&quot;property CommandType&quot;)]
HRESULT _stdcall CommandType([out, retval] unsigned char* pVal);
[propput, helpstring(&quot;property CommandType&quot;)]
HRESULT _stdcall CommandType([in] unsigned char pVal);
[propget, helpstring(&quot;property CommandMessageNumber&quot;)]
HRESULT _stdcall CommandMessageNumber([out, retval] unsigned char* pVal);
[propput, helpstring(&quot;property CommandMessageNumber&quot;)]
HRESULT _stdcall CommandMessageNumber([in] unsigned char pVal);
[propget, helpstring(&quot;property StatusReportQualifier&quot;)]
HRESULT _stdcall StatusReportQualifier([out, retval] REPORT_QUALIFIER* pVal);
[propput, helpstring(&quot;property StatusReportQualifier&quot;)]
HRESULT _stdcall StatusReportQualifier([in] REPORT_QUALIFIER pVal);
[propget, helpstring(&quot;property Status&quot;)]
HRESULT _stdcall Status([out, retval] unsigned char* pVal);
[propput, helpstring(&quot;property Status&quot;)]
HRESULT _stdcall Status([in] unsigned char pVal);
[propget, helpstring(&quot;property UserDataLength&quot;)]
HRESULT _stdcall UserDataLength([out, retval] long* pVal);
[propput, helpstring(&quot;property UserDataLength&quot;)]
HRESULT _stdcall UserDataLength([in] long pVal);
[propget, helpstring(&quot;property UserDataHeaderLength&quot;)]
HRESULT _stdcall UserDataHeaderLength([out, retval] long* pVal);
[propput, helpstring(&quot;property UserDataHeaderLength&quot;)]
HRESULT _stdcall UserDataHeaderLength([in] long pVal);
};

typedef [uuid(F1D64502-176A-11D3-B1FF-006097838405), helpstring(&quot;SMS validity period type&quot;)]
enum {
NOT_PRESENT = 0,
RELATIVE_FORMAT = 1,
ENHANCED_FORMAT = 2,
ABSOLUTE_FORMAT = 3
} VALIDITY_PERIOD_FORMAT;

typedef [uuid(1577C341-174C-11D3-B1FF-006097838405), helpstring(&quot;SMS storage status type&quot;)]
enum {
NOT_SENT_FROM_PHONE = 0,
SENT_FROM_PHONE = 1,
DELIVERED = 2,
READ_FROM_PHONE = 3,
NOT_READ_FROM_PHONE = 4
} STORAGE_STATUS;

typedef [uuid(475AF0E5-14FD-11D3-B1FF-006097838405), helpstring(&quot;SMS message type&quot;)]
enum {
DELIVER_MESSAGE = 0,
STATUS_REPORT_MESSAGE = 1,
SUBMIT_MESSAGE = 2,
COMMAND_MESSAGE = 3,
MO_UNDEFINED_MESSAGE = 4,
MT_UNDEFINED_MESSAGE = 5
} SMS_MESSAGE_TYPE;

typedef [uuid(475AF0E3-14FD-11D3-B1FF-006097838405), helpstring(&quot;SMS user data coding format&quot;)]
enum {
DATA_CODING_SCHEME_BASED = 0,
DEFAULT_ALPHABET_7_BIT = 1,
DATA_8_BIT = 2,
UNICODE_16_BIT = 3
} USER_DATA_FORMAT;

typedef [uuid(475AF0E4-14FD-11D3-B1FF-006097838405), helpstring(&quot;Type of message that has requested Status Report&quot;)]
enum {
SUBMIT_REQUESTED = 0,
COMMAND_REQUESTED = 1
} REPORT_QUALIFIER;

typedef [uuid(60CC5E00-D3A2-11D1-99A0-0060979AC1B6), helpstring(&quot;Nokia adapter error codes&quot;)]
enum {
errCalendarNotSupported = 5377,
errCalendarUnknownNoteType = 5378,
errCalendarUnknownItemType = 5379,
errCalendarComponentCreation = 5380,
errCalendarItemRead = 5381,
errCalendarItemWrite = 5382,
errCalendarItemDelete = 5383,
errCalendarCallEmpty = 5384,
errCalendarNoMoreNotes = 5385,
errCalendarEmpty = 5386,
errCalendarNoDelete = 5387,
errCallNoActiveCall = 5633,
errCallNoDualModeCall = 5634,
errCallAlreadyActive = 5635,
errCallSignallingFailure = 5636,
errCallInvalidMode = 5637,
errCbSettingSetFailed = 5889,
errCbInvalidLanguage = 5890,
errCbInvalidTopic = 5891,
errCbToomanyLang = 5892,
errCbToomanyTopic = 5893,
errPnInvalidMemory = 6145,
errPnNumberTooLong = 6146,
errPnNameTooLong = 6147,
errPnInvalidCharacters = 6148,
errPnMemoryFull = 6149,
errPnNotAvail = 6150,
errPnTimestampNotavail = 6151,
errPnCallergroupsNotsupported = 6152,
errPnInvalidIconFormat = 6153,
errPnEntryLocked = 6154,
errPnSpeedkeyNotassigned = 6155,
errPnEmpty = 6156,
errDataNotAvail = 6401,
errSsUnknownSubscriber = 6402,
errSsBearerServNotProvision = 6403,
errSsTeleServNotProvision = 6404,
errSsCUGReject = 6405,
errSsIllegalSsOperation = 6406,
errSsErrorStatus = 6407,
errSsNotAvailable = 6408,
errSsSubscriptionViolation = 6409,
errSsIncompatibility = 6410,
errSsSpecificError = 6411,
errSsSystemFailure = 6412,
errSsDataMissing = 6413,
errSsUnexpectedDataValue = 6414,
errSsPasswordRegisFailure = 6415,
errSsNegativePasswordCheck = 6416,
errSsFacilityNotSupported = 6417,
errSsResourcesNotAvailable = 6418,
errSsMaxnumOfMptyPartExceed = 6419,
errSsCallBarred = 6420,
errSsMaxnumOfPwAttViolation = 6421,
errSsAbsentSubscriber = 6422,
errSsUSSDBusy = 6423,
errSsUnknownAlphabet = 6424,
errWrongPassword = 6425,
errPasswordNotRequired = 6426,
errUpdateImpossible = 6427,
errNetCallActive = 6428,
errNetNoMsgToQuit = 6429,
errNetUnableToQuit = 6430,
errNetAccessDenied = 6431,
errSsMMError = 6432,
errSsMsgError = 6433,
errSsMMRelease = 6434,
errSsActivationDataLost = 6435,
errSsServiceBusy = 6436,
errSsDataError = 6437,
errSsTimerExpired = 6438,
errSsPWErrorEnterPassword = 6439,
errSsPWErrorEnterNewPassword = 6440,
errSsPWErrorEnterNewPasswordAgain = 6441,
errSsPWErrorBadPassword = 6442,
errSsPWErrorBadPasswordFormat = 6443,
errSsPReturnErrorProblem = 6444,
errSsPUnrecognizedComp = 6445,
errSsPMistypedComp = 6446,
errSsPBadlyStructuredComp = 6447,
errSsPDuplicateInvokeID = 6448,
errSsPUnrecognizedOperation = 6449,
errSsPMistypedInvParameter = 6450,
errSsPResourceLimitation = 6451,
errSsPInitiatingRelease = 6452,
errSsPUnrecognizedLinkedID = 6453,
errSsPLinkedRespUnexpected = 6454,
errSsPUnexpectedLinkedOper = 6455,
errSsPUnrecognizedInvokeID = 6456,
errSsPReturnResultUnexpected = 6457,
errSsPMistypedResParameter = 6458,
errSsPReturnErrorUnexpected = 6459,
errSsPUnrecognizedError = 6460,
errSsPUnexpectedError = 6461,
errSsPMistypedErrParameter = 6462,
errSmsCreateFailed = 6657,
errSmsCannotSendMTMessages = 6658,
errSmsInvalidType = 6659,
errSmsInvalidDataCodingScheme = 6660,
errSmsInvalidUserDataLength = 6661,
errSmsInvalidUserDataFormat = 6662,
errSmsInvalidUserData = 6663,
errSmsInvalidUserDataHeaderLength = 6664,
errSmsInvalidSCTimeStamp = 6665,
errSmsTooLongSCAddress = 6666,
errSmsInvalidValidityPeriod = 6667,
errSmsTooLongOtherEndAddress = 6668,
errSmsInvalidParameterSetIndex = 6669,
errSmsTypeMOUndefined = 6670,
errSmsTypeMTUndefined = 6671,
errSmsTypeCommand = 6672,
errSmsNoSCAddress = 6673,
errSmsDefaultSetNameUsed = 6674,
errProtocolError = 6675,
errDbXXXX = 6913,
errNoError = 0,
errUnknown = 7935,
errInvalidLocation = 7681,
errInvalidParameter = 7682,
errReserved = 7683,
errMemoryFull = 7684,
errEmptyLocation = 7685,
errInvalidNumber = 7686,
errCallCostLimitReached = 7687,
errRLP = 7688,
errCommunicationError = 7689,
errNotSupported = 7690,
errMpApiNotAvail = 7691,
errDeviceFailure = 7692,
errNoSim = 7693,
errTerminalNotReady = 7694,
errSignallingFailure = 7695,
errPhoneNotConnected = 7696,
errPinRequired = 7697,
errPukRequired = 7698,
errPin2Required = 7699,
errPuk2Required = 7700,
errSecurityCodeRequired = 7701,
errBarred = 7702,
errSIMRejected = 7703
} NmpAdapterError;

[
odl,
uuid(0EC2D401-E8BC-11D1-B1FC-006097838405),
helpstring(&quot;ISMSMemory Interface&quot;),
oleautomation
]
interface ISMSMemory : IUnknown {
[helpstring(&quot;method CreateShortMsg&quot;)]
HRESULT _stdcall CreateShortMsg([out, retval] IShortMessage** ppSMS);
[helpstring(&quot;method Delete&quot;)]
HRESULT _stdcall Delete(
[in] SMS_MEMORY_LOCATION SMSMemory,
[in] long SMSIndex);
[helpstring(&quot;method Read&quot;)]
HRESULT _stdcall Read(
[in] SMS_MEMORY_LOCATION SMSMemory,
[in] long SMSIndex,
[out] IShortMessage** ppSMS,
[in] long MarkMessageAsRead);
[helpstring(&quot;method Store&quot;)]
HRESULT _stdcall Store(
[in] SMS_MEMORY_LOCATION SMSMemory,
[in] long SMSIndex,
[in] IShortMessage* pSMS);
[helpstring(&quot;method GetCapasityInME&quot;)]
HRESULT _stdcall GetCapasityInME([out] long* pMESMSMemorySize);
[helpstring(&quot;method GetCapasityInSIM&quot;)]
HRESULT _stdcall GetCapasityInSIM([out] long* pSIMSMSMemorySize);
[helpstring(&quot;method GetNumberOfMessagesInME&quot;)]
HRESULT _stdcall GetNumberOfMessagesInME([out] long* pAmountOfMessagesInMESMSMemory);
[helpstring(&quot;method GetNumberOfMessagesInSIM&quot;)]
HRESULT _stdcall GetNumberOfMessagesInSIM([out] long* pAmountOfMessagesInSIMSMSMemory);
[helpstring(&quot;method GetNumberOfUnreadInME&quot;)]
HRESULT _stdcall GetNumberOfUnreadInME([out] long* pAmountOfUnreadMessagesInMESMSMemory);
[helpstring(&quot;method GetNumberOfUnreadInSIM&quot;)]
HRESULT _stdcall GetNumberOfUnreadInSIM([out] long* pAmountOfUnreadMessagesInSIMSMSMemory);
[helpstring(&quot;method GetMemoryConfiguration&quot;)]
HRESULT _stdcall GetMemoryConfiguration([out] long* pMemoryStatus);
[helpstring(&quot;method GetCapasityOfParamSets&quot;)]
HRESULT _stdcall GetCapasityOfParamSets([out] long* pAmountOfParamSets);
[helpstring(&quot;method GetSMSMemoryStatus&quot;)]
HRESULT _stdcall GetSMSMemoryStatus(
[out] long* pMESize,
[out] long* pSIMSize,
[out] long* pMessagesInME,
[out] long* pMessagesInSIM,
[out] long* pUnreadInME,
[out] long* pUnreadInSIM,
[out] long* pMemoryConfiguration,
[out] long* pCapasityOfParamSets);
[helpstring(&quot;method GetLastError&quot;)]
HRESULT _stdcall GetLastError([out, retval] NmpAdapterError* pErr);
[helpstring(&quot;method Terminate&quot;)]
HRESULT _stdcall Terminate();
[helpstring(&quot;method StartListeningEvents&quot;)]
HRESULT _stdcall StartListeningEvents();
};

typedef [uuid(1577C343-174C-11D3-B1FF-006097838405), helpstring(&quot;SMS memory location type&quot;)]
enum {
SIM_MEMORY = 0,
PHONE_MEMORY = 1,
DEFAULT_MEMORY = 2
} SMS_MEMORY_LOCATION;

[
odl,
uuid(0EC2D402-E8BC-11D1-B1FC-006097838405),
helpstring(&quot;ISMSSettings Interface&quot;),
oleautomation
]
interface ISMSSettings : IUnknown {
[helpstring(&quot;method GetCommonSMSSettings&quot;)]
HRESULT _stdcall GetCommonSMSSettings(
[out] long* pStatusReportRequest,
[out] long* pReplyPath);
[helpstring(&quot;method SetCommonSMSSettings&quot;)]
HRESULT _stdcall SetCommonSMSSettings(
[in] long StatusReportRequest,
[in] long ReplyPath);
[helpstring(&quot;method GetSMSParametersSet&quot;)]
HRESULT _stdcall GetSMSParametersSet(
[in] long ParameterSetIndex,
[out] BSTR* pParameterSetName,
[out] unsigned char* pProtocolIdentifier,
[out] unsigned char* pDataCodingScheme,
[out] unsigned char* pValidityPeriod,
[out] BSTR* pSCAddress);
[helpstring(&quot;method SetSMSParametersSet&quot;)]
HRESULT _stdcall SetSMSParametersSet(
[in] long ParameterSetIndex,
[in] BSTR ParameterSetName,
[in] unsigned char ProtocolIdentifier,
[in] unsigned char DataCodingScheme,
[in] unsigned char ValidityPeriod,
[in] BSTR SCAddress);
[helpstring(&quot;method SetRoutingParameters&quot;)]
HRESULT _stdcall SetRoutingParameters(
[in] unsigned char PDUType,
[in] unsigned char RoutingType,
[in] unsigned char RoutingByte1,
[in] unsigned char RoutingByte2,
[in] unsigned char RoutingByte3);
[helpstring(&quot;method GetLastError&quot;)]
HRESULT _stdcall GetLastError([out, retval] NmpAdapterError* pErr);
[helpstring(&quot;method Terminate&quot;)]
HRESULT _stdcall Terminate();
[helpstring(&quot;method StartListeningEvents&quot;)]
HRESULT _stdcall StartListeningEvents();
};

[
odl,
uuid(0EC2D403-E8BC-11D1-B1FC-006097838405),
helpstring(&quot;ISMSReceiveNotify Interface&quot;),
oleautomation
]
interface ISMSReceiveNotify : IUnknown {
[helpstring(&quot;method ShortMsgReceived&quot;)]
HRESULT _stdcall ShortMsgReceived(
[in] SMS_MEMORY_LOCATION SMSMemory,
[in] long index,
[in] IShortMessage* pSMS);
[helpstring(&quot;method SMSMemoryFull&quot;)]
HRESULT _stdcall SMSMemoryFull([in] SMS_MEMORY_LOCATION SMSMemory);
[helpstring(&quot;method ShortMsgSent&quot;)]
HRESULT _stdcall ShortMsgSent([in] IShortMessage* pSMS);
};

[
odl,
uuid(8829E754-FA43-4D8D-B009-DB4024BE200E),
helpstring(&quot;IGraphicalMS Interface&quot;),
oleautomation
]
interface IGraphicalMS : IUnknown {
[helpstring(&quot;method CreateGMSObject&quot;)]
HRESULT _stdcall CreateGMSObject([out, retval] IGMSPicture** ppIPicture);
[helpstring(&quot;method FindNextGMS&quot;)]
HRESULT _stdcall FindNextGMS(
[in] VARIANT_BOOL updateStatus,
[in, out] STORAGE_STATUS* Status,
[in, out] short* pNext,
[out, retval] IGMSPicture** ppIPicture);
[helpstring(&quot;method SaveGMS&quot;)]
HRESULT _stdcall SaveGMS(
[in] STORAGE_STATUS Status,
[in] IGMSPicture* pIPicture,
[in, out] short* pIndex);
};

[
odl,
uuid(A6DA8A41-354A-49CF-9253-5DC814664A32),
helpstring(&quot;IGMSPicture Interface&quot;)
]
interface IGMSPicture : IUnknown {
[propget, helpstring(&quot;property MsgRejectDublicates&quot;)]
HRESULT _stdcall MsgRejectDublicates([out, retval] VARIANT_BOOL* pVal);
[propput, helpstring(&quot;property MsgRejectDublicates&quot;)]
HRESULT _stdcall MsgRejectDublicates([in] VARIANT_BOOL pVal);
[propget, helpstring(&quot;property MsgReplyPath&quot;)]
HRESULT _stdcall MsgReplyPath([out, retval] VARIANT_BOOL* pVal);
[propput, helpstring(&quot;property MsgReplyPath&quot;)]
HRESULT _stdcall MsgReplyPath([in] VARIANT_BOOL pVal);
[propget, helpstring(&quot;property MsgStatusReportRequest&quot;)]
HRESULT _stdcall MsgStatusReportRequest([out, retval] VARIANT_BOOL* pVal);
[propput, helpstring(&quot;property MsgStatusReportRequest&quot;)]
HRESULT _stdcall MsgStatusReportRequest([in] VARIANT_BOOL pVal);
[propget, helpstring(&quot;property MsgOriginatorAddress&quot;)]
HRESULT _stdcall MsgOriginatorAddress([out, retval] BSTR* pVal);
[propput, helpstring(&quot;property MsgOriginatorAddress&quot;)]
HRESULT _stdcall MsgOriginatorAddress([in] BSTR pVal);
[propget, helpstring(&quot;property MsgProtocolID&quot;)]
HRESULT _stdcall MsgProtocolID([out, retval] short* pVal);
[propput, helpstring(&quot;property MsgProtocolID&quot;)]
HRESULT _stdcall MsgProtocolID([in] short pVal);
[propget, helpstring(&quot;property MsgDCS&quot;)]
HRESULT _stdcall MsgDCS([out, retval] short* pVal);
[propput, helpstring(&quot;property MsgDCS&quot;)]
HRESULT _stdcall MsgDCS([in] short pVal);
[propget, helpstring(&quot;property MsgValidityPeriodFormat&quot;)]
HRESULT _stdcall MsgValidityPeriodFormat([out, retval] VALIDITY_PERIOD_FORMAT* pVal);
[propput, helpstring(&quot;property MsgValidityPeriodFormat&quot;)]
HRESULT _stdcall MsgValidityPeriodFormat([in] VALIDITY_PERIOD_FORMAT pVal);
[propget, helpstring(&quot;property MsgValidityPeriod&quot;)]
HRESULT _stdcall MsgValidityPeriod([out, retval] BSTR* pVal);
[propput, helpstring(&quot;property MsgValidityPeriod&quot;)]
HRESULT _stdcall MsgValidityPeriod([in] BSTR pVal);
[propget, helpstring(&quot;property MsgText&quot;)]
HRESULT _stdcall MsgText([out, retval] BSTR* pVal);
[propput, helpstring(&quot;property MsgText&quot;)]
HRESULT _stdcall MsgText([in] BSTR pVal);
[propget, helpstring(&quot;property PicInfoField&quot;)]
HRESULT _stdcall PicInfoField([out, retval] short* pVal);
[propput, helpstring(&quot;property PicInfoField&quot;)]
HRESULT _stdcall PicInfoField([in] short pVal);
[propget, helpstring(&quot;property PicDepth&quot;)]
HRESULT _stdcall PicDepth([out, retval] short* pVal);
[propput, helpstring(&quot;property PicDepth&quot;)]
HRESULT _stdcall PicDepth([in] short pVal);
[propget, helpstring(&quot;property PicWidth&quot;)]
HRESULT _stdcall PicWidth([out, retval] short* pVal);
[propput, helpstring(&quot;property PicWidth&quot;)]
HRESULT _stdcall PicWidth([in] short pVal);
[propget, helpstring(&quot;property PicHeight&quot;)]
HRESULT _stdcall PicHeight([out, retval] short* pVal);
[propput, helpstring(&quot;property PicHeight&quot;)]
HRESULT _stdcall PicHeight([in] short pVal);
[propget, helpstring(&quot;property PicDataLength&quot;)]
HRESULT _stdcall PicDataLength([out, retval] short* pVal);
[propput, helpstring(&quot;property PicDataLength&quot;)]
HRESULT _stdcall PicDataLength([in] short pVal);
[propget, helpstring(&quot;property PicData&quot;)]
HRESULT _stdcall PicData(
[in] short index,
[out, retval] short* pVal);
[propput, helpstring(&quot;property PicData&quot;)]
HRESULT _stdcall PicData(
[in] short index,
[in] short pVal);
};

[
uuid(3369A2C6-E58F-11D1-B1FC-006097838405),
helpstring(&quot;Nokia ShortMessage Data Component&quot;)
]
coclass ShortMessage {
[default] interface IShortMessage;
};

[
uuid(FE4A3D7F-DED7-47E9-9F97-4A9859B728B9),
helpstring(&quot;Nokia GMSPicture&quot;)
]
coclass GMSPicture {
[default] interface IGMSPicture;
};
};
 
wcglorioso,

Try disabling dual interface support.

To do so, execute SYS(2333,1). Do that before you run your code. When you have finished, run SYS(2333,0) to put things back to normal.

Mike


Mike Lewis
Edinburgh, Scotland
 
MikeLewis,

Thanks for your prompt reply but I am afraid it didn't resolve my problem.

I have put the SYS(2333,1) on Load() method of my form and the SYS(2333,0)on the Unload() method.

It is the same error on the same line of the code.

BTW, I am developing the application on WinNT platform.

Do VFP7 have any probblem running on it? (If so, why not VB6?)

Have tried to read the properties and run a couple of methods of the objMess object.

Properties where updated by my assignment statements and methods execute fine as expected so the object corruption is not clear to me.

Hence the CreateObject method of the objSMS works as expected.

Would like to try the WinAPI approach in creating the IShortMessage interface. Just dont know how to get an IUnknown in VFP7 as what VC++6 does.

IShortMessage inherits from IUnknown according to the type library above.

Thanks for your reply again.

Hope I can still have feedback from you.
 
MikeLewis,

Thanks for the feedback, I appreciate it a lot.

Hope someone who had dealt with the Nokia PC connectivity suite version 2.1 and used VFP7 will come along and read this question.

If it is hopeless to do in VFP7 (I hope not), someone kindly inform me please (I have gone over this for 2 days without success).

Even tried thesr approaches,

[1]
objMess = CREATEOBJECTEX('Nokia.ShortMessage.1','','')

which probably is what objSMS.CreateShortMsg(@objMess) does in the background

and

[2]
objMess = objSMS.CreateShortMsg

as in the VB6 approach

and

[3]
objMess = CREATEOBJECTEX('Nokia.ShortMessage.1','','')
objSMS.CreateShortMsg(@objMess)

which produces an empty object (without properties and methods)

and even this

[4]
objMess = CREATEOBJECTEX('Nokia.ShortMessage.1','','')
iMess = GetInterface(objMess,'IShortMessage')
objSMS.CreateShortMsg(@iMess)

I think I need to pass objMess which is initially set to an expected value by CreateShortMsg().

Note that in my code objMess is set to .NULL. before passing it to CreateShortMsg().

That's about all the insights I can give for now.



wcglorioso
 
Posted again for reference to my latest post as follow-up to my question.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top