|
I'm building an app just as a personal toolbox for myself (may become cp article) and I'm looking for some suggestions. This app will need a database of some sort, and I'm leaning on using an embedded database rather then using MySQL or other service.
I've looked at the XML database options, but I don't like the idea of how large those files could potentially become. Anyone know of any free alternatives? Any database libs out there that I can embed into my app?
It doesn't have to be fully SQL complient, but I would like to be able to do simple joins at the bare minimum.
My code isn't buggy. Those are all fleatures.
|
|
|
|
|
|
SQLite seems popular and well supported, so this could be a good way to go. I don't like the fact that it is written in C and some other things are strange, but this is very personal stuff.
I'm working on app that uses pugXML (here on CP) as its database, and am very, very happy with this.
Neville Franks, Author of ED for Windows. Free Trial at www.getsoft.com
|
|
|
|
|
Ever think about MSDE as a database?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<A HREF="http://www.santacruznetworks.com">Santa Cruz Networks</A>
|
|
|
|
|
Can you embed that into your application or does it run as a seperate process?
My code isn't buggy. Those are all fleatures.
|
|
|
|
|
not embedded, but small, practically free, and full SQL implementation including stored procedures.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<A HREF="http://www.santacruznetworks.com">Santa Cruz Networks</A>
|
|
|
|
|
Can anyone recommend a good FFT (Fast Fourier Transform) component that I can download? I simply want to pass it some data, and have it pop up a window displaying the FFT.
Why is the phrase "It's none of my business" always followed by "BUT..."
|
|
|
|
|
|
|
CClientDC clientDC(this);
CDC memDC;
CDC srcDC;
CBitmap* pOldSrcBmp = NULL;
CRect rect;
BITMAP bmp;
GetClientRect(&rect);
memDC.CreateCompatibleDC(&clientDC);
srcDC.CreateCompatibleDC(&clientDC);
pOldSrcBmp = srcDC.SelectObject(&myBitmap);
myBitmap.GetBitmap(&bmp);
BOOL bTest = memDC.StretchBlt(0, 0, rect.Width(), rect.Height(), &srcDC, 0, 0, bmp.bmWidth, bmp.bmHeight, SRCCOPY);
srcDC.SelectObject(pOldSrcBmp);
memDC.DeleteDC();
srcDC.DeleteDC();
myBitmap is a CBitmap that has successfully loaded.
This always fails unless I'm in OnDraw or OnPaint. What gives?
"It is better to remain silent and be thought a fool than to open one's mouth and remove all doubt." - Abraham Lincoln
|
|
|
|
|
You are not giving memDC a bitmap to draw on. By default, a memory DC will only have a 1 x 1 pixel monochrome bitmap.
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|
|
Hi all,
got another simple/silly question.
I am trying to make an array but i need to it to be of different lengths. For one case i need it to be 2 and another to be 8. i was trying to do this:
int size = 0;<br />
<br />
if(myBool == TRUE)<br />
size = 2;<br />
else<br />
size = 8;<br />
<br />
int myArray [size];<br />
....
Can someone tell me how to do this? I thought it was possible?
Jimmy
Just cause I am 15, doesn't mean I'm dumb! (I'll really be 4 on Feb. 29...the year 2004)
|
|
|
|
|
try reading the MSDN for malloc and new (free and delete also )
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
If you are trying to exercize the KISS principle, then just create two different arrays and use your if to determine which to use. If you want to make it dynamic, use a linked list.
My code isn't buggy. Those are all fleatures.
|
|
|
|
|
|
Please,
If someone know how can I determine within my application if network cable is unplugged ?
Thank you !
Alan
|
|
|
|
|
See InternetGetConnectedState() .
/ravi
Let's put "civil" back in "civilization"
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
i think this wont solve all problems.. if the lan isnt used for internet, i suppose this wont work!
Don't try it, just do it!
|
|
|
|
|
check the ip interfaces.. if the network cable is unplugged, there wont be any ip interface for the adapter(on win2k and later).
Don't try it, just do it!
|
|
|
|
|
Ok, thank you, sound's great, but since I'm almost new in this world, can you please give me some line of code ?
Tnx
|
|
|
|
|
Maybe you use this code, its working for all known cases.
ok, its working at least for all my cases
bye
mario
1) InternetCheckConnection ( Checks for Google )
2) InternetAttemptConnect ( Windows Function )
3) IsModem Connected ( Modem Connection )
4) gethostbyname ( Google )
5) InternetGetConnectedState ( LAN )
6) Dont check for Internetconnection
// Check if Online
BOOL WINAPI IsADSLConnected()
{
LPDWORD lpdwFlags=0;
DWORD dwReserved=0;
RASCONN rc;
rc.dwSize = sizeof(rc);
DWORD numConns=0;
DWORD size=0;
DWORD res;
do {
switch(g_m_ConMode) {
case 0:
try {
g_IsConnected=InternetCheckConnection("http://www.google.com",FLAG_ICC_FORCE_CONNECTION ,0);
}
catch(...) {
g_m_ConMode = 4;
}
break;
case 1:
res = InternetAttemptConnect(0);
if(res == ERROR_SUCCESS) g_IsConnected = 1;
else g_IsConnected = 0;
break;
case 2:
// Enumerate the connections.
res = RasEnumConnections(&rc, &size, &numConns);
if (numConns > 0 || InternetGetConnectedState(lpdwFlags,dwReserved)) g_IsConnected = 1;
else g_IsConnected = 0;
break;
case 3:
if (gethostbyname ("www.google.com")) g_IsConnected = 1;
else g_IsConnected = 0;
break;
case 4:
g_IsConnected = 0;
if (::InternetGetConnectedState (&dwReserved, 0)) {
if ((dwReserved & INTERNET_CONNECTION_LAN) ||
(dwReserved & INTERNET_CONNECTION_MODEM) ||
(dwReserved & INTERNET_CONNECTION_PROXY))
{
g_IsConnected = 1;
}
}
break;
case 5:
g_IsConnected = 0;
break;
}
Sleep(2500);
} while(1);
}
|
|
|
|
|
Can you help me also with next one more thing: if I detect that I'm connected on my LAN, how can I measure speed between my pc and server (I know only name of that server).
Tnx
|
|
|
|
|
try to use SNMP, but thats not trivial, i'am currently working on the same thing
|
|
|
|
|
In the interface I'm creating I have a dialog box that opens up containing a bitmap. Something different will happen depending on where on the bitmap the user clicks. I have 2 bitmaps, the "real" and the "template". I don't know why, but when the user clicks on the bitmap, the colour values are being read from the real bitmap and not the template one. I think the problem comes from this bit of code, but I'm not completely sure why:
in my constructor:
...
HBITMAP hTemplateBMP;
hTemplateBMP = ::LoadBitmap(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDB_PERIODIC_TMPL));
...
in my on clicked message handler:
POINT pt;
CDC *pDC = NULL;
CDC memDC;
HBITMAP hOldBMP = NULL;
COLORREF crColourAtPoint = 0;
GetCursorPos(&pt);
m_periodicBitmap.ScreenToClient(&pt);
pDC = m_periodicBitmap.GetDC();
memDC.CreateCompatibleDC(pDC);
hOldBMP = (HBITMAP)memDC.SelectObject(hTemplateBMP);
crColourAtPoint = GetPixel(memDC.m_hDC, pt.x, pt.y);
...
IDB_PERIODIC_TMPL is the template for my bitmap...
I believe crColourAtPoint ends up being the colour of the point in the real bitmap, not the template bitmap. Why??
|
|
|
|
|
For one thing, you are mixing MFC with Win32 GDI and that tends to get confusing.
Instead of using HBITMAP, use a CBitmap and the code should look like this:
in my constructor:
...
CBitmap TemplateBMP;
TemplateBMP.LoadBitmap(IDB_PERIODIC_TMPL);
...
in my on clicked message handler:
POINT pt;
CDC *pDC = NULL;
CDC memDC;
CBitmap OldBMP = NULL;
COLORREF crColourAtPoint = 0;
GetCursorPos(&pt);
m_periodicBitmap.ScreenToClient(&pt);
pDC = m_periodicBitmap.GetDC();
memDC.CreateCompatibleDC(pDC);
OldBMP = (CBitmap*)memDC.SelectObject(&TemplateBMP);
crColourAtPoint = GetPixel(memDC.m_hDC, pt.x, pt.y);
...
"It is better to remain silent and be thought a fool than to open one's mouth and remove all doubt." - Abraham Lincoln
|
|
|
|