|
Hello Guruji
I am making an application using modal dialog based application
my need is save .txt and word file in database
( file name saved in database and file save in folder )
i can fetch file name using some obj.GetPathName() function
but now how i saving this file to folder and also how i will be
feaching it.
Note : i used database as MySQL
Now one of another question how feach data from MS word file
Please told me
if possible with example
Regard's
Kaushik
|
|
|
|
|
Since MySQL support BLOB columns, I would suggest compressing the data (zLib comes in handy here), and then stuffing the resulting data into a BLOB column, possibly storing the "real" length of the data somewhere to optimize your uncompression process.
How you get that data into a BLOB column depends on the API you are using (MySQL Connector/ODBC), but you should have documentation that explains how to do that.
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
Problem is that i know only file path and file name now
how can i save it in database.
When downloading how can i open it
Regard's
Kaushik
|
|
|
|
|
The complete path to the file is enough information to get at that file's data. In a nutshell, you can load the file's data, and then upload it to the database. As I said before, the documentation for the API you are using will show you how to pass data to the database.
When downloading the data from the database, you will save it on disk (oh, and also remember to keep the filename and extension of the original file so you can recreate it correctly), and then you can launch it from wherever you saved it on disk at.
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
Y_Kaushik wrote: how can i save it in database.
Read the contents of the file into a buffer, and store that buffer to the BLOB column.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
hi i have to read the keys pressed in keyboard and send that to a drive. how to receve the keys pressed using vc++. pls help me
Arise Awake Stop Not Till ur Goal is Reached.
|
|
|
|
|
Hi,
If I understand your question correctly, try using one of these
_getch, _getche
Get a character from the console without echo (_getch) or with echo (_getche).
<br />
int _getch( void );<br />
int _getche( void );<br />
Example
#include <conio.h>
#include <ctype.h>
void main( void )
{
int ch;
_cputs( "Type 'Y' when finished typing keys: " );
do
{
ch = _getch();
ch = toupper( ch );
} while( ch != 'Y' );
_putch( ch );
_putch( '\r' );
_putch( '\n' );
}
_kbhit
Checks the console for keyboard input.
int _kbhit( void );
Example
#include <conio.h>
#include <stdio.h>
void main( void )
{
while( !_kbhit() )
_cputs( "Hit me!! " );
printf( "\nKey struck was '%c'\n", _getch() );
_getch();
}
Or have a look at SendKeys in C++[^]
Regards,
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
My Blog: ^_^
|
|
|
|
|
If you want to write a Key Logger , you might want to start by stating so, and searching Google for Key Logger source code.
In the simplest form, you would create a Keyboard Hook (in a DLL), and intercept keyboard events and write them to a file.
In the more robust and professional forms, you use a Window Message Hook and pay attention to keyboard-related and mouse-button-related events so that you can correctly capture user input from several sources (on-screen keyboards, enhanced keypads, buttons that trigger text macros, voice recognition/dictation, mouse gesture systems, Accessibility aids/applications like Dasher[^], etc.)
I believe that far too many so-called "key loggers" are written by amateurs that think that the only way to get a character into an edit control is by pressing a key on a keyboard. Nothing is worse than bad software masquerading as security. (Well, maybe except for the companies that use them!)
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
|
Hi all.
In an earlier question I indicated that I generate child dialog by means of "Create". However; when defining a new entry I prefer to use a modal dialog for a number of reasons. This means that - for example - in the OnOK routine, I can have a modal dialog or not; which means that I need to react differently. Anyone have any idea how to find out if the dialog is modal or not? I could of course set a flag myself (since I know how I am creating the dialog) but isn't there a neat way of doing this?
Thanks in advance
William
|
|
|
|
|
If you are using MFC, modal dialogs are implemented a little differently - they simply disable their parent window. You should be able to get a dialog's parent window handle (HWND ), and then see if it is disabled or not.
Not really neat, but it may work for you. Might just be better to set a flag!
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
James,
Thanks for your answer. I have now indeed introduced a flag, which is set in an overridden DoModal routine. Works just fine.
Thanks,
William
|
|
|
|
|
|
Hi,
I am trying to fetch the information about remote computer. Initially, I need the information of number of physical disks and their sizes.
I am taking help of the following registry key to get the number of physical disks (I am opening remote registry and querying these keys):
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\IDE<br />
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\SCSI
These keys contains the number of disks on the system. But, I am unable to fetch their sizes. CreateFile is not opening physical disks on remote system (returning INVALID_HANDLE_VALUE).
Can anybody help resolving this issue?
Kiran.
|
|
|
|
|
I suspect the answer might lie with WMI (Windows Management Instrumentation). In theory this technology can get you the information you want but I can't say I've had much luck with it myself. I'd be interested in any solution you finally come up with though as I've stalled on a similar problem in the past. Microsoft don't seem to publish an interface for talking to the Logical Disk Manager, even locally. If this has changed perhaps somebody else will be able to post a link.
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
Hi all,
I'm trying to create a time stamp [format: yyyymmddhhmmss], but as always I'm experiencing some problems. I have tried the following:
char dateString [20];
char timeString [20];
struct tm *newtime;
time_t long_time;
time( &long_time );
newtime = localtime( &long_time );
sprintf(dateString,"%d%d%d",newtime->tm_year, newtime->tm_mon, newtime->tm_mday);
sprintf(timeString,"%d%d%d",newtime->tm_hour, newtime->tm_min, newtime->tm_sec);
But I not very familiar with the expression to use. Can anyone please help??
Many Thanks
Regards
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
My Blog: ^_^
|
|
|
|
|
Hi,
For the year, you need to add 1900 (see MSDN for more information). So, your sprintf turn to:
<br />
sprintf(dateString,"%4d%02d%02d",newtime->tm_year + 1900 , newtime->tm_mon, newtime->tm_mday);<br />
sprintf(timeString,"%02d%02d%02d",newtime->tm_hour, newtime->tm_min, newtime->tm_sec);<br />
The bold letters are those places where I made changes.
Hope that helps.
Kiran.
|
|
|
|
|
|
Programm3r wrote: format: yyyymmddhhmmss
Use: _tcsftime (dateString, 20, _T("%Y%m%d%H%M%S"), newtime);
|
|
|
|
|
Thank you very much for the help.
Regards,
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
My Blog: ^_^
|
|
|
|
|
Programm3r wrote: ...I'm experiencing some problems.
One of which seems to be not explaining the problem.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
DavidCrow wrote: One of which seems to be not explaining the problem.
Strange that the other two people understood the question ....
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
My Blog: ^_^
|
|
|
|
|
I have a VC++ project (x.dsp). When I open the .dsp (x.dsp) of this project it is opening all other project as well. I don’t know how this is loading all other projects to workspace? If it is possible, can you please help me, how to implement it?.
And at the same time, when I compile this project (x.dsp – which is set as active), it is compiling all the projects in an order even though only x.dsp is set as active. Can you please help me how to do this??
Anand
|
|
|
|
|
See Here[^] [Visual Studio IDE]
Regards,
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
My Blog: ^_^
|
|
|
|
|
I cant get what you are telling. Can any one help me??
|
|
|
|