I am facing problem in reading FileTime property.
for ex: in the database the value of the FileTime properties is "19/05/2006 12:12:00"
while reading the FileTime Property. it class the GetValue() inside the CeDBProperty class.
return new DateTime(BitConverter.ToInt64(m_prop, 8));
but the problem is after returing the value = "19/05/406"
i getting only the value of year is wrong and all other values(date and month) are correct. what is the problem in the conversion ?...
on the same way while setting the Value also.
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.
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.
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:
pHeader = m_wndListDet.GetHeaderCtrl();
nColumns = pHeader->GetItemCount();
for(i = 0; i < nColumns; ++i)
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
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?
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.
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:
I saw you refering to this article at microsoft.public.pocketpc.developer and I thought I'd share a workaround I had to use when writing an installation program. Apparently one of MS's processess blocks the SendMessage call while ActiveSync is running and syncing new items with pocket outlook. It wont handle it until you break the connection. Since it still responded to WM_GETTEXT, I wrote this following snippet that atleast works on ppc 2002+ (I have not tried it with earlier versions).
I never sync with outlook, but when we released a new version 5-6 months ago, I got a steady stream of support mails from users that the installation program just froze while installing the applications, which finally lead me to this fix.