|
I think that you simply lost the * symbol before the array's counter.
HRESULT AllocateSomeBs([out] int *countB, [out, retval, size_is(, * countB)] B **bs);
With best wishes,
Vita
|
|
|
|
|
Hi all, this is kind of a tricky question, so let me give you some background on my app.
I have an SDI app with a view based on CListViewCtrl. The list is set to operate on "virtual mode", (via LVS_OWNERDATA style on creation), so it asks for it´s items text instead of storing them itself.
However, if i want it to work properly i MUST add this to the view´s parent(CMainFrame) message map:
CHAIN_MSG_MAP_MEMBER(m_view)
If i dont add this TO THE PARENT (CMainFrame), the view NEVER recives the LVN_GETDISPINFO notification!, this is because the view(wich is a superclassed listview) by default, like most common controls, sends its notifications to its parent, (CMainframe in this case).
So the question is: is there a more "proper" way of reflecting the notification messages back to the view? or is there a way to specify that the control (listview) will handle it´s messages itself? (ibe tried setting the WS_EX_NOPARENTNOTIFY style but it wont work).
Thanks!
|
|
|
|
|
The Proper Way is to reflect the notifications, not chain them. In the frame's msg map:
BEGIN_MSG_MAP(CMainFrame)
....
REFLECT_NOTIFICATIONS()
END_MSG_MAP() That makes any unhandled WM_COMMAND and WM_NOTIFY messages get sent back to the control that generated the message. Then in the list ctrl class, add two entries:
BEGIN_MSG_MAP(CYourListView)
....
REFLECTED_NOTIFY_CODE_HANLDER(LVN_GETDISPINFO, OnGetDispInfo)
DEFAULT_REFLECTION_HANDLER()
END_MSG_MAP() DEFAULT_REFLECTION_HANDLER() should go at the end, and makes sure that unhandled reflected messages get sent on to DefWindowProc() . There is also a REFLECTED_NOTIFY_CODE_HANLDER_EX() macro if you are using the enhanced message map macros in atlcrack.h.
--Mike--
THERE IS NO THERE IS NO BUT THERE IS
MAGIC PIXIE DUST BUSINESS GENIE CODE PROJECT
Homepage | RightClick-Encrypt | 1ClickPicGrabber
"You have Erica on the brain" - Jon Sagara to me
|
|
|
|
|
Outstanding!, the more i learn about WTL, the more i love it!
Thanks Mike!
|
|
|
|
|
I need just to have an ie control window in my dialogbox.... something like the popup who appear when you login into messenger chat....
I have a simplest win32 console application, without MFC.
I maked CreateDialog, to open a dialog box window, from a dialog resource.
In that dialog i put an dll control of Microsoft Web Browser Object, from controls.
How to connect to that object and tell him Navigate2 ?
(with mfc is very simple is automatticaly link a m_spBrowser variable....)
Adrian Bacaianu
|
|
|
|
|
Intro:
I have a simple VB application that lives in the sys tray. It basically allows me to right click and select from a list of projects I am currently working on so that I accurately keep track of what time I spend on the job and what I spend reading CodeProject.
Problem:
Whne explorer.exe is reloaded (i.e. because IE/windows explorer hung and needed to be killed) The icon for my application does not get reloaded into the systray.
How can I solve this?
TIA
|
|
|
|
|
> have a simple VB application that lives in the sys tray.
What any of this have to do with WTL/ATL/STL....
[rant start]
VB is brain dead, defective framework, designed for masses, who can not spend couple of month learning something better.
[rant end]
Anyway you need to m_mTaskbarRestart = RegisterWindowMessage(_T("TaskbarCreated"));
and when you got it recreate your icon.
Two lines in C++, but I have no clue about VB.
Brian
|
|
|
|
|
i'm using the copy method of the basic_string<tchar>. i'm a little confused about the first parameter. could someone please post a simple example of copying from one basic_string<tchar> to another?
thanks
melinda
|
|
|
|
|
std::string str="hello heaven";
char buffer[1000];
str.copy(buffer,4);
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
would it work the same way if i were copying from one basic_string<TCHAR> to another basic_string<TCHAR>? in that case i'm not actually using the string.
melinda
|
|
|
|
|
Er, I do not understand completely your question. copy will work the same for basic_string<TCHAR> s, except that what it copies are TCHAR s instead of char s. copy does ont have anything to do with copying from one basic_string to another.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
thanks...i get it now
|
|
|
|
|
Hi all,
When I compile this very simple program I get some warnings... but I don't know why? Here is this program:
int i = 0;
std::vector<std::string> str_vect1;
std::vector<std::string> str_vect2;
std::vector<std::string>::iterator it1;
std::vector<std::string>::iterator it2;
str_vect1.resize(5);
for(it1 = str_vect1.begin(), i = 0; it1 != str_vect1.end(); it1++, i++)
{
cout << "str_vect1[" << i << "] = ";
cin >> *it1;
}
str_vect2.resize(str_vect1.size());
for(it1 = str_vect1.begin(), it2 = str_vect2.begin(); it1 != str_vect1.end(); it1++, it2++)
{
*it2 = *it1;
}
for(it2 = str_vect2.begin(), i = 0; it2 != str_vect2.end(); it2++, i++)
{
cout << "str_vect2[" << i << "] = " << *it2 << endl;;
}
I don't understand these warnings...
Compiling...
DebugApp.cpp
C:\KINDT\My Projects VC++\Chameleon Project\GENERIC SELDES DRIVER\DebugApp\DebugApp.cpp(87) : warning C4786: 'std::reverse_iterator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const *,std::basic_string<char,std::char_traits<
char>,std::allocator<char> >,std::basic_string<char,std::char_traits<char>,std::allocator<char> > const &,std::basic_string<char,std::char_traits<char>,std::allocator<char> > const *,int>' : identifier was truncated to '255' characters in the debug
information
C:\KINDT\My Projects VC++\Chameleon Project\GENERIC SELDES DRIVER\DebugApp\DebugApp.cpp(87) : warning C4786: 'std::reverse_iterator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > *,std::basic_string<char,std::char_traits<char>,
std::allocator<char> >,std::basic_string<char,std::char_traits<char>,std::allocator<char> > &,std::basic_string<char,std::char_traits<char>,std::allocator<char> > *,int>' : identifier was truncated to '255' characters in the debug information
c:\program files\microsoft visual studio\vc98\include\vector(39) : warning C4786: 'std::vector<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >
>::vector<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >' : identifier was truncated to '255' characters in the debug information
c:\program files\microsoft visual studio\vc98\include\vector(60) : warning C4786: 'std::vector<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >
>::~vector<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >' : identifier was truncated to '255' characters in the debug information
Linking...
DebugApp.exe - 0 error(s), 4 warning(s)
Thanks for all who can help me...
Hello World!!!
from Raphaël
|
|
|
|
|
Don't worry about it, it's a confirmed (and harmless) bug in MSVC++ 6.0. To get rid of it, insert the following line at the beginning of your .cpp :
#pragma warning(disable:4786) Regards,
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Thanks a lot for your reply...
Hello World!!!
from Raphaël
|
|
|
|
|
hi,
can any one tell how i can get the handle of each opened explorer window..& also the usage of get_opener
what i want to do is to block the user from clicking the new window command..if he clicks it i want that new window to close..pls help me..
|
|
|
|
|
Hi all,
I am wondering about using exception handling in ATL *without* the need to dinamically link to msvcrt.dll... can one do it ?
I can't use SEH due to C++ classes.
|
|
|
|
|
Sure, just link statically to the CRT (the MinDependency configs do this already when you remove the _ATL_MIN_CRT preprocessor symbol)
--Mike--
THERE IS NO THERE IS NO BUT THERE IS
MAGIC PIXIE DUST BUSINESS GENIE CODE PROJECT
Homepage | RightClick-Encrypt | 1ClickPicGrabber
"You have Erica on the brain" - Jon Sagara to me
|
|
|
|
|
Help !!
The size of my program doubles from 28 K to 56 K !
Is this the price to pay to use exception handling ???
|
|
|
|
|
This is the price to pay for using CRT.
|
|
|
|
|
So every ATL program that uses exception handling needs to link CRT...
Is this the price to pay for using exceptions ?
|
|
|
|
|
Hi,
Im developing a application in ATL..My problem is when I minimize the application,it should disappear from Taskbar and tray icon should be created..
No i dunno how to dissappear it from Task bar..So any idea....or ny links..
cheers,
Super
------------------------------------------
Too much of good is bad,mix some evil in it
|
|
|
|
|
|
In my application, i use UISetCheck to check buttons in my menu. But i can't get UISetRadio() to work. It doesn't do a thing. I used
UPDATE_ELEMENT(ID_TASKBAR_SIGNIN, UPDUI_MENUPOPUP)
to make WTL handle it but do i need to do something else with it to make it handle radio buttons too?
Thanks
|
|
|
|
|
UIUpdateMenuBarElement() doesn't support radio-checking menu items, although it is possible to add the code to do it. I did it for my own work a few weeks ago, when I get home I'll see if I can find the code (I didn't end up using it after all, so I might not have kept it)
--Mike--
THERE IS NO THERE IS NO BUT THERE IS
MAGIC PIXIE DUST BUSINESS GENIE CODE PROJECT
Homepage | RightClick-Encrypt | 1ClickPicGrabber
"You have Erica on the brain" - Jon Sagara to me
|
|
|
|
|