|
Dear developers,
One never knows to what edge freelance development can take you, like it did to me now all desperate to find a database implementation for embedded systems that are not .NET or 0x86 compatible. I have a pure C/C++ portable platform for some sort of programmable terminals, and I need a more or less generic implementation of a simple database, preferably with indexes or some sort of optimization. Any table is deemed to never have more than 1000 records. And the entire database is best residing in a single file. It’s killing me to think that these progressing days I would have to marvel it all on my own like in old times.
One last detail: It would be the nicest implementation with file-access level implemented clearly, like a driver so that I could just insert my own file-access operations that will work for me.
Anyone who has whatever relevant please, throw at me, be endlessly grateful for that.
Regards,
Just one of you.
|
|
|
|
|
I must miss something... but I have not managed to send files on the emulator shipped with evc4.
When I launch the Remote File Viewer, I get the following message :"Cannot load device specific files associated with this tool."
And I never found how to map a directory or a drive to my PC from the CE Explorer.
I must be thick... if anybody is enlightened, please help!
Thanks
|
|
|
|
|
maybe this helps.
it's a solution for visual studio.NET. but it will probably work for all emulators:
http://www.sybase.com/detail/1,6904,1026106,00.html
thx, Daniel
|
|
|
|
|
Cheers, that did the trick (and I also found that you could download a better Emulator than the one shipped with evc4++). Thanks!
|
|
|
|
|
Hello,
I am trying to install SQL Server CE 2.0 on the emulator. It requires me to copy adocedb30.dll. When I copy the same, it asks my permission to overwrite it as the file already exists in the emulator. The problem is, it is not able to replace it saying the file is in the ROM. Any ideas how this could be resolved ? Also, if I just continue by using the existing adocedb30.dll and continue with registering the dlls using DllRegister.exe, it pops up a message saying all the components of DllRegister.exe could not be found. Could anyone please help me out ?
Thanks and regards,
Amit
|
|
|
|
|
Hi,
I am looking to develop .NET enabled handhelds and I'm wondering what I need to start this. I have a PC with .NET Visual Studio installed, a .NET ARM processor device.
Do I need something other than .NET Visual Studio installed? Is there something called the Compact Framework that works with embedded systems?
I've used EVC++ 3.0(Extensively) and 4.0 (once) to develop for HH. Is there an IDE similar to those two where I can choose which processor to compile for or is all I need is .NET Visual Studio.
Thanks for you help. If my question is a little vague I appologize. I'm not sure where to begin with .NET devices.
|
|
|
|
|
Not sure you have seen this article but just in case:
Pocket PC
|
|
|
|
|
Wow! This is fantastic. Truth be told. I spoke with the company that deployed my handheld PC and they told me to use EVC++ 4.0 using the STANDARDSDK_420 platform to develop Windows CE devices (Particularyly...theirs!).
Since I already develop PPC apps with EVC++ 3.0, after installing EVC++ 4.0 on a seperate PC I had already installed the PocketPC_2003 SDK and had selected it under my platform manager thus rendering all compilations invalid even though they were written for the ARM processor. (I know..run on sentence and all.)
I have a saying for moments like this: "Slap Self!"
{{Like2Byte slaps self}}
Again, thanks.
|
|
|
|
|
PocketPC2002 doesn't appear to support the ini file api. Is there a class floating around that handles this?
------- signature starts
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
"You won't like me when I'm angry..." - Dr. Bruce Banner
Please review the Legal Disclaimer in my bio.
------- signature ends
|
|
|
|
|
Use the registry perhaps?
VORegistry[^]
The kindest thing you can do for a stupid person, and for the gene pool, is to let him expire of his own dumb choices.
[Roger Wright on stupid people]
We're like private member functions
[John Theal on R&D]
|
|
|
|
|
Read my message again.
I said I need to be able to read/write INI files. Nowhere in that message did I say that using the registry was either acceptable or the desired solution. I don't ask just questions out of the fuckin' blue, so don't treat me like a brain-dead noob.
------- signature starts
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
"You won't like me when I'm angry..." - Dr. Bruce Banner
Please review the Legal Disclaimer in my bio.
------- signature ends
|
|
|
|
|
John Simmons / outlaw programmer wrote:
Nowhere in that message did I say that using the registry was either acceptable or the desired solution
Neither did you say that it wasn't.
I am certainly aware that you are not a brain-dead noob.
I suggested the registry because PocketPCs don't seem to use ini files.
Can I safely assume that since you have tried WritePrivateProfileString that you have also tried WriteProfileString ?
If this isn't possible, then I'll just go away and waste someone else's time.
The kindest thing you can do for a stupid person, and for the gene pool, is to let him expire of his own dumb choices.
[Roger Wright on stupid people]
We're like private member functions
[John Theal on R&D]
|
|
|
|
|
Atlantys wrote:
I suggested the registry because PocketPCs don't seem to use ini files.
Hence my question.
Atlantys wrote:
Can I safely assume that since you have tried WritePrivateProfileString that you have also tried WriteProfileString?
WriteProfileString *only* writes to the registry in CE. I need to write to INI files on a storage card.
------- signature starts
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
"You won't like me when I'm angry..." - Dr. Bruce Banner
Please review the Legal Disclaimer in my bio.
------- signature ends
|
|
|
|
|
When using eVC 3.0, whenever I ask for a new project, the IDE crashes out with a page fault. Is there a workaround for this?
|
|
|
|
|
Hi!
I am trying to use the STL with eVC4... and I have the following linking error:
error LNK2001: unresolved external symbol "public: __thiscall std::_Lockit::~_Lockit(void)" (??1_Lockit@std@@QAE@XZ)
Any idea anyone? Thanks!
|
|
|
|
|
If you put objects derived from CObject into a map, there is a mechanism to make sure they do not get damaged by multi-threading...
Good idea but it does not seem to work and I have not found anything anywhere...
So I tried to put this in my code :
<br />
_Lockit::_Lockit()<br />
{}<br />
_Lockit::~_Lockit()<br />
{}<br />
and it did link... not sure the whole thing is thread-safe but I'll worry about this later!
|
|
|
|
|
i am quite new to strings in c++.
i wonder if after the following function all memory is freed.
Or does anybody see any memory-leaks?
void CSTHtmlDialog::DoSomething(const CString strFilePath)
{
HANDLE hFile;
DWORD dwBytesRead;
hFile = CreateFile (strFilePath,
GENERIC_READ, // Open for reading
0, // Do not share
NULL, // No security
OPEN_EXISTING, // Existing file only
FILE_ATTRIBUTE_NORMAL, // Normal file
NULL); // No template file
DWORD dwFileLength = GetFileSize(hFile, NULL)
char* pBuffer = new char[dwFileLength];
if (ReadFile (hFile, pBuffer, dwFileLength, &dwBytesRead, NULL))
{
pBuffer[dwFileLength - 1] = '\0';
SetString(pBuffer);//calls this function:
//void SetString(const CString &strHtml){...}
}
CloseHandle (hFile);
delete[] pBuffer;
pBuffer = 0;
return;
}
thx, Daniel
|
|
|
|
|
If you're doing this on a PocketPC device, then you can't use char , you have to use wchar_t (or even TCHAR ), because PocketPC devices all use UNICODE.
If you're already using MFC, why not just use CFile and CString to read the file in? That way you don't have to worry about new memory leaks.
The kindest thing you can do for a stupid person, and for the gene pool, is to let him expire of his own dumb choices.
[Roger Wright on stupid people]
We're like private member functions
[John Theal on R&D]
|
|
|
|
|
Why use a char*/wchar_t* at all?
I'd do it this way (error handling removed):
std::vector< char > data;
HANDLE h = CreateFile(filename , GENERIC_READ, 0, 0, OPEN_EXISTING, 0, 0);
DWORD fs = GetFileSize(h, 0);
data.resize(fs / sizeof(char) );
DWORD read = 0;
ReadFile(h, data.begin(), fs, &read, 0);
CloseHandle(h);
ASSERT(read == fs);
data.push_back(0);
slomoman wrote:
does anybody see any memory-leaks?
I see no memoryleaks in the code you posted.
“Our solar system is Jupiter and a bunch of junk” - Charley Lineweaver 2002
|
|
|
|
|
my reason to use chars was that ReadFile seems to need a char* parameter.
the suggestion using vector<char> sounds good, but i am not sure how to use it in the functions that handle the file's input:
//first I pass the buffer to this function:
setString(pBuffer);
//and this functions uses it to send a message like this:
void SetString(const CString &strHtml){
::SendMessage(m_hwndHtml, DTM_ADDTEXTW, FALSE, (LPARAM)(LPCTSTR)strHtml);
}
Probably, my code is quite chaotic and I should rewrite both functions.but i'm not sure how to do it with wchar_t or vector<char>
??
thx, Daniel
|
|
|
|
|
slomoman wrote:
my reason to use chars was that ReadFile seems to need a char* parameter
Nod, I understand. Im just trying to show a way to do it without dynamic memory allocations, which is (IMHO) good to avoid whenever possible.
slomoman wrote:
the suggestion using vector sounds good, but i am not sure how to use it in the functions that handle the file's input:
You can substitue the std::vector with a std::string or a std::wstring (possibly even a CString with GetBufferSetLength/ReleaseBuffer) depending on the format of your infile. Then, all you'd need to do is call SetString(str.c_str())
Now, back to your problem.
If the file you're reading contains ASCII characters, you will need to convert them to unicode characters to able to show them in the GUI. All GUI components in WinCE uses unicode strings.
Here's an example using the USES_CONVERSION macro. (Look it up in MSDN).
Its pretty usefull sometimes, but can also cause problems.
if (ReadFile (hFile, pBuffer, dwFileLength, &dwBytesRead, NULL))
{
pBuffer[dwFileLength - 1] = '\0';
USES_CONVERSION;
SetString(A2W(pBuffer));
}
Another way to convert the ASCII characters to unicode is to use the function that the macro A2W uses, MultiByteToWideChar , but that requires some extra work.
Here's an example of how to use that:
bool a2w(std::wstring& w, const std::string& a)
{
w.resize(a.length());
w[0] = L'\0';
if ( MultiByteToWideChar(CP_ACP, 0, a.begin(), -1, w.begin(), a.length()) == 0)
return false;
return true;
}
If the file you are reading is in UNICODE, you're better of reading into a wchar_t array/std::wstring/std::vector<wchar_t>.
Here's a way to do that, using your old code (untested):
void CSTHtmlDialog::DoSomething(const CString strFilePath)
{
HANDLE hFile;
DWORD dwBytesRead;
hFile = CreateFile (strFilePath,
GENERIC_READ,
0,
NULL,
OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL,
NULL);
DWORD dwFileLength = GetFileSize(hFile, NULL)
wchar_t* pBuffer = new char[dwFileLength/sizeof(wchar_t)];
if (ReadFile (hFile, reinterpret_cast<char*>(pBuffer), dwFileLength, &dwBytesRead, NULL))
{
pBuffer[dwFileLength - 1] = L'\0';
SetString(pBuffer);
}
CloseHandle (hFile);
delete[] pBuffer;
pBuffer = 0;
return;
}
or you could try to cast your char* to a wchar_t* when you pass it to SetString, but that might give you alignment problems
HTH
“Our solar system is Jupiter and a bunch of junk” - Charley Lineweaver 2002
|
|
|
|
|
2 errors in my wchar_t verison of your code.
Jonas Larsson wrote:
wchar_t* pBuffer = new char[dwFileLength/sizeof(wchar_t)];
wchar_t* pBuffer = new wchar_t[dwFileLength/sizeof(wchar_t)];
Jonas Larsson wrote:
pBuffer[dwFileLength - 1] = L'\0';
pBuffer[(dwFileLength/sizeof(wchar_t)) - 1] = L'\0';
Sorry about that.
“Our solar system is Jupiter and a bunch of junk” - Charley Lineweaver 2002
|
|
|
|
|
Hey João (since I know you'll be the first to answer this (and answer it correctly too ))
Is it possible to detect when the user has pushed the power-off button and do perform some actions (like pausing an MP3 or saving data) before the device is turned off? The device does most of this itself, but in the case of the MP3, there are some..."issues" that I think I can fix, if I just knew when the device was going off.
I have some nifty CE_USER_NOTIFICATION-based functionality to determine when the device is turned back on, but there is no notification flag for power off (NOTIFICATION_EVENT_WAKEUP is for power on).
Thanks in advance.
The kindest thing you can do for a stupid person, and for the gene pool, is to let him expire of his own dumb choices.
[Roger Wright on stupid people]
We're like private member functions
[John Theal on R&D]
|
|
|
|
|
Hi!
I think that the correct answer is that there is no way to do it. Take my answer with a grain of salt because I'm not sure about this. I thought about intercepting the power button, but this will leave out the power off timer. I tried using Spy to check if the system does send a message to the top-level active window (or desktop), but got nothing.
If I come up with a better answer, I'll post it here.
Regards,
João Paulo
|
|
|
|
|
Well, that sucks, but thanks anyways.
The ideas I had were trying to handle VK_OFF in a OnKeyDown or similar. Or hoping that a WM_POWERBROADCAST-type message is sent.
When I was playing around, it didn't seem like either of this methods worked, but when it comes to CE, I'm never sure.
The kindest thing you can do for a stupid person, and for the gene pool, is to let him expire of his own dumb choices.
[Roger Wright on stupid people]
We're like private member functions
[John Theal on R&D]
|
|
|
|
|