|
OK... kindly ignore my next solution... ha ha...
- NS -
|
|
|
|
|
Wow so your problem wasnt combobbox and your answer was MoveWindow
|
|
|
|
|
But the return value is the indication of success and again the count is correct as per your previous post... What kind of combobox is that? Can you check your code by doing as follows?
1. Add some items to combobox and through the resource editor
2. Comment out the dynamic item adding (CB_ADDSTRING) codes
3. Run the application and test it
- NS -
|
|
|
|
|
CB_ADDSTRING returns the index of the item added, or CB_ERR ( = -1) if an error occurs, CB_ERRSPACE if insufficient space available. You add 3 items of the same value, each time the return value is 0, this is totally consistent with a combobox that has the CBS_SORT style. Furthermore the CB_GETCOUNT return value is 3 indicating that 3 items were infact added. Also there is no indication in the documentation of CB_ADDSTRING that it calls SetLastError() when an error occurs.
|
|
|
|
|
U can add a string to a combo box using
CString string1;
m_combobox.AddString(String1);
here m_combobox is the member variable of the combo box.
Regards..
Saravana..
|
|
|
|
|
Provided you're usign MFC , my dear (the OP uses Win32 API )...
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.
|
|
|
|
|
Thnx but I am using WIN32 based Dialog Box.
|
|
|
|
|
Your code is working for me how did you make combobox can you show that code?
|
|
|
|
|
I extended my own ListCtrl class
CMyListCtrl: public CListCtrl
My wanted function: when I press 'CTRL + A', select all rows in the list control.
I implement the OnKeyDown(prarameters) method and map the ON_WM_KEYDOWN message.
But I don't know how to set the selected state of items, Anyone could help me?
|
|
|
|
|
Have a look at SetItemState method.
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.
|
|
|
|
|
Use SetItemState( -1, LVIS_SELECTED, LVIS_SELECTED );
- NS -
|
|
|
|
|
thx very much,
Actually I'm not sure about SetItemState, now I have your example.
|
|
|
|
|
Hi
In my program CRectTracker class is used to resize a window. How to control rectangle ( shadow rectangle draws while dragging mouse) while resizing the window. I use TrackRubberBand function.
thanks in advance
-RisKhan-
|
|
|
|
|
Hello everyone,
In MSDN for time function,
time_t time(
time_t *timer
);
http://msdn2.microsoft.com/en-us/library/1f4c8f33(VS.80).aspx
the return value of time is time_t, but in the Return Value section, it mentioned,
Return the time as seconds elapsed since midnight, January 1, 1970. There is no error return.
So, I am wondering whether time_t could be represented as elapsed number of seconds correctly and safely -- no data lost if we convert return value to unsigned long?
Like,
unsigned long second = time (NULL);
thanks in advance,
George
|
|
|
|
|
In time.h
typedef long time_t;
|
|
|
|
|
Thanks Roger,
Your answer is helpful!
regards,
George
|
|
|
|
|
Hello everyone,
I am wondering when function DllRegisterServer will be invoked? I am using Visual Studio 2005 to develop an in-process native (unmanaged) C++ COM. I am wondering when it will be invoked?
1. During the build process or during the DLL initialization process?
2. I find this function only works for debug mode, not release mode. Is that correct?
In MSDN,
http://msdn2.microsoft.com/en-us/library/ms682162.aspx
there are not too much information about when this method will be invoked and whether it works for both debug mode code and release mode code.
thanks in advance,
George
|
|
|
|
|
DllRegisterServer it's typically called when you need to register the COM component (for instance, by regsvr32 ). Note: usually Visual Studio registers the component as (if I remember well) a post build step.
George_George wrote: 2. I find this function only works for debug mode, not release mode. Is that correct?
No. The function must work also in release mode, otherwise you cannot deploy (the release mode) component.
Hope that helps.
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.
|
|
|
|
|
Thanks CPallini,
I do not explicitly call regsvr32 in build process. For the build process, I
simply use Visual Studio 2005 IDE to build.
I suspect regsvr32 invokes DllRegisterServer since I set the following
option to yes in debug configuration,
Linker --> General --> Register Output to yes
But I am not sure. Any comments?
regards,
George
|
|
|
|
|
George_George wrote: I do not explicitly call regsvr32 in build process. For the build process, I
simply use Visual Studio 2005 IDE to build.
I suspect regsvr32 invokes DllRegisterServer since I set the following
option to yes in debug configuration,
Linker --> General --> Register Output to yes
Custom build step is at
Project | Properties | Custom Build Step | Command Line.
Here you will find something like
regsvr32 /s/c "$(TargetPath)"<br />
echo regsvr32 exec. time > "$(OutDir)\regsvr32.trg"
Regards,
Paresh.
|
|
|
|
|
The OP was VS 2005 (quite similar indeed).
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.
|
|
|
|
|
Yes, CPallini! I should be somewhere else as you pointed out.
regards,
George
|
|
|
|
|
Thanks Paresh,
But there is nothing in Project | Properties | Custom Build Step | Command Line in my Visual Studio 2005. So I think there should be something else which runs regsvr32 to register the values in Windows Registry.
regards,
George
|
|
|
|
|
Your guess is exact, as Visual Studio documentation states:
Register Output
Run regsvr32.exe /s $(TargetPath), which is valid only on .dll projects. For .exe projects, this property is ignored. If you want to register an .exe output, set a postbuild event on the configuration to do the custom registration that is always required for registered .exe files.
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.
|
|
|
|
|
Cool, thanks!
regards,
George
|
|
|
|