|
Hi,
I am creating an app, very much similar to a mini database. Now my problem is, I need to execute a QUERY on tables. There will be only a max of 4 fields in the queries WHERE clause. Then I need to filter the data based on the WHERE condition supplied. Any suggestions on what sort of data structure should I go for ? ( I can even load the whole thing into memory at startup if reqd.,since memory is not a constraint. )
"A robust program is resistant to errors -- it either works correctly, or it does not work at all; whereas a fault tolerant program must actually recover from errors."
|
|
|
|
|
Have you considered the CRecordset and CDatabase classes?
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
I want to develop the same in Plain C++, so that it can be ported to UNIX later.
"A robust program is resistant to errors -- it either works correctly, or it does not work at all; whereas a fault tolerant program must actually recover from errors."
|
|
|
|
|
Since "plain" C++ has no knowledge of databases, recordsets, files, and the like, what you want, AFAIK, is not possible. In order to provide support for these, you'll need a platform-dependent API. I do not know of one for both Windows and UNIX, although it's been 15 years since I worked on a UNIX box so something just might be available.
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
HI,
I have a batch file which takes 11 arguments. 11th argument is the file name and if I try writing anything to that file, the system creates the file name from argument 1 and appends 0 to it.
eg.
@echo Something > "C:\Logs\%10"
If I run like this
xxx.bat a b c d e f g h i j k
It creates b0 file. But I want to create k0
Any idea??
- Prashant
|
|
|
|
|
Er.. funny "Visual C++" question
Anyway, I belive the only way is like this:
shift
@echo Something > "C:\Logs\%90"
|
|
|
|
|
But shift takes arguments 0 to 8. Here its 9 and does'nt work..
|
|
|
|
|
Batch files are limited to 10 (numbered 0-9) command-line arguments.
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
No...
Save this as test.bat:
@echo off
@echo %0
:again
if {%1}=={} goto :EOF
@echo %1 %2 %3 %4 %5 %6 %7 %8 %9
shift
goto again
Then execute "test.bat a b c d e f g h i j k l m n o p q r s t u v w x y z"
And you will see it prints out all 26 paramaters. You can only directly refer to the first 9, 10 including the file name, but you can shift more in. See here http://www.jsiinc.com/SUBN/tip6700/rh6792.htm.
The only limit AFAIK is the "%*" will only pass the 9 parameters, so you can't pass more than 9 to say another batch file, unless you shift each one in and call setlocal to assign them their own local variable, then pass all of them.
|
|
|
|
|
While the shift command does allow access to more than 10 arguments, only 10 of them accessible at any given time. I don't believe that satisifes the OP's original requirement. In other words, accessing %2 and %14 would not be possible.
However, I question the need of a program that requires that many command-line arguments.
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
I'm a noobie and trying to make Hello World in visual studio 2003.
It says: error C2065: 'cout' : undeclared identifier.
Please help.
|
|
|
|
|
Put #include <iostream> at the top of your file
|
|
|
|
|
At the top of the source file, where you want to use cout:
#include <iostream.h>
Regards, mYkel
|
|
|
|
|
need to put #include "stdio.h" at head
|
|
|
|
|
Which does nothing for cout . stdio.h is for printf and related functions.
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
#include <iostream>
using std::cout; <font color=green> Another poster suggested <iostream.h>, but that's obsolete, non-portable, and incompatible with the standard. Don't use it for new code.
|
|
|
|
|
I need to make some utility wich would be able to get basic information
about quick time (.mov) and real video movie files,
like length of movie in seconds, and whether it also contains audio track.
Does anybody know about some free lightwight library for this ?
Or some documents how to do this ?
Thanks
rrrado
|
|
|
|
|
Hi !
When I build my project I have a strange error (due to the linker):
....
....
Linking...
LINK : error : Internal error during EmitMap
ExceptionCode = C0000005
ExceptionFlags = 00000000
ExceptionAddress = 0043F8A4
NumberParameters = 00000002
ExceptionInformation[ 0] = 00000000
ExceptionInformation[ 1] = 01979104
CONTEXT:
Eax = AAAAAAAB Esp = 0012F8F4
Ebx = 7800F24D Ebp = 7800F24D
Ecx = 01979100 Esi = 3FFF0000
Edx = 400C2B44 Edi = 0000031D
Eip = 0043F8A4 EFlags = 00010206
SegCs = 0000001B SegDs = 00000023
SegSs = 00000023 SegEs = 00000023
SegFs = 00000038 SegGs = 00000000
Dr0 = 0012F8F4 Dr3 = 7800F24D
Dr1 = 7800F24D Dr6 = 01979100
Dr2 = 00000000 Dr7 = 00000000
Error executing link.exe.
Tool execution canceled by user.
But when I build again, this works fine.
Any idea ??
Thanks
|
|
|
|
|
I had such an error some years ago...
I overcloced my AMD K6 300 to 400MHz.
All Apps run just fine but during builds
I got some strange "Internal errors" Juts like
yours.
|
|
|
|
|
woah , your comipler is pretty messed up. its an internal error. the most dreaded error.
Toughest Steel Comes From Hottest Furnance
|
|
|
|
|
Hum hum... Yes ok but I hope this won't bring me a lot of problems
How can I fix this problem ??
|
|
|
|
|
Well first thing you can do is reinstall Visual Studio.
Toughest Steel Comes From Hottest Furnance
|
|
|
|
|
Actually, I think it's the linker.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Hi there,
I'm experiencing problems disabling/graying menu items in the default menu added to an MFC application.
The following code to to check an item works but when I try to disable/gray a menu item (also shown below) the item is still enabled and not grayed (it doesn't change state):
<br />
CMenu *pMenu = GetMenu();<br />
pMenu->GetSubMenu(0)->CheckMenuItem(ID_FILE_NEW, MF_CHECKED);<br />
<br />
pMenu->GetSubMenu(0)->EnableMenuItem(ID_FILE_NEW, MF_GRAYED);
EnableMenuItem() returns 0 which, according to MSDN, means the previous state was MF_ENABLED.
Do any of you guys have an idea what might be causing this problem?
Thanks in advance!
|
|
|
|
|
Your code is working correctly, but the state of the menu item is being changed back to enabled by how MFC works. When a menu is about to be displayed, MFC will fire of a ON_UPDATE_COMMAND_UI handler for every item in the menu. If you handle this and disable the specific menu item in that handler, it will work OK. If you do not handle it, MFC will enable the menu item by default if a ON_COMMAND handler exists in the call tree for that item (i.e app/mainframe, doc or view).
So, you really need to enable/gray the item in the ON_UPDATE_COMMAND_UI handler for that specific menu item
Roger Allen - Sonork 100.10016
Roger Wright: Remember to buckle up, please, and encourage your friends to do the same. It's not just about saving your life, but saving the quality of life for those you may leave behind...
|
|
|
|