Click here to Skip to main content

Joao Paulo Figueira - Professional Profile

14,843
Author
1,482
Authority
1,262
Debator
4
Enquirer
251
Organiser
1,244
Participant
0
Editor
João is a partner at Primeworks, a company that develops remote database access software for Windows Mobile. He also works for Frotcom, a company that develops web-based fleet management solutions.
Member since Wednesday, September 4, 2002 (9 years, 8 months)

For more information on Reputation please see the FAQ.
 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
  Refresh
GeneralQA: How do I copy a file from the desktop to the Pocket PC? Pin
Tuesday, May 17, 2005 5:14 AM
QA: How do I copy a file from the desktop to the Pocket PC?[^]
 
GeneralQA: How do I turn on the WiFi on my Axim X30? Pin
Saturday, April 30, 2005 5:03 AM
QA: How do I turn on the WiFi on my Axim X30?[^]
 
GeneralCEDB .NET Pin
Sunday, April 24, 2005 11:13 PM
CEDB .NET[^]
QuestionRe: CEDB .NET Pinmemberrajesh_s761:37 19 May '06  
 
GeneralQA: How do I rename a SQL CE table? Pin
Thursday, March 31, 2005 10:51 PM
QA: How do I rename a SQL CE table?[^]
 
GeneralAn MFC Header Bar with embeddable controls Pin
Friday, February 25, 2005 5:37 AM
An MFC Header Bar with embeddable controls[^]
 
GeneralQA: Where is the MulDiv function? Pin
Tuesday, January 25, 2005 3:12 AM
QA: Where is the MulDiv function?[^]
 
GeneralBookmarks and the ATL OLE DB Consumer Templates Pin
Tuesday, December 14, 2004 1:12 AM
Bookmarks and the ATL OLE DB Consumer Templates[^]
 
GeneralQA: How do I know if SQL Server CE is installed on my Pocket PC? Pin
Friday, December 10, 2004 6:22 AM
QA: How do I know if SQL Server CE is installed on my Pocket PC?[^]
 
GeneralThe Data Port Component C# API Pin
Monday, November 22, 2004 12:55 AM
The Data Port Component C# API[^]
 
GeneralATL OLE DB Consumer Templates Schemas Pin
Saturday, November 6, 2004 6:21 AM
I have just published my latest article on using the ATL OLE DB Consumer Templates on the Pocket PC.
 
ATL OLE DB Consumer Templates Schemas[^]
 
GeneralSQL CE Console Preview Pin
Friday, October 8, 2004 6:02 AM
After developing Data Port Wizard and Data Port Command, I'm starting to develop a C# Assembly for desktop applications that will encapsulate all the Data Port C++ code. To test the C# code, I am developing a C# application to edit SQL CE databases on the desktop: SQL CE Console. As of today, I'm posting the application on the downloads section of my site[^]. All comments and suggestions are welcome.
 
GeneralUpdate to atldbcli_ce.h Pin
Wednesday, August 25, 2004 4:04 AM
I just found another nasty bug on the original implementation of atldbcli.h: the AddOffset method of CDynamicAccessor. The original version of the method fails for odd values of the nAdd parameter:
static ULONG AddOffset(ULONG nCurrent, ULONG nAdd)
{
    struct foobar
    {
        char    foo;
        long    bar;
    };
    ULONG nAlign = offsetof(foobar, bar);
    return nCurrent + nAdd + (nAdd % nAlign);
}
The purpose of this method is to add sizes or offsets using the default CPU padding (4 bytes for most of them). If you follow the method's logic, you will see that it will only work for even values of nAdd. If you feed it with an odd value, you will end up with a result that is not divisible by 4, meaning that you will get a data type misalignement error when accessing memory through an offset calculated this way.
 
Here is a possible solution:
static ULONG AddOffset(ULONG nCurrent, ULONG nAdd)
{
    struct foobar
    {
        char    foo;
        long    bar;
    };
    ULONG    nAlign = offsetof(foobar, bar),
             nRet,
             nMod;
 
    nRet = nCurrent + nAdd;
    nMod = nRet % nAlign;
 
    if(nMod)
        nRet += nAlign - nMod;
 
    return nRet;
}

 
Regards,
João Paulo Figueira
Embedded MVP
 
GeneralQA: Where is the cancel button? Pin
Tuesday, August 24, 2004 4:08 AM
QA: Where is the cancel button?[^]
 
GeneralMVP Profile now online Pin
Friday, July 9, 2004 12:24 PM
My MVP profile is now online here[^].
 
Regards,
João Paulo Figueira
Embedded MVP
 
GeneralData Port Wizard Public Beta Pin
Tuesday, June 22, 2004 5:26 AM
This tool allows you to easily port Microsoft SQL Server and Microsoft Access databases to and from Microsoft SQL Server CE 2.0. Current version is Beta 0.3 and available here[^].
 
Regards,
João Paulo Figueira
Embedded MVP
 
GeneralA Classic Error Pin
Thursday, May 20, 2004 3:34 AM
I fell for this one so many times (today included), that I decided to write about it (maybe I won't forget it).
 
For the "nth" time, I'm writing a small piece of code to completely delete the contents of a list view. I mean, deleting all the items as well as the columns. Here's the masterpiece:
void CMyDialog::ClearDetails()
{
    CHeaderCtrl*	pHeader;
 
    m_wndListDet.DeleteAllItems();
    pHeader = m_wndListDet.GetHeaderCtrl();
    if(pHeader)
    {
        int i,
            nColumns;
 
        nColumns = pHeader->GetItemCount();
        for(i = 0; i < nColumns; ++i)
            pHeader->DeleteItem(0);
    }
}
The effect is devastating: after calling this method, the list will never show anything ever again. Why? What is wrong with it? List view columns cannot be directly deleted on the embedded header control, they must be deleted through the list view itself. The solution is simple: use
m_wndListDet.DeleteColumn(0);  // Right
instead of
pHeader->DeleteItem(0);  // Wrong
So why do I do this so frequently? Because I have to fetch a piece of information from the header, so my fingers automatically lead me to write the wrong code, instead of the right one.
 
Wouldn't it be so much easier if MFC allowed us to query the number of list view columns through the CListCtrl class?
 
Regards,
João Paulo Figueira
Embedded MVP
 
GeneralOLE DB BLOBs Pin
Tuesday, May 11, 2004 1:11 AM
I'm preparing a new article on managing BLOBs using the ATL OLE DB Consumer Templates on the Pocket PC. This has been taking me some time because things work a bit differently on the device, especially when using SQL CE 2.0 and its inability of binding columns by reference.
 
It would be interesting to see what other topics native code developers for the Pocket PC are looking for in this particular area - OLE DB.
 
GeneralMore corrections to atldbcli_ce.h Pin
Monday, May 3, 2004 11:36 AM
If you read my last article on database development for the Pocket PC (Using the ATL OLE DB Consumer Templates on the Pocket PC[^]), I skipped some necessary changes to the original Microsoft code. These will correct the way the status field is accessed on the CDynamicAccessor data buffer. Locate the first GetStatus method, and change the code to look this way:
bool GetStatus(ULONG nColumn, DBSTATUS* pStatus) const
{
    ATLASSERT(pStatus != NULL);
    if (TranslateColumnNo(nColumn))
    {
        *pStatus = 
            *(ULONG*)(AddOffset(AddOffset((ULONG)_GetDataPtr(nColumn),
            m_pColumnInfo[nColumn].ulColumnSize), sizeof(ULONG)));
        return true;
    }
    else
        return false;
}
Correct all other address calculations (copy and paste it). Note that the original code is not consistent in calculating the status address.
 
Regards,
João Paulo Figueira
Embedded MVP
 
GeneralUsing the ATL OLE DB Consumer Templates Pin
Tuesday, March 9, 2004 11:47 PM
Using the ATL OLE DB Consumer Templates[^]
 
GeneralQA: How do I read from and write to an ini file? Pin
Monday, February 9, 2004 6:03 AM
QA: How do I read from and write to an ini file?[^]
 
GeneralQA: How do I embed a Pocket Word document in my application? Pin
Friday, January 30, 2004 5:59 AM
QA: How do I embed a Pocket Word document in my application?[^]
 
GeneralQA: How do I right-align a button on a toolbar? Pin
Wednesday, January 21, 2004 3:23 AM
QA: How do I right-align a button on a toolbar?[^]
 
GeneralQA: How can I install ADOCE 3.1? Pin
Tuesday, November 18, 2003 7:48 AM
QA: How can I install ADOCE 3.1?[^]
 
GeneralQA: How do I add a title to a view? Pin
Wednesday, October 29, 2003 12:17 AM
QA: How do I add a title to a view?[^]

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


Advertise | Privacy | Mobile
Web01 | 2.5.120528.1 | Last Updated 28 May 2012
Copyright © CodeProject, 1999-2012
All Rights Reserved. Terms of Use
Layout: fixed | fluid