|
I have referred to following article for my purpose.
http://www.codeproject.com/KB/miscctrl/hyperlink.aspx[^]
If you will have look at it then you can easily understand my problem. In this example there is one dialog named "HyperLink Sample". On this dialog there is static text named "mail me" and Ok button is there.
This static text is associated with CHyperLink class.
I want same functionality but just want to destroy "HyperLink Sample" dialog when someone clicks on it as well as it should work as HyperLink.
|
|
|
|
|
Hi,
I have a ListView control with Report style with 4 colomn. I want to show tooltip for different row as mouse moves over there. How can I do this?
|
|
|
|
|
Have a look at MSDN magazine June 2001, and the article by Paul DiLascia. He presented a friendly tooltip, which you can integrate and give text to, depending on the position of the mouse.
I use it in a window class I wrote to present the X,Y and value of various parts of the window.
Iain.
ps, You wouldn't also be called George George, would you?
Plz sir... CPallini CPallini abuz drugz, plz plz help urgent.
|
|
|
|
|
Could you give the link please?
|
|
|
|
|
Nope! Far too much like hard work for me to do, when it's you who needs the answer.
goooooooooogle.
(I think www.msdnmag.com is rerouted to the appropriate place)
Plz sir... CPallini CPallini abuz drugz, plz plz help urgent.
|
|
|
|
|
|
I've created function as follows
template <class t="">
void BubbleSort(int nArraySize)
{
T* pArray = new T[nArraySize];
int nIdx;
cout<<"Enter the items to be sorted"<<endl;
for ( nIdx = 0;nIdx < nArraySize;nIdx++)
{
cin>>pArray[nIdx];
}
....
}
</class>
and called this function as follows
int main()
{
int x;
cin >> x;
switch( x )
{
case 1:
BubbleSort<float>( 3 );
break;
case 2:
BubbleSort<int> ( 3 );
default:
break;
}
}</int></float>
This code works fine with Visual C++ 2008 and Dev C++ compiler.
cin>>Array[nIdx]; breaks when I compile and execute the code using Visual C++ 6.0
Is there any work around for this problem? or something missing with my usage?
-Sarath.
"Great hopes make everything great possible" - Benjamin Franklin
|
|
|
|
|
I can guess what you mean by this:
Sarath. wrote: template
void BubbleSort(int nArraySize)
but it would be nice if you took a little care to ensure your post is readable in its entirety.
Also, did you forget break here?
Sarath. wrote: case 2:
BubbleSort ( 3 );
default:
Sarath. wrote: cin>>Array[nIdx]; breaks when I compile and execute the code using Visual C++ 6.0
What do you mean by "breaks"? Does it compile? If not what's the error message? If it compiles in what way is it not working as you expect?
Steve
|
|
|
|
|
I'm really sorry for not formatting the code well.
Ok let me talk more about this issue
Let's take simple sample
template <class T>
void Foo(int nArraySize)
{
T* pArray = new T[nArraySize];
int nIdx;
cout<<"Enter the items"<<endl;
for ( nIdx = 0;nIdx < nArraySize;nIdx++)
{
cin>>pArray[nIdx];
}
cout<"The array contains"<<endl;
for ( nIdx = 0; nIdx < nArraySize;nIdx++)
{
cout<<pArray[nIdx]<<endl;
}
}
int main()
{
int x;
cin >> x;
switch( x )
{
case 1:
Foo<float >( 3 );
break;
case 2:
Foo<int> ( 3 );
break;
default:
break;
}
} ;
The program exits prematurely when we try to enter with float option
Foo<flo> has been executed
The output was as follows
1
Enter the items
2.3
The array contains
2
-842150451
-842150451
Just after entering the first value, the execution has break from the for loop. (the behavior we see when we try to read an int and entering invalid characters. I dont know the exact word for that).
In my understanding, cin deducing the type of data as the last type used to invoke this function. in this case Foo<int>()
For further analysis, I tried to analyze using char as template type
case 3:
Foo<char> ( 3 );
break;
and I executed float option (not the char version of template function)
the output was as follows
1<br />
Enter the items<br />
123.23<br />
The array contains<br />
1<br />
2<br />
3
The above are the ouput of VC6. (note that the for loop was not completely executed in this case. it has exited after entering the first element
Is it clear now?
-Sarath.
"Great hopes make everything great possible" - Benjamin Franklin
|
|
|
|
|
VC6 compiler is notorious for not being C++ standards complient. If you see it call _Myt& operator>>(int& _X) version instead of _Myt& operator>>(double& _X) version of function.
Which Microsoft fixed in later verions of compiler.
|
|
|
|
|
The following call stack shows what's going on:
std::basic_istream<char,std::char_traits<char> >::operator>>(int & 0xcdcdcdcd) line 103
Foo(int 0x00000003) line 17
main() line 34 + 7 bytes
mainCRTStartup() line 206 + 25 bytes
KERNEL32! 7c816fd7()
As you can see operator>>(int& _X) is being called instead of correct operator for a double . This results in the stream going "bad" when it encounters the period. The program works as expected in VS2008 but not in MSVC6.
Steve
|
|
|
|
|
I am trying to convert an int to string and get an error.
I have the following...
string str="1";
int val;
val=atoi(str.c_str());
val++;
itoa(val,str,10);
On doing this I get the following error. Were could I have gone wrong?
error C2664: 'itoa' : cannot convert parameter 2 from 'class std::basic_string<char,struct std::char_traits<char="">,class std::allocator<char> >' to 'char *'
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
</char></char,struct>
THANKS.
|
|
|
|
|
string str="1";
int val;
val=atoi(str.c_str());
val++;
itoa(val,(char*)str.c_str(),10);
The code would serve your purpose but not be the optimized way of doing this.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
_AnShUmAn_ wrote: (char*)str.c_str(
This is a bad idea. The return type is const char * and casting away the const is wrong and the compiler is correct in complaining.
Steve
|
|
|
|
|
|
string s= "1";
strstream str;
int n;
str << s;
str >> n;
n++;
str.clear();
str << n << '\0';
s = str.str();
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
|
|
|
|
|
Hi Friends,
Could any one tell me how to paint in CMDIFrameWnd.
I want to the change the color of the Frame Window.
Thanks and Regards.
SANTHOSH V
|
|
|
|
|
Click Here ->[^]
Yes U Can ...If U Can ,Dream it , U can do it ...ICAN
|
|
|
|
|
Hi,
I am working on an application in which I am using MSFlexGrid.
I have 100 rows and 8 cols.
I am initializing all cells with some strings.
So when the user edits and saves, again when he retrives from the file, iam populating all cells with the saved strings like,
for(int i=0;i<100;i++)
{
for(int j=0;j<8;j++)
m_Grid.SetTextMatrix(i,j,s); //S is string which is read from file
}
It works fine in debug mode, but in release mode its giving an error like
"Subscript out of range".
Please if u have any idea help me.
Sunil.
Regards,
Sunil Kumar
|
|
|
|
|
i used the flex grid in release mode also. but i didnt face this sort of problem.
try to debug your application and see where exactly, you are getting this error.
other wise, you mail me your code then i can help you.
good luck.
|
|
|
|
|
hello chandu,
Thanks for the reply.
I solved the problem.Its not the problem with flexgrid.
The string was going out of bound.
One more thing, the compilation is taking some time if I include FlexGrid.
Is there any option to reduce it.
Regards,
Sunil Kumar
|
|
|
|
|
how much time does it take?
i mean, is there any difference between debug mode and release mode?
--------------------------------------------
Suggestion to the members:
Please prefix your main thread subject with [SOLVED] if it is solved.
thanks.
chandu.
|
|
|
|
|
Yeah, the difference is about 1.5 to 2 mins.
Regards,
Sunil Kumar
|
|
|
|
|
in this regard, i donot have any other clue except the following.
1.write one more application without grid and then with grid and see the difference.
2.try to compile your application in another system.
3.only thing you have to do is to localise weather the problem is with the code or grid or the system.
BTW, what is the size of your RC file is it normal or abnormal. just verify!
good luck.
--------------------------------------------
Suggestion to the members:
Please prefix your main thread subject with [SOLVED] if it is solved.
thanks.
chandu.
|
|
|
|
|
I have created a process using CreateProcess API.
i want to suspend/resume the process.
Thanx n advance.
|
|
|
|