|
Yeap actually that was the case, I forgot to export the symbols. Thanks for the tip, I could have gone days without realizing it.
|
|
|
|
|
Hi,
I attach an image list to the CHeaderCtrl with a call to CHeaderCtrl::SetImageList.
Later I use CListCtrl::SetImageList to attach an image list to the CListCtrl object used for the items.
The 2 image lists are different. Every time I call CListCtrl::SetImageList my image list of the
header control gets overwritten with that of the list control.
Is this a bug ?? or is it impossible to maintain 2 different image lists.
Thx
|
|
|
|
|
|
I have installed an OnSetImageList message handler for the header control. THis one gets called when an image list is installed for the header control and it gets called a second time when the CListctrl object is assigned his image list. To install the image list of the header control I do the following call from within the OnCreate message handler of a derived CListCtrl Object (CXListCtrl) :
m_HdCtrl.SetImageList(&m_ilSymb);
m_HdCtrl has been subclassed to the Header control.
To install the image list of the CListCtrl object itself I do the following call in the OnCreate handler of a CXListCtrl derived class. (CPCntCtrl)
SetImageList(&m_ilCntSymb, LVSIL_SMALL);
Can someone tell me please what is going on here ?
Thx
|
|
|
|
|
I have a List control where sometimes I want to limit it to a single selection and other times to multiple selections.
You choose the Single Selection parameter at design time, but I'm sure there must be a way to change in on the fly. It is most like a SENDMESSAGE, but what is the message I need to send?
Thanks,
Ilan
|
|
|
|
|
hi ,
Try SetWindowLong Function .
Regards
FarPointer.
|
|
|
|
|
Hi Ilan,
the following will result in a single-selection list:
m_myList.ModifyStyle(0, LVS_SINGLESEL);
this one will result in a multi-selection list:
m_myList.ModifyStyle(LVS_SINGLESEL, 0);
first parameter removes the passed style, second parameter adds the passed style.
Regards, mykel
If they give you lined paper, write the other way!
|
|
|
|
|
Hi Mykel,
This is EXACTLY what I was looking for! It solves the problem.
Thank you very much,
Ilan
|
|
|
|
|
int main()
{
int *ptr[2];
if(ptr[0] = null)
{
cout<<"this is empty"<
|
|
|
|
|
it is related to compiler.
E.g.
int i; //or a pointer
the value of i may be initialized as zero by some compiler, but not all.
good habit is that you initialize them yourself.
u can change code as:
===========================
int main()
{
int *ptr[2];
//====== initialize all to null
int i,iNum=sizeof(ptr)/sizeof(ptr[0]);
for(i=0;i<iNum;i++) ptr[i]=0;
//====== end enitilization
if(ptr[0] = null)
{
cout<<"this is empty"<<endl;
}
<hr style="margin ; width:405; text-align: left;">A nice <b><a style="text-decoration: underline;" href="http://www.syncedit.com/software/hypercare/" target="_new">tool</a></b> for optimizing your Microsoft <font color="#ff0000">html-help</font> contents.
Includeh10
-- modified at 9:41 Sunday 15th January, 2006
|
|
|
|
|
In addition to previous comment also change:
if(ptr[0] = null)
to:
if(ptr[0] == null):->
Michel Wassink
We must make user friendly software. Where are friendly users?
|
|
|
|
|
1. In a debug compile, the ptr[] array will be initialized to zero's. In a release compile, it will be random data. As a rule, always initialize your data.
2. if (ptr[0] = NULL) does an assignment inside an if , which is not good practice.
int main()
{
int *ptr[2];
for (int i = 0; i < 2; i++) {
ptr[i] = NULL;
}
if (ptr[0] == NULL) {
cout << "this is empty" << endl;
}
}
Software Zen: delete this;
|
|
|
|
|
Try this :-
int* ptr[2]={0};
cout << ptr[0] << endl;
cout << ptr[1] << endl;
Regards,
Nish
|
|
|
|
|
if u can use the class
CPtrArray
it has a construtor
Vikas Amin
Embin Technology
Bombay
|
|
|
|
|
#include<iostream>
#include<string>
using namespace std;
int mian()
{
string input;
char *driver;
cout<<"please input the drivers name :";
cin>>input;
cin.ignore();
driver = new char[strlen(input)+1];
return 0;
}
how come this dont work?
i am just trying to find the strlenght of input pls help me find and solve this
|
|
|
|
|
why do not add
cout<<strlen(input);
to see="" its="" length?
=""
<hr="" style="margin ; width:405; text-align: left;">A nice tool for optimizing your Microsoft html-help contents.
Includeh10
|
|
|
|
|
Try :
string input;
char *driver;
cout << "Please input the driver's name : ";
cin >> input;
driver = new char[input.length() + 1];
strcpy(driver, input.c_str());
driver[input.length()] = 0;
cout << driver << endl;
Regards,
Nish
|
|
|
|
|
i tryed it and it works thanks and i understand it too
but i wanna know wht do i need this?
driver[input.length()] = 0;
y shld assigh to 0??
|
|
|
|
|
neodeaths wrote: i tryed it and it works thanks and i understand it too
but i wanna know wht do i need this?
driver[input.length()] = 0;
y shld assigh to 0??
C/C++ strings are considered to be 0-terminated. If you don't terminate your string with a 0, any function that expects a 0-terminated string would run into issues.
Regards,
Nish
|
|
|
|
|
Nishant Sivakumar wrote: C/C++ strings are considered to be 0-terminated. If you don't terminate your string with a 0, any function that expects a 0-terminated string would run into issues.
Yes, but strcpy also copies the teminating '\0'.
|
|
|
|
|
Roland Pibinger wrote: Yes, but strcpy also copies the teminating '\0'.
Yeah
What was I smoking, eh?
Thanks.
Regards,
Nish
|
|
|
|
|
neodeaths wrote:
driver = new char[strlen(input)+1];
You probably don't need this line of code since you can access the driver name as const char* with input.c_str() .
-- modified at 11:38 Sunday 15th January, 2006
|
|
|
|
|
I am interested in doing a bit of DirectX coding. I don’t have to do anything cutting edge and to simplify distribution I would like to code against DirectX 8.1. Do I specifically need to develop against the 8.1 SDK?
Or is it all COM and as long as I stick to 8.1 functionality I can develop against the 9 SDK and run on 8.1?
Cheers
Rich
|
|
|
|
|
The purpose of the COM implementation of DirectX is for the runtime to be able to support applications written with previous versions of DirectX than the currently installed version of the runtime.
When you install the DirectX SDK, you must develop with its functionality. The previous interfaces are not included in the development version. The D3DX support library must be used with its new function formats and interfaces as well.
For example, I had to update an application written with a previous version of DX 9.0, when I was using the June 2005 SDK. The implementation of starting and ending a shader pass had changed and would not compile with my version of the SDK.
|
|
|
|
|
I have macros LOG1 to LOG5 for logging that aid debugging in my application. However with increased logging my application is effectively getting slowed down, so much to the extent that that application now takes 100 times longer.
While it is very hard to reduce to the number of log messages, i suspected most of the time is spent on writing the log message to the disk. So I implemented a buffered logger that writes to the disk only if the log buffer crosses 1 Mb. Although this has helped, for some reason I am not able to identify, the app is still slower than i am expecting.
Would it help if I offload the disk writing work to another "process" by sending the log messages to that process through a pipe or socket? I am interested in knowning people's experience, and if this will help I would like to know if it is worth implementing.
thanks!
|
|
|
|