|
Databases are usually stored in files on the harddisk. If you
store data in the .exe then you have to make a new .exe every
time you change the data. It is not impossible but I can't
remember ever seen it done.
If you want to hide your data you must encrypt it
before storing it in the database.
jhaga
|
|
|
|
|
well , but i actually don't want to change data in database. It's will be permanent data storage - it can be changed only during project compliling. So if it is possible to store database file in *.exe or *.dll module - tell me please, how can i do it ?
regards
|
|
|
|
|
CString row1="This is data row 1"
CString row2="This is data row 2"
etc.
You can have you whole database in one CString.
jhaga
|
|
|
|
|
well , but most data will be in binary data .. To store this data in the resource *.rc i think it's quite difficult , because there is about 20K items to store .. So how can i handle this problem ?
By the way - how to put and get from table binary data's ?
thanks !
|
|
|
|
|
Sorry, I have not answered you. But believe me,
I am not the right person to to give anybody advices
on how to store a binary database in the resources.
Tell us what kind of binary data you have (bitmaps jpegs?) and
maybe somebody else can answer you.
jhaga
|
|
|
|
|
Yes, if it will be , jpegs - how could i store them ?
|
|
|
|
|
If its a static database then use a CArray and a structure. It can hold more information than you think.
-Steven "the yellow dart" Hicks
CPACodeProjectAddict
|
|
|
|
|
Are you shure , that i can store binary data - for example images - about 10-20K items ?
Can you give me a sample of those data starage/retrieving ?
thank you.
|
|
|
|
|
Hello,
I have a dialog, which is going to be a typical casepaper form, used in hospitals. The dialog has a few controls which accept the patient's personal details like name, address, last visit date, age, gender, etc. Below this area, I have a CPropertySheet control, in which I am accepting the other treatment related details. There are 6/7 CPropertyPage dialogs which comprise the CPropertySheet tabs.
This child-dialog is called from an MDI window. My problem is whenever this dialog is open, and the focus is on any of the controls within any of my CPropertyPage dialogs, AND if the user clicks anywhere out of the dialog, even on the MDI Title, or MDI Client area, or even switches the application to some other application, my application hangs.
Additionally, I have a Microsoft DateTimePicker (DTPicker) control in one of my CPropertyPages , and clicking on any date on the open DTPicker Control also hangs up the application. The problem is the same.
Please let me know if you have encountered such a problem ever.
If required I can also send you the binary/workspace, if you can help me with that.
Thanks in advance,
Rgds,
Nirav
* The world stands aside to let anyone pass who knows where he is going! - David Jordan *
|
|
|
|
|
You may send me the code if you wish, I will check it. I have been embedding property sheets in dialogs and views with success.
Regards,
BB
|
|
|
|
|
Thanks Bartosz!...
I understand you may be a busy person, so even in case you have some sample code of your own, where you are using embedded CPropertySheet with CPropertyPages , even if you can send them to me maybe I can solve the problem!...
I have sent you an e-mail to your registered e-mail address at CP.
Thanks,
Rgds,
Nirav Doshi
* The world stands aside to let anyone pass who knows where he is going! - David Jordan *
|
|
|
|
|
Hi,
I want to be able to create an icon at runtime, eg be able to write text and draw lines on it, and then load it as the current icon. Any ideas?
Thanks
|
|
|
|
|
Hi
What are the special things that can be done using MFC(VC) but impossible in VB ?
Thanks
|
|
|
|
|
Well, almost everything can be done in VB so use it and
go home when you are done. Of course VB is a little bit over-
protective so use MFC(VC) when you need to be in full control
and have time(alot of time!) to learn how to use it right.
But remember that Microsoft is trying to get all of
us people to move on and start using .NET.
jhaga
|
|
|
|
|
Depends on type of application you are working on. May be somebody is much better with vb than me....
1) VB6 sucks at code reuse. No such sing as include, and derive your class from existing class from previous project.
2) VB6 can not catch some exceptions. Some exceptions cause vb to crap out.
3) COM: No chance on MTA objects. STA or bust
4) COM: Not every interface is accessible from VB
5) No define macros, I can not survive w/o ASSERT and VERIFY.
6) VB you are stuck with provided UI, subclassing is a pain.
No solution for flicker, etc. Stuck with standard UI: Menus, MDI etc.
|
|
|
|
|
In a mobile environment such as the PocketPC, it is the difference between a professional application (VC) and a pile of junk (VB). Worst, .NET here, means .NOT (too big, too slow)!
|
|
|
|
|
//This is a console program using C++ language syntax.
//Please reply me in C++ language syntax only.
//Thank you very much.
I have written a GCD program and it is a menu driven program. Below
is a main menu. Instead of always looping back to main menu, I
have designed it so that I could always go back one step. For example,
when I press 1, the program will starts the GCD, after finishing it, I want
it to continue to run, not go back to main. If you copy the code and
run it for yourself, you will see what I mean.
My problem is, I have to put a lot of complicated control code in the
main() function, it is fine for this simple. But when I design a big
complicated program (I'm going to write a converter program), this
technique would not be good. So I wonder how a professional
programmer would design it.(remember: I don't want my program
always going back to main menu.)
main menu:
------------------------------------------------------
Welcome to the Greatest Common Divisor program.
To use the program, please enter one of the following
choices.
1. Start the Greatest Common Divisor (GDC)
2. Learn more about this program
3. Exit the program
>>
--------------------------------------------------------
press 1 and the program will start the GCD:
-------------------------------------------------------
Please enter the first number: 22
Please enter the second number: 44
The GCD is: 22.
Do you want to continue? [Y/N]
>>
---------------------------------------------------------
then if I press 1, the program will start it over again,
but not go back to menu.
----------------------------------------------------------
Please enter the first number:
----------------------------------------------------------
The code is below:
---------------------------------------------------------
#include <iostream>
#include <cstdlib>
#include <conio.h>
using namespace std;
int main_screen();
void GCDstart();
void aboutProgram();
int main()
{
int choice = 0;
while(choice != 3)
{
choice = main_screen();
//Choice 1 to start the GCD
if(choice == 1)
{
while(choice != 'N' && choice != 'n')
{
char choice = 'N';
GCDstart();
cout << "Do you want to continue? [Y/N]" << endl;
cout << ">> ";
cin >> choice;
if(choice == 'Y' || choice == 'y')
{
system("cls");
}
else if(choice == 'N' || choice == 'n')
{
cout << "Program will go back to main menu." << endl;
getch();
system("cls");
break;
}
else
{
cout <<"Input Error:" << endl;
break;
}
}
}
//Choice 2 to learn more about the program
else if(choice == 2)
{
aboutProgram();
}
//Choice 3 to break the loop
else if(choice == 3)
{
break;
}
//Display error
else
{
cout <<"Input Error: please try again!" << endl;
getch();
system("cls");
}
}
cout << "Bye!" << endl;
return 0;
}
int main_screen()
{
//Display choices of the main menu
cout << "Welcome to the Greatest Common Divisor program." << endl
<< "To use the program, please enter one of the following" << endl
<< "choices." << endl
<< "1. Start the Greatest Common Divisor (GDC)" << endl
<< "2. Learn more about this program" << endl
<< "3. Exit the program" <<endl;
get="" user's="" choice
="" int="" choice;
="" cout="" <<="" "="">> ";
cin >> choice;
return choice;
}
///////////////////////////////////////////
//GCD MAIN FUNCTION
void GCDstart()
{
system("cls");
int num_1, num_2;
int remainder = 1, GCD;
cout <<"Please enter the first number: ";
cin >> num_1;
cout <<"Please enter the second number: ";
cin >> num_2;
num_1 = abs(num_1);
num_2 = abs(num_2);
if (num_1 >= num_2)
{
while (remainder != 0)
{
remainder = num_1 % num_2;
num_1 = num_2;
num_2 = remainder;
GCD = num_1;
}
}
else if (num_2 >= num_1)
{
while (remainder != 0)
{
remainder = num_2 % num_1;
num_2 = num_1;
num_1 = remainder;
GCD = num_2;
}
}
cout << "The GCD is: " << GCD <<"." << endl << endl;
}
///////////////////////////////////////////////
//ABOUT PROGRAM FUNCTION
void aboutProgram()
{
system("cls");
cout << "This is a GCD program. It is a program that" << endl;
cout << "finds the Greatest Common Factors. Enter two" << endl;
cout << "integers and the program will tell you the GCD." << endl;
cout << "Please press any key to continue." << endl;
getch();
system("cls");
}
|
|
|
|
|
Make each menu it's own function and call
them from a switch body. In this way you
only call the main_menu in main()
and in main_menu you call the next menus etc.
...
cin >> choice;
switch(choice )
{
case 1:
main_menu();
break;
case 2 :
other_menu(); //etc
break;
default :
break;
}
jhaga
|
|
|
|
|
I am trying to re-create the dialog functionality of a program called myHTPC ( www.myhtpc.net ).
I am new to gui programming so please bare with me. The above mentioned program is coded in Delphi 7 so I image that it uses forms. The functionality that I am trying to reproduce is the following:
The application consists of multiple dialogs ( very possibly many ):
Main Dialog: which can go to a music module and a slide show module. exiting the music or slide show module would bring you back to the main dialog. So with nested dialogs you can always go back to the previous dialog until you get back to the main dialog.
If you go to the music module and play a file then go back to the main dialog then select slide show the music should remain playing.
First off I am looking for theory not code so don't be alarmed. Each dialog would be full screen.
Questions:
1) Would you use a different dialog for each module or dynamically create each module when
selected.
2) Would you destroy each dialog as you create a new one or would you just display the new one
over the top of the previous one.
3) My final question ( for now ) is that of scope. How or where would you instaniate your objects
such that they won't be destroyed if I close the dialog that is controlling it.
Well I hope I explained myself well enough for someone to understand my question. Any advice or pointers would be appreciated.
Thanks,
Steve
|
|
|
|
|
Your questions are about implementation but I feel you are still in the design fase. How about a simple prototype to get you going?
You are new to gui programming but have chosen Visual c++?
jhaga
|
|
|
|
|
jhaga thanks for responding,
Yes, I agree that I am in the design phase and my questions are most definiately about implementation. Sorry, I did not make that more obvious.
I have written a fair amount of the background code. The music module module is mostly written. I wanting to have something working before I tried to make it pretty.
I have always used Visual C++. I use it in the work place. I have always written code but the interface or gui stuff was always written by another team.
Just for information, I have started messing around with GDI+ for drawing. I am not new to programming just new to these gui issues and issues of scope. In my job ( before I got laid off a couple of weeks ago ) I coded aircraft systems for an aircraft simulation company. 9-1l hit the aircraft industry hard.
Let me know if you need more information.
Thanks,
Steve
PS: I started this as a learning experience since I am now looking for a JOB.
I wanted to be more versatile
|
|
|
|
|
If I were you I would look at all the source code
at http://www.codeproject.com/dialog/
The gui is usually the easy part of the application
jhaga
|
|
|
|
|
well I guess if you have done it before
I have looked through the above mentioned section and I don't think that anything there applied to what I am trying to accomplish.
Brian's comment is a start.
Thanks,
Steve
|
|
|
|
|
Application uses single dialog, GDI+ to draw elements. And, I think, it
is much easier and nicer solution than pop dialogs.
>How or where would you instaniate your objects such that they won't
>be destroyed if I close the dialog that is controlling it.
Bridge pattern.
|
|
|
|
|
Could you expound on the term "bridge pattern"
Thanks,
Steve
|
|
|
|