|
Actually, the order is like this:
1. The active view gets the first shot at processing the message
2. Then the document associated with the view gets it's chance
3. The document template is next.
4. The mainframe get's its chance now.
5. Finally, the application object gets it's chance.
6. If noone handled this message it goes to ::DefWndProc( );
This applies to WM_COMMAND and WM_NOTIFY messages.
|
|
|
|
|
Ooops - you're right! Thanks!
/ravi
Let's put "civil" back into "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Hello,
I need to implement database access in my application. MS SQL server will be used. What are your reccomanadtions about technology to use: ODBC, OLEDB, ADO?? What something else MS Platform provide?
I thinked about ADO, but frankly I preffer to avoid the COM stuff in my app.
But, I think OLEDB is also a COM thing, is it true?
And if I shall use ODBC, I should need a long development time?
Please send me your advice.
Thanks,
MN
|
|
|
|
|
Ok Don,
Since your looking for answers. Can you handle the truth?
I finally decided to go with ADO for a recent project. I'm pretty new to database stuff in C++ and wanted to go with one of the technologies that should be around for at least another month or two. Our company already had an out of date ODBC library that I hated and DAO is simply going the way of the birds. One big reason for going with ADO was Carlos Antollini's fine ADO libraries or articles on this site. It is a great starting place and the class structures work well with my application. ADO just seemed like the right strategy for my work. Take a look at Carlo's articles and see if it is right for your project.
|
|
|
|
|
Robert Vista wrote:
Take a look at Carlo's articles and see if it is right for your project.
Thanks Robert, I forgoten to mention that large amount of free tutorials
could also be a factor in decision.
Robert Vista wrote:
out of date ODBC library
what do you mean? I thinked at backward compatibility, and so on, I think
ODBC will be supported long time from now by Windows, and will evolve also...
And another thing: which of the layer support transactions better??
Thanks.
|
|
|
|
|
I have a simple yes or no question: is the Calendar Control broken(hence all the wrapper controls)
And what I mean by that is that you cannot control the fact that it changes months when the grayed out numbers are clicked
More importantly when you select multiple days that painting is horrible.
Is there any 'know' bugs?
|
|
|
|
|
My application (Win32, no MFC) has the following window structure:
dlgA (main window, CreateDialog)
dlgB (data area, CreateDialog, owned by dlgA)
wndC (input window, CreateWindow, owned by dlgB)
wndD (another input window, CreateWindow, owned by wndC)
Now here's what happens:
I close wndD and the focus switches back to wndC (as expected)
I close wndC and the focus switches to the desktop (unexpected)
If I give wndD the WS_CHILD style dlgB gets the focus after closing wndC, but I want it to have the WS_POPUP style instead, because it is a popup generated by wndC should be drawn outside of its client area (as it can be considerably larger than wndC).
If I close wndC without ever opening wndD (which is created only when I click a certain button in wndC), it also works correctly.
Any idea what this can be? It's driving me crazy.
|
|
|
|
|
Hello,
I looked for sample code on the web and msdn to see how to use this to make buttons show up dynamically. I'm not sure how to use this function. CAn someone give me a sample of how to use this?
I tried:
void CMainFrame::OnAddbutton()
{
TBBUTTON tbButton[2];
tbButton[1].fsStyle = TBSTYLE_BUTTON;
m_wndToolBar.GetToolBarCtrl().AddButtons(2,tbButton);
}
but I'm sure I'm missing something.
Thanks you,
ns
|
|
|
|
|
Try this:
CToolBarCtrl* pBar = &(m_wndToolBar.GetToolBarCtrl());
tbbuttonStruct.iBitmap = pBar->AddBitmap(1, pBitmapNew);
/* pBitmapNew is a pointer on a dynamically allocated CBitmap,
containing the button image, it should be freed at the end of the program */
tbbuttonStruct.idCommand = ID_MY_COMMAND;
/* user define */
tbbuttonStruct.dwData = 0 /*Image Index*/;
tbbuttonStruct.fsState = TBSTATE_ENABLED;
pBar->AddButtons(1, &tbbuttonStruct);
HTH,
K.
We do not inherit the Earth from our ancestors. We borrow it from our children.
Antoine de Saint Exupéry (1900-1944)
|
|
|
|
|
I want to display the thumbnails of images in some folder, using VC++. I tried using the IExtractImage interface, provided by the shell (supposedly!)
I get a compile-time error about the interface not being found. I use Windows2000, so I believe it's not a problem with the shell version. I could not find IExtractImage in shlobj.h.
Is there any way for getting the thumbnails?
Thanks.
Logic is a systematic method of coming to the wrong conclusion with
confidence.
|
|
|
|
|
Please click and go the following link for your reference. Good luck!
http://netez.com/2xExplorer/shellFAQ/bas_infos.html
Golden Lee
|
|
|
|
|
It's this site which I have been referring to. I tried out the sample code given therein, and am getting the compile-time error about IExtractImage interface.
http://netez.com/2xExplorer/shellFAQ/bas_infos.html
-Karthika
Logic is a systematic method of coming to the wrong conclusion with
confidence.
|
|
|
|
|
If I remember well, you should install first the Core SDK to use IExtractImage interface.
HTH,
K.
We do not inherit the Earth from our ancestors. We borrow it from our children.
Antoine de Saint Exupéry (1900-1944)
|
|
|
|
|
For adding a propertypage in a propertysheet in use the fonction AddPage.
But I need to specify the index where the page will be added.
I cannot use RemovePage to remove all page and add all pages after that.
Is possible or not?
|
|
|
|
|
Hi,
i have a app running a listview (in icon view only) and I desperately need to make the texts under the icons blue, underlined and clickable (single-click)... any Ideas? I tried SetBkColor to affect the text's background, not worked, I tried setting a new brush for the dc, also no good. OWNERDRAW style would be probably useless as MSDN says it is supported in report view only. ANY hints?? Thanks
|
|
|
|
|
You would probably have to recode the way ListCtrl items are drawn, through a derived class, to have exactly what you want. For a list view, have a look to the NM_CUSTOMDRAW notification. You may find some articles on his site about it.
HTH,
K.
We do not inherit the Earth from our ancestors. We borrow it from our children.
Antoine de Saint Exupéry (1900-1944)
|
|
|
|
|
Okay, so now I know how to change the drawing.... I don't presume there are chances it is possible to use the text as some kind of anchor, but... is it? I need it to react to a single click (not double) on the text (simply to make the application to handle a click to the icon itself (in icon view mode) handlin a click commonly and to handle the click on the text using some ie. pre-set function... thanks. (my only cue is the HOTTRACK capatibility, but that seems to be too "spread" so that a lot of bug would be involved (handling the mouse separately and checking for the hottrack and keydown and calculating where the item was clicked (btw. that may be important: I always know the size of the item... i can rely on that) thanks
|
|
|
|
|
CaesarCZ wrote:
I don't presume there are chances it is possible to use the text as some kind of anchor, but... is it?
Yes, it is, but you will have to manage everything in your derived ListView. By catching the message WM_MOUSEMOVE you may know over which item your mouse cursor is, and react accordingly (for example by drawing the item text differently).
If you want to know if the user has clicked over your ListView, you may catch the notification from the embedded ListCtrl object of NM_CLICK...
Have a look to the articles section of this site (www.codeproject.com/listctrl/), you will find a lot of information here.
You know, it's Visual C++, not VB, you may do everything you want
HTH,
K.
We do not inherit the Earth from our ancestors. We borrow it from our children.
Antoine de Saint Exupéry (1900-1944)
|
|
|
|
|
thanks... I'll have a look... so the main problem is to catch and handle the related messages. Btw. I have to (yeah, I have to, it wasn't my choice) do it under WinAPI. Anway, I took a quick view over the articles (all headlines, some articles) and there are 10 to 20 about changing colors, but none about handling input... how could I get the item's positions at least (just a keyword suffits)
I never programed under VB either )) but I completly agree
|
|
|
|
|
Using the MFC you could use the CListCtrl::GetItemRect method.
This method is defined as
BOOL CListCtrl::GetItemRect(int nItem, LPRECT lpRect, UINT nCode) const
{
ASSERT(::IsWindow(m_hWnd));
lpRect->left = nCode;
return (BOOL) ::SendMessage(m_hWnd, LVM_GETITEMRECT, (WPARAM)nItem,
(LPARAM)lpRect);
}
HTH,
K.
We do not inherit the Earth from our ancestors. We borrow it from our children.
Antoine de Saint Exupéry (1900-1944)
|
|
|
|
|
Can you help me or give me a sample about to hide or disable Microsoft Excel's menu titles,toolsbars,statusbars in visual c++?
:confused
|
|
|
|
|
The application will be based around a data store, probably using MSDE/Access. This is instead of writing my own serialisation code, also provides me with a little flexibility when querying data out of it also.
There will be a main client app (probably written in VC++) as well as other add-ins for MS Office applications. Both of which need to communicate with the DB -- i.e. add-ins add to the DB, the VC++ client reads back from it, as well as adding data into it.
What's the best way of communicating with the data through a single channel, I'd rather not have the data access in both add-ins and client in case it changes at any point, requiring users to update too many things etc.
I've not touched COM with VC++ yet (far too scary from what I've seen) and wasn't sure whether this would be the best way to do it. Are there any suggestions about the best way of doing it?
I had considered writing it using .NET and C#/C++. Thus allowing me to use assemblies registered in the GAC for data access. I had thought about using C# to develop the Office add-ins and C++ for the main client.
I'd really appreciate people's thought on the matter. I'd be quite happy to try and develop it all in VC++ using MFC/ATL for the various parts, provided people can encourage me enough to put myself into so much mental fog
Thanks as always,
Paul
|
|
|
|
|
The best way would be COM as it offers the most flexibility. You can access the object from VB, C++, Office macros, etc. Using COM any updates would be very easy - just push out the new object.
COM is not that hard, just get a good book and use the ATL. Goodluck
bibamus, edamus, cras moriemur [eat, drink, for tomorrow we die]
|
|
|
|
|
Ok, I'm willing to go with it
Suggestions as to a good ATL book then please. Seeing as I'm using ATL to produce the objects, do I need a great understanding of COM too (I've got the basics)? If so, recommendations for that too please.
Thanks again,
Paul
|
|
|
|
|
If I have two UDP sockets bound in the following manner:
1. INADDR_ANY, port number 0 (all ports?)
2. 10.3.2.1, port number 0 (all ports again)
A. Send a message using socket 2. The source port picked by Windows is 1350 (as an example).
B. Reply comes back to destination port 1350, IP = 10.3.2.1.
Where should this message be rcvd? If a thread is looping doing a rcvfrom on socket 1, it never sees this reply.
I never do a rcvfrom on socket 2, but I am guessing that I would see the reply if I did.
I'm wondering why the first socket cannot rcv this message? I am not an experienced sockets programmer at all, and I am hoping this is a simple issue.
Thanks,
David
|
|
|
|