|
hello
i programing the code && design the interfaces
then , connect the programing with db "store the results in db"
then connect the db with interface and appeare the results on edit boxes in the interface
now , we want excute the programing code when click specific button .so, we use this function :
ShellExecute(this->m_hWnd,"open","proto1.exe","","", SW_SHOW );
when we run the interface and click the button excute the programing code"proto1.exe"
but the result false . the results diffrent about the results that appere when excute the file separetly on console also the data base some time doesn't update .so, the results itrated
also , the same copy from proto1 that deal with db and interface when take it in other place provide the same false results . althogh , ather copy of ptoto1 that dosn't deal with db and interface work very good
note , in proto1 code read from 2 files and these files important to programing the code and the results depod on them
in interface , the user do prowse and select 2 files . these file appear in edit boxes then stored in 2 other static files"in each chose for user change the content of files" that the proto1 read from them
i hope knowing why the results appearing false and db does not change
|
|
|
|
|
Could you provide, please, an alternative question?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hi all,
first of all i am using WTL but since its similar to mfc i am posting it here. I was helped here before about NOTIFY_HANDLER for WTL so that the code can monitor everytime a change has been made to my treeview and created this function:
LRESULT CMainDlg::OnSelChange(int idCtrl, LPNMHDR pnmh, BOOL& bHandled)
{
pNMTreeView = (NMTREEVIEW*)pnmh;
Select = pNMTreeView->itemNew.hItem;
return 0;
}
I just want to know how I can make a version of this for a combobox change. What can i use for a combobox? If NMTREEVIEW is for treeview what is for combobox control? Select is a CTreeItem what can i use for that?
Is this still applicable:
NOTIFY_HANDLER( IDC_UPDATEDAY, TVN_SELCHANGED , OnSelChange )
Thanks,
Jayjay
|
|
|
|
|
monsieur_jj wrote: I just want to know how I can make a version of this for a combobox change. What can i use for a combobox? If NMTREEVIEW is for treeview what is for combobox control? Select is a CTreeItem what can i use for that?
Is this still applicable:
NOTIFY_HANDLER( IDC_UPDATEDAY, TVN_SELCHANGED , OnSelChange )
Selection change notification for a combo is CBN_SELCHANGE, CBN_SELENDOK. The latter is sent when selection change becomes permanent, and the former is sent when user is changing the selection using arrow keys/mouse but new selection is not yet permanent, also called if the selection becomes permanent (bit of live action).
Nibu babu thomas
Microsoft MVP for VC++
Code must be written to be read, not by the compiler, but by another human being.
Programming Blog: http://nibuthomas.wordpress.com
modified on Thursday, July 3, 2008 11:47 PM
|
|
|
|
|
Nibu,
I tried that CBN_SELCHANGED however it doesnt call my OnSelChange if ever a selection change has occured. this is my code
NOTIFY_HANDLER( IDC_UPDATEDAY, CBN_SELCHANGE , OnSelChanges )
LRESULT CPrefDlg::OnSelChanges(int idCtrl, LPNMHDR pnmh, BOOL& bHandled)
{
pNMCombobox = (NMCOMBOBOXEX*)pnmh;
pNMCombobox->ceItem.iItem;
return 0;
}
It doesnt even go there. What seems to be the problem
is that right?
Thanks,
Jayjay
|
|
|
|
|
monsieur_jj wrote: What seems to be the problem
is that right?
monsieur_jj wrote: NOTIFY_HANDLER( IDC_UPDATEDAY, CBN_SELCHANGE , OnSelChanges )
Is IDC_UPDATEDAY id of the combo or the tree? From your OP it looks to me as the tree id.
Nibu babu thomas
Microsoft MVP for VC++
Code must be written to be read, not by the compiler, but by another human being.
Programming Blog: http://nibuthomas.wordpress.com
|
|
|
|
|
Its an ID of a combo-box control
|
|
|
|
|
monsieur_jj wrote: Its an ID of a combo-box control
So is this a CComboBoxEx control, since you are casting the notification structure to NMCOMBOBOXEX type?
If so then you've got to handle notifications...
CBEN_BEGINEDIT, CBEN_ENDEDIT.
Nibu babu thomas
Microsoft MVP for VC++
Code must be written to be read, not by the compiler, but by another human being.
Programming Blog: http://nibuthomas.wordpress.com
|
|
|
|
|
|
The CBN_SELCHANGE message is send with WM_COMMAND where as TVN_SELCHANGED was with WM_NOTIFY. That why we have to use NOTIFY_HANDLER for handling the TVN_SELCHANGED. So if you want to handle the CBN_SELCHANGE, the macro to be used is COMMAND_HANDLER
COMMAND_HANDLER( IDC_UPDATEDAY, CBN_SELCHANGE , OnSelChanges )
and the proto of OnSelChanges should be
LRESULT OnSelChanges(WORD wNotifyCode,WORD wID,HWND hWndCtl,BOOL& bHandled );
|
|
|
|
|
|
when i read from file1 then write to athor file2, file 1 writen on file 2 but if file 2 contain lines more than file 1 ,this lines stay in the file 2
don't empty the file2 then write on
is there any solove to this problem?
|
|
|
|
|
Hi,
I don't think it behaves like you seem to imply.
most file systems I have encountered have this behavior:
- for sequential writing, when a file gets opened normally, it gets truncated to
zero length, then grows according to the new data; the exception is when it gets
opened for "append", in which case all new data comes at the end of the existing data.
- for random-access writing, all pre-existing data remains where ever you don't
write new data; and you could truncate at will.
I am pretty sure both good old C file system, and .NET File class, behave as explained
above, so I suggest you revisit your observations.
|
|
|
|
|
Please post the relevant code.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
I am actually using Hans Dietrich's XListCtrl, but the question I have is general CListCtrl.
When I press the mouse in my CListCtrl resource, I don't know exactly which message I should be trapping and handling the event for. There are like HUNDRES of LVM_, LVN_, NM_, ...) messages.
I want to trap the message, do my operation, and then pass the normal message-handling onto the associated message in XListCtrl class.
I just want to trap a Left-Mouse Click, check the row/col (iItem, iSubItem), get which row was clicked, and then pass along to XListCtrl operation....
Thanks,
John John
|
|
|
|
|
john john mackey wrote: I just want to trap a Left-Mouse Click
You mean like NM_CLICK ?
led mike
|
|
|
|
|
If that be the one (obvious), then I will give it a try.
Thanks.
John John
|
|
|
|
|
Im writing a function that draws a titleblock in the bottom corner of the page and have it all drawn and still need to place a bitmap in the titleblock. Is there a simple way to do this, all my searches have come up with really complicated explanations.
|
|
|
|
|
Are you drawing a bitmap on a bitmap or drawing a bitmap to a window?
Are the bitmaps DDBs or DIBs (or something else)?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Drawing on a window page, similar to a visio page. Im just wanting to take a logo, either jpeg,bmp or some other picture file and be able to insert it into the title block I drew.
|
|
|
|
|
I suppose the easiest way is using GDI+
#include <gdiplus.h>
#pragma comment(lib, "gdiplus.lib" )
...
ULONG dwToken;
Gdiplus::GdiplusStartupInput input;
Gdiplus::GdiplusStartupOutput output;
Gdiplus::Status status = Gdiplus::GdiplusStartup(&dwToken, &input, &output);
if(status == Gdiplus::Ok)
{
Gdiplus::Bitmap SrcBitmap(L"c:\\my.jpg", FALSE);
Graphics DestGraphics(hwndWindowToDrawOn);
DestGraphics.DrawImage(&SrcBitmap, 0, 0);
Gdiplus::GdiplusShutdown(dwToken);
}
Note that if you use gdi+, all that initialization code only needs to be done once at application
startup and shutdown, so it really only takes 3 lines of code to load and render a bitmap.
Mark
|
|
|
|
|
Also, if you don't want to mess with GDI+ code directly yourself, there's
a handy ATL wrapper class CImage:
#include <atlimage.h>
...
CImage SrcBitmap;
SrcBitmap.Load(_T("e:\\test.jpg"));
SrcBitmap.Draw(hdc, 0, 0);
|
|
|
|
|
Using Visual C++ MFC in SDI application
I would like to read what other programs have displayed on my monitor screen. For example, if I have a webpage displayed by a browser, is there some way I can read from my C++ program what is shown on that browser's window?
Thanks ahead of time
|
|
|
|
|
You can use interfaces in MSHTML.h
Find the window handle of your browser. and then by using below interfaces you can get whole HTML of the web page which is open.
IHTMLDocument2
IHTMLWindow2
IHTMLElementCollection
IID_IHTMLDocument2
IHTMLElement
etc..
|
|
|
|
|
on my pc there is no file called MSHTML.h Where does not get this? I'm using Visual C++ 6.0. What do I need to upgrade to?
Thanks
Rahul Vaishnav wrote: You can use interfaces in MSHTML.h
Find the window handle of your browser. and then by using below interfaces you can get whole HTML of the web page which is open.
IHTMLDocument2
IHTMLWindow2
IHTMLElementCollection
IID_IHTMLDocument2
IHTMLElement
etc..
|
|
|
|
|