Click here to Skip to main content
15,911,646 members
Home / Discussions / Mobile
   

Mobile

 
GeneralRe: Accessing pocket access CDB using .NET Pin
João Paulo Figueira3-Jul-04 0:00
professionalJoão Paulo Figueira3-Jul-04 0:00 
GeneralAfterCollapse in Compact Framework Pin
ting66830-Jun-04 21:10
ting66830-Jun-04 21:10 
GeneralChanging the BackColor of a ListViewItem Pin
George Papadopoulos30-Jun-04 7:00
George Papadopoulos30-Jun-04 7:00 
QuestionWriting to Pocket PC File - Directory Structure? Pin
j1e1g129-Jun-04 5:19
j1e1g129-Jun-04 5:19 
AnswerRe: Writing to Pocket PC File - Directory Structure? Pin
Richard Jones8-Jul-04 4:09
Richard Jones8-Jul-04 4:09 
QuestionHow to store BLOB in SQLCE Pin
Member 105289929-Jun-04 1:37
Member 105289929-Jun-04 1:37 
AnswerRe: How to store BLOB in SQLCE Pin
João Paulo Figueira29-Jun-04 8:42
professionalJoão Paulo Figueira29-Jun-04 8:42 
GeneralRe: How to store BLOB in SQLCE Pin
Member 105289929-Jun-04 20:30
Member 105289929-Jun-04 20:30 
Hi Paulo,


Thanks for ur interest in helping me. But since it is very urgent I am forced to ask you the help immediately.

Let me explain in brief as wht i have done.
1) I call GetSignature method which will return a single row with the BLOB item (IMAGE datatype) as the first and only column in the rowset. The input to this method is an object whose class definition is as follows:

public:
unsigned char m_SignatureData[8192];
unsigned int m_SignatureLength;

/********************************************************************/
This m_SignatureData array stores the activated pixels constituting the IMAGE drawn on the screen.

2) GetSignature after retrieving the rowset will call update signature. The empty BLOB item is now filled with this m_SignatureData array . m_SignatureData array is actually converted into ISequentialStream pointer and then only passed to the SetData method of the IRowsetChange.

I have few questions

1) Which HROW is to be used in the IROwsetChange::SetData method ?
2) Which Accessor interface is to be used ? (One associated with the IRowset or IRowsetChange)?

Please help. (although the mail is lengthy)

void CTransactionRec::GetSignature(CSignature *m_Signature)
{
HRESULT m_QueryResult= NOERROR;

CString szQuery=L"select Signature from tblTransaction where Type='"+ m_stType +"'";
m_QueryResult = m_DbConnection.m_pIDBCrtCmd->CreateCommand(NULL,IID_ICommandText,(IUnknown**)&m_pICmdTextForList);

m_QueryResult = m_pICmdTextForList->SetCommandText(DBGUID_SQL,szQuery);


if(!FAILED(m_QueryResult)) {
if(!FAILED(m_pICmdTextForList->Execute(NULL,IID_IRowset,NULL,NULL,(IUnknown**)&m_pIRowset))) {
UpdateSignature(m_Signature);
}
}
else {
MessageBox(GetActiveWindow(),L"Query not executed",L"Database Session",0);
}

return ;
}

/**********************************************************************/



HRESULT CTransactionRec::UpdateSignature(CSignature *m_Signature)
{


IRowsetChange * pIRowsetChange;
IAccessor * pIAccessor;
ISequentialStream *pISeqStr;
HROW hrow;
HROW *pRows = &hrow;
ULONG lNumRowsRetrieved = 0;


HACCESSOR hAccessor;

DBBINDSTATUS rgStatus[1];

DBOBJECT ObjectStruct;


ObjectStruct.dwFlags = STGM_READWRITE ;

ObjectStruct.iid = IID_ISequentialStream;

DBBINDING rgBinding[1] = {

1, // Column 1

0, // Offset to data

sizeof(IUnknown*), // obLength length field

0, // Ignore status field

NULL, // No type info

&ObjectStruct, // Object structure

NULL, // Ignore binding extension

DBPART_VALUE|DBPART_LENGTH, // Bind value and length

DBMEMOWNER_CLIENTOWNED, // Consumer owned memory

DBPARAMIO_NOTPARAM, // Not a parameter binding

0, // Ignore maxlength

0, // Reserved

DBTYPE_IUNKNOWN, // Type DBTYPE_IUNKNOWN

0, // Precision not applicable

0, // Scale not applicable

};



m_pIRowset->QueryInterface(IID_IAccessor, (void**) &pIAccessor);


pIAccessor->CreateAccessor(DBACCESSOR_ROWDATA, 1, rgBinding, sizeof(IUnknown *),&hAccessor,
NULL);

pIAccessor->Release();


m_pIRowset->GetNextRows(NULL,
0,
1,
&lNumRowsRetrieved,
&pRows);




BYTE* pData=(BYTE*)CoTaskMemAlloc(sizeof(IUnknown*)+sizeof(ULONG));

// Value - pass ISequentialStream pointer to the provider


pISeqStr = *(ISequentialStream **)(m_Signature->m_SignatureData);

*(ISequentialStream**)(pData+rgBinding[0].obValue)=pISeqStr;

// LENGTH - Some providers need to know the length of the

// stream ahead of time...

*(ULONG*)(pData+rgBinding[0].obLength)=(ULONG)m_Signature->m_SignatureLength;

// SetData - The provider will then do an ISequentialStream::Read

// on the pISeqStr pointer passed in...

pIRowsetChange->SetData(*pRows, hAccessor, pData);

CoTaskMemFree(pData);

return 0;

}



Thank You
Mallee

GeneralRe: How to store BLOB in SQLCE Pin
João Paulo Figueira29-Jun-04 21:09
professionalJoão Paulo Figueira29-Jun-04 21:09 
AnswerRe: How to store BLOB in SQLCE Pin
João Paulo Figueira1-Jul-04 7:56
professionalJoão Paulo Figueira1-Jul-04 7:56 
GeneralDynamic Menus Pin
Member 113813628-Jun-04 23:41
Member 113813628-Jun-04 23:41 
GeneralI need to differentiate when a Pocket PC uses operating system 2002 of the 2003 in run-time!!!! Pin
Escalopo28-Jun-04 6:24
Escalopo28-Jun-04 6:24 
GeneralRe: I need to differentiate when a Pocket PC uses operating system 2002 of the 2003 in run-time!!!! Pin
Member 57102128-Jun-04 6:37
Member 57102128-Jun-04 6:37 
GeneralRe: I need to differentiate when a Pocket PC uses operating system 2002 of the 2003 in run-time!!!! Pin
Escalopo28-Jun-04 21:29
Escalopo28-Jun-04 21:29 
GeneralRe: I need to differentiate when a Pocket PC uses operating system 2002 of the 2003 in run-time!!!! Pin
João Paulo Figueira28-Jun-04 22:30
professionalJoão Paulo Figueira28-Jun-04 22:30 
QuestionHow can i make my application support multiple language in PocketPC Pin
Member 57102128-Jun-04 5:51
Member 57102128-Jun-04 5:51 
AnswerRe: How can i make my application support multiple language in PocketPC Pin
João Paulo Figueira28-Jun-04 6:22
professionalJoão Paulo Figueira28-Jun-04 6:22 
GeneralRe: How can i make my application support multiple language in PocketPC Pin
Member 57102128-Jun-04 6:30
Member 57102128-Jun-04 6:30 
GeneralRe: How can i make my application support multiple language in PocketPC Pin
João Paulo Figueira28-Jun-04 7:00
professionalJoão Paulo Figueira28-Jun-04 7:00 
GeneralRe: How can i make my application support multiple language in PocketPC Pin
Gopabandhu28-Jun-04 19:19
Gopabandhu28-Jun-04 19:19 
GeneralRe: How can i make my application support multiple language in PocketPC Pin
João Paulo Figueira28-Jun-04 22:27
professionalJoão Paulo Figueira28-Jun-04 22:27 
GeneralRe: How can i make my application support multiple language in PocketPC Pin
GuilhemMtp29-Jun-04 3:20
GuilhemMtp29-Jun-04 3:20 
GeneralRe: How can i make my application support multiple language in PocketPC Pin
João Paulo Figueira29-Jun-04 8:43
professionalJoão Paulo Figueira29-Jun-04 8:43 
GeneralRe: How can i make my application support multiple language in PocketPC Pin
GuilhemMtp30-Jun-04 23:06
GuilhemMtp30-Jun-04 23:06 
GeneralRe: How can i make my application support multiple language in PocketPC Pin
Member 5710214-Jul-04 22:38
Member 5710214-Jul-04 22:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.