|
Thanks for the replies.
Do you mean to say that, i need to change the design if at all i want to work well for standard user.
If that is the case, what is the better solution.
I got a solution for replacing the registry stuff with My.Settings (http://msdn.microsoft.com/en-us/library/ms379611(VS.80).aspx[^]). But this is related to VB.
Do we have any such things available in VC++.
Thanks again.
Appu..
"Never explain yourself to anyone.
Because the person who likes you does n't need it.
And the person who dislikes you won't believe it."
|
|
|
|
|
NiceNaiduo you mean to say that, i need to change the design if at all i want to work well for standard user.
Yes that's exactly the idea.
-Saurabh
|
|
|
|
|
Hi,
I was in need of MD5 hashing to one of project, and found the URL http://www.md5hashing.com/ useful. Downloaded the C++ files and included the same to the project and able to hash strings.
But the problem I am facing here is, it works fine with 32 bit machines but it fails in 64 bit machines/OS. So please let me know how to resolve this problem. Is there any other set of code available which works for bit 32 bit and 64 bit?
Thanks,
Nandu.
|
|
|
|
|
|
Hello guru developers,
I have a project which i have to use a lot of memory allocation, the project works fine except when there are a lot of data the process is killed by Linux, i don't know why? For example this example: it should exit when there is no free memory, but it is killed after some time when i run this program,
Does anyone has any idea how to solve this problem in Linux?
thanks in advance
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <string>
#include <list>
#include <time.h>
using namespace std;
struct tree_node
{
list<tree_node*> leaf;
char data;
short IsEndPoint;
};
int main()
{
try
{
for (int i = 0 ; i < 9999000; i++ )
{
tree_node* t = new tree_node[1000];
printf("id: %d \r ", i);
}
}
catch(...)
{
cout<<"test"<< endl;
exit(0);
}
cin.get();
return 0;
}</time.h></list></string></iostream></stdlib.h></stdio.h>
It is never late to learn
|
|
|
|
|
I never programmed with gcc in linux so I might be wrong. I am guess that new operator does not throw an exception but terminated the program when cannot allocate memory.
-Saurabh
|
|
|
|
|
how could you catch exception memory is full? is there any way in c++ for windows? not for linux, it must be same in linux
It is never late to learn
|
|
|
|
|
Well you already have the code to catch the exception...using a catch block. When new operator cannot allocate memory then it throws std::bad_alloc exception. Also the value of returned pointer is NULL.
-Saurabh
|
|
|
|
|
Thanks for reply,
I run this code under Visual c++ 2005, it does not throw any exception, it crashes computer, do u know why it crashes computer?
Thanks
It is never late to learn
|
|
|
|
|
If my calculation is correct then you are requesting about 260.74GB of memory!!! Which of course cannot be allocated. I don't think that your program should crash, instead you should get nice error from windows stating Windows is running low on memory so termination your program.
Just out of curiosity what are you trying to do?
-Saurabh
|
|
|
|
|
I took such a large memory on purpose to test bad allocation exception, i figure out how to do that,here is my final code,
this works,
# include <iostream.h>
# include <ostream.h>
# include <new.h>
#include <list>
struct tree_node
{
std::list<tree_node*> leaf;
char data;
short IsEndPoint;
};
void MyHandler()
{
std::cout << "MyHandler Called... " << std::endl;
throw std::bad_alloc();
}
int main()
{
std::set_new_handler( MyHandler );
char* ch;
try
{
for( unsigned long Idx( 0 ); Idx < 0xffffffff; ++Idx )
{
new tree_node[10000];
printf("id: %d \r",Idx);
}
}
catch( const std::bad_alloc& e )
{
std::cout << e.what() << std::endl;
}
std::cin.get();
return 0;
}
</list></new.h></ostream.h></iostream.h>
It is never late to learn
|
|
|
|
|
Im using Formview and Ima minimizing the window when i click the f4 button ,Its also mininizing and i need to now maximize my window when i click from the taskbar?.
Can you pls help me.....
|
|
|
|
|
Hi all. I have a question about socket. Hope everybody helping me ^^
In socket, I have a simple Server Chat and Client Chat. When a socket in server side accept an connect from Client. And Client side connect to server. Then the socket of both server and client action the Send() command. Is it right ? If it is right, how can I ignore the message I received at that time ?
Thanks
|
|
|
|
|
What are you talking about?
Ignore WHAT message? And what do you mean by "message"?
|
|
|
|
|
I'm using above mentioned ctrl in my dialog, it is as simple as possible, I populate only one column. My problem is that when I click header to trigger sorting action nothing happens (sort arrow is drawn correctly)?
In property's panel Sort is set to none!
Any help!
Thanks in advance!
|
|
|
|
|
josip cagalj wrote: My problem is that when I click header to trigger sorting action nothing happens
josip cagalj wrote: In property's panel Sort is set to none!
It seems a coherent behaviour.
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
[My articles]
|
|
|
|
|
"In property's panel Sort is set to none!"
It seams it doesn't matter how I set it (None/Ascending/Descending)it's only for starter, my main concern is that sort do not work when I click my mouse over the header control!?
|
|
|
|
|
From the List View docs:
Unless the LVS_NOCOLUMNHEADER window style is specified, column headers appear in report view. The user can click a column header, causing an LVN_COLUMNCLICK notification message to be sent to the parent window. Typically, the parent window sorts the list-view control by the specified column when this clicking occurs. The user can also drag the column guides between the headers to size the columns.
So, are you handling the LVN_COLUMNCLICK notification? If not, nothing very much will happen.
(If it's any consolation, I expected to find some sort of LVN_ISONETHINGBIGGERTHANANOTHER notification, but there you go...)
Iain.
Plz sir... CPallini CPallini abuz drugz, plz plz help urgent.
|
|
|
|
|
can you tell me how to sort mutilple col to mail:dfza@sina.com thanks!!!
|
|
|
|
|
1/ No, because if I do email you amazingly great advice, noone else would see it and benefit.
2/ If I reply to you here with also amazing advice, noone would see it.
3/ I'm kinda busy today. Others may be able to help you better.
4/ I've never actually sorted a list control. When I have used the things, I want to control the order of presentation. My previous answer was an example of "here's the documentation. It prehaps has useful information..."
The advice I *will* give you is to post a new question on this forum, after reading the "how to post" post at the top of the forum. Then you will get an email notification of any replies, and others can benefit too. You do want others to benefit, don't you?
The only thought I can think of is that you need to know how to sort on one column first before trying multiple columns.
Iain.
|
|
|
|
|
I tried to construct a Bitmap object using a gif file.
And use Graphics::DrawImage to draw it in the size other then the original one.
It displays a black box.
Doesn't GDI+ support this?
If not, does CImage support this?
The 3rd party support will be the last resort.
Thanks.
system
modified on Monday, July 7, 2008 5:03 AM
|
|
|
|
|
Have you tried drawing it normally (without scaling) to make sure you have it loaded and are trying to draw it correctly?
Peace!
-=- James Please rate this message - let me know if I helped or not!<hr></hr> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
It's ok without scaling.
system
|
|
|
|
|
Then I have no idea... Graphics::DrawImage(...) is supposed to support scaling all by itself, so if you constructed the Graphics object using the Image object that contains the loaded GIF, it should work...
Peace!
-=- James Please rate this message - let me know if I helped or not!<hr></hr> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
CPropWnd is derived from CDockablePane , and CNavWnd is derived from CWnd .
Here is the handler for the "show navigator button":
void CPropWnd::OnShowNavigatorWnd()
{
CNavWnd *pNav = new CNavWnd(this);
CRect rc;
rc.SetEmptyRect();
if (!pNav->Create(NULL, NULL, WS_VISIBLE | WS_OVERLAPPEDWINDOW, rc, this, UINT(-1)))
{
ASSERT(FALSE);
}
GetWindowRect(&rc);
pNav->SetWindowPos(NULL, rc.right + 5, rc.top, -1, -1,
SWP_NOSIZE | SWP_NOZORDER | SWP_SHOWWINDOW);
pNav->UpdateWindow();
}
Why the navigaotr windows can't be shown?
system
|
|
|
|