|
Hi at all,
is there a way to send messages from an application A to an other
application B?
Application A is mine, application B is not mine. Application B has an icon
in the status bar.
With application A i would like to send messages, like WM_KEYDOWN or right
button click, to appliaction B via its icon on the status bar.
It is possible?
thanks a lot
roberto
|
|
|
|
|
hi there ..
there r ways to send info from one application to another Like memory mapped file, DLL hooking ...
for this in the above win95 u can work upon but u need control of both the application in this scenario.
you can refer any Advanced Windows book of Jeffry Richter of Microsoft Press
....
all the best..
....
utkarsh sharma
"Not everything that counts can be counted, and not everything that can be counted counts."
|
|
|
|
|
roberto674 wrote:
With application A i would like to send messages, like WM_KEYDOWN or right
button click, to appliaction B via its icon on the status bar.
Get the HWND of Application B
and use ..
SendMessage(hWnd_B,WM_KEYDOWN,....);
To Get The HWND of B application USE
FindWindow
Hope it Helps
Live as if your were to die tomorrow. Learn as if you were to live forever.
-Mahatma Gandhi
|
|
|
|
|
Sure,
but the problem is the HWND from FindWindow is the handle of main application B. If application uses another window associates to at the icon on th status bar? the window that manages messages from mouse (right click and so on)...
the HWND of the main application B cannot be the same the window that do this.
can help me some shell functions for this?
roberto
|
|
|
|
|
Hi,
do you know about some libraries with which I could extract text from a pdf file?
Thanks
Pepe
|
|
|
|
|
|
i want general printer protocol wich one is used by each application in windows. in windows when we send print command then some data is sent to pronter driver for printing.that data format i want .
PLz if anybody knows this plz help me
|
|
|
|
|
Can I make sure that the height of the listbox of a CBS_DROPDOWNLIST combobox is not affected by the itemcount, if this count implies a smaller height as defined by creation?
|
|
|
|
|
Use CComboBox::SetDroppedWidth( UINT nWidth );
//sample
// The pointer to my combo box.
extern CComboBox* pmyComboBox;
// Find the longest string in the combo box.
CString str;
CSize sz;
int dx=0;
CDC* pDC = pmyComboBox->GetDC();
for (int i=0;i < pmyComboBox->GetCount();i++)
{
pmyComboBox->GetLBText( i, str );
sz = pDC->GetTextExtent(str);
if (sz.cx > dx)
dx = sz.cx;
}
pmyComboBox->ReleaseDC(pDC);
// Adjust the width for the vertical scroll bar and the left and right border.
dx += ::GetSystemMetrics(SM_CXVSCROLL) + 2*::GetSystemMetrics(SM_CXEDGE);
// Set the width of the list box so that every item is completely visible.
pmyComboBox->SetDroppedWidth(dx);
greatest thing is to do wot others think you cant suhredayan@omniquad.com
|
|
|
|
|
How do I make sure that the height of the listbox of a CBS_DROPDOWNLIST combobox is not affected by the itemcount, if this count implies a smaller height as defined by creation?
|
|
|
|
|
Hi,
I've written a program in Visual C++ 6.0 that periodically outputs data to a text file. Now, however I need to output this data to a MS Access database. I've created a link to Access using the Class Wizard to autogenerate code from 'MSACC9.OLB'. I've then created an instance of _Application which then allows me to open/create a database.
The problems that I have are:
1) when Access starts up, as well as opening the specified database it also displays the 'Select Database' dialog. How do I get rid of this?
2) Now that I have my database open how do I go about opening a table and then inserting data into it?
I've created a DoCmd object which I attach to my _Application object, however when I call OpenTable I get 'member not found' error even though the table exists. This may be due to my lack of understanding of the VARIANT type, as I've only created it and then called SetString (passing in my table name) on it.
many thanks,
Andy
|
|
|
|
|
You are doing it the hard way, aren't you?
Why don't you use DAO or ADO? These will allow you to create your database, update it in the much more efficient way? And you do not need to have Access installed...
Good luck!
|
|
|
|
|
thanks for your suggestion however I forgot to mention that the people I'm doing want to have Access displayed so they can see graphs being updated during the simulation run of my software.
|
|
|
|
|
Hello,
If you develop application VC++ 6.0 you can use MS-Access 98 version. (or VB 6.0 Ad-Ins->Visual Data Manager) otherwise, displays the 'Select Database' dialog. I think you use in MS Access 2000.
With Regards,
R.Selvam
|
|
|
|
|
Dear All:
I now use CGridCtrl by Chris Maunder, and I add all the source files manually not by ClassWisard, that is to say I only use the command "Add Files to Folder..." to add all the files.
The question is I can't find all the classed by Chris Maunder listed in ClassWisard, also can't find all the message by Chris Maunder in the ClassWisard,what should I do?
BTW: I can't add the a grid like what Maunder said in the introduce?
Hoping...
|
|
|
|
|
You need to 'rebuild' your classwizzard file. To do this, rename (or delete but it's more dangerous) the .clw file from your project. Then open ClassWizzard and it will ask you if you want to rebuild it from your sources files. Say yes and select all the files (don't forget to select all the class from the control). That's it.
|
|
|
|
|
Sucessfully, what should I say... Thank you very much!
Another question: In Chris Maunder's introduce, he generate a dialog and insert a grid with a ID:IDC_GRID, but I inserted a grid manually without an ID, what should I do if I also want to have a grid's ID???
|
|
|
|
|
Hello,
I received some files (probably issued from a DBase 4 database and having a .dbf extension) and I would like to access it from a VC++ application to pick up some figures in it.
How can I do that and retrieve the right column/row ?
Any suggestion is welcome ...
Regards,
DD
|
|
|
|
|
You can use ODBC. Define a DSN onto your database with a dBase driver.
|
|
|
|
|
I don't know the structure of dBase, I juste have the copy of a .dbf file (containing the field that interressed me) taken in the middle of dozen others .dbf files.
With ODBC, is it possible to work on a single .dbf file, just to read some infos in it (no update to be done) without the whole dBase context or do I have to read the file in another way, like I would do it for a text file ? But, in this case, how to access the correct column/row, skip the kind of header at the beginning of the file, move from a record to another, etc ...
Regards,
DD
|
|
|
|
|
Qadddd wrote:
I don't know the structure of dBase
That's the beauty of ODBC... you have a common way of accessing all databases. Simply read (or write). You can select which field you want to appear, etc...
|
|
|
|
|
yes, I agree that ODBC is not too bad for this reason and also for code compatibility with other databases.
But, I would like to be sure that it allows me to access a single .dbf file without having the whole dBase context installed on my PC. By context, I mean the right access management, the DB manager itself and all these things that turn around the .dbf files...
So, a .dbf file can really be read out of its dBase context via ODBC.
Is the description of the table (and other needed infos) stored in the famous "header" stored at the beginning of the .dbf file and that's why ODBC can understand the content of the file ? Some other applications (i.e. Microsoft Excel) can also open these .dbf files, do they use the file header, do they use ODBC or an kind of internal interface to do the translation ?
Thanks again for you answers
DD
|
|
|
|
|
Hello,
I use the ODBC driver "dBase Files" installed by microsoft.
hereunder is the code I wrote to access the C:\Documents and Settings\dd\Mes documents\GSTAT.DBF file :
#define DBName "DSN=dBASE Files;UID=;PWD:"
...
CDatabase gDB;
CRecordset rs(&gDB);
CString res;
CString ErrMsg;
CString CASHT;
CString NETROOM;
CString DATUM;
int NbRecord;
CString Path = "C:\\Documents and Settings\\dd\\Mes documents\\" ;
CString File = "GSTAT.DBF" ;
ErrMsg = "";
res = "SELECT DATUM,CASHT,NETROOM from ["+File+"]";
// res = "SELECT DATUM,CASHT,NETROOM from ["+File+"] WHERE (DATUM = 20010208)";
// res = "SELECT DATUM,CASHT,NETROOM from ["+File+"] WHERE (DATUM = '20010208')";
// gDB.OpenEx(DBName,CDatabase::noOdbcDialog);
gDB.OpenEx(DBName,CDatabase::forceOdbcDialog );
TRY
{
rs.Open( CRecordset::forwardOnly, res );
NbRecord = rs.GetRecordCount();
}
CATCH(CDBException, e)
{
ErrMsg ="**ERR: "+e->m_strError.Left(70);
}
END_CATCH
if (ErrMsg == "") {
while(!rs.IsEOF()) {
rs.GetFieldValue( "DATUM", DATUM);
rs.GetFieldValue( "CASHT", CASHT);
rs.GetFieldValue( "NETROOM", NETROOM);
rs.MoveNext();
}
}
rs.Close();
gDB.Close();
Used like this, it works but I have some problems :
1) I am obliged go thru the ODBC display to give the name of the file, I can't set it by program ... why ? How can I do this and use the noOdbcDialog option (When I try to use it, ODBC tells me that it can't find GSTAT.DBF)?
Furthermore, ODBC dialog is based on program directory, not on the path. If I add the Path to the name in File variable, ODBC tells me that it can't find C:\Documents and Settings\dd\Mes documents\GSTAT.DBF ...
2) If I add the clause "WHERE" to my request, no record is returned ... why ? Can't I use it ? Am I obliged to read all records and test the DATUM field by program ?
3) what is the format of the date in the file ? Excel says 08/02/2001, Word says 20010208 and DATUM = 2001-02-06 when debugging my code ... When I use a date in format yyyy-mm-dd or dd/mm/yyyy ODBC tells me that my format is not compatible
Thanks in advance
DD
|
|
|
|
|
I think you are almost there!
1) the database problem
When you create your system DSN, you will give it a name (ex dsnMyDatabase). This name will indicate the DBF file name and the driever you are using.
Then you will redefine
#define DBName "DSN=dsnMyDatabase;UID=WD;"
It should do the trick
2)and 3) The Where should work it is probably a problem due to the way dates are defined
try this WHERE DATNUM = #mm/dd/yyyy#
Good luck
|
|
|
|
|
hello,
sorry to bug you again with this stuff, but I need some extra-infos (in fact, I don't use PC database stuff very much (except MySql on which I crated a little application also using ODBC and I am quite a newbie in VC++ )
1) #define DBName "DSN=dsnMyDatabase;UID=WD;"
Ok I was looking for the pannel where I set the access to the database (path, file) during the ODBC configuration and did not find it ... but looking at it a second time, there is a "Use Current directory" set, and if I deselect it, I can precise the path/file ...
So the way id to Create 1 DSN per file in ODBC and done the "gDB.OpenEx(DBName,CDatabase::noOdbcDialog);" with the correct one.
But, in ODBC, should I just give the path and then precise the file in "OpenValue" in the "rs.Open( CRecordset::forwardOnly, OpenValue );" command, or should I give the path and the file name, in this case should I repeat the file name ine the "OpenValue" or not ?
2) Yes, it should work. ok, I will try the WHERE format you proposed me.
Thanks again
DD
|
|
|
|