|
Did you use of breakpoints and debugger for see error?
|
|
|
|
|
Most probably will be a failure with your destructor. The controls need a handler to the parent window. and when you close, and the destructor o the window try to call the destructor of the control. The control has no owner and he asserts.
Is the same as if u want to load some strings in the CComboBox inside the constructor of the dialog, you will have the same assertion. You have to load the datas in OnInitDialog or OnInitialUpdate, insteads of in the constructor.
With the CString you dont have any problem because they are not having such issues.
Take a look where you use the CComboBox and try debugging step by step to find out the secuence o opening/ closing a dialog. I did that using all the messages in relation with creating/destroying a Dialog and just putting an AfxMessageBox with the name of the message calling it and some text inside
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
mosali satish wrote: i have developed a GUI in which i have used static LED which is provided by Digistatic .h.
I did this once here.
mosali satish wrote: when iam closing the application assertion failed message...
What line of what file is asserting?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi all,
right now i am working on a project in which i am using inhouse list component which is using MFC Scrollbar . problem is that when that List is filled with around 40000 records and when i am moving Tracker of and reach to the position "32768" (tracker value) it is getting reset to first position.
this is happening beacuse the in the core file "wincore.cpp" (which is actually handling this event) getting parameter wParam (which is UINT ptr) and from this parameter it is actually retrieving Tracker value. wParam can contain max 2147483648 value.
when tracker reaches to 32768th row its holding 2147483653 , which is beyond range of integer.
Now can anyone tell me whats the solution if i have more than more than 32767 records in a single page , or is there any option in ScrollBar that can handle this situation ?
Thank You ,
Perry
|
|
|
|
|
Extract from http://msdn2.microsoft.com/en-us/library/z91cdf5a(VS.80).aspx[^]
The MFC Windows message handlers that indicate scroll bar position, CWnd::OnHScroll and CWnd::OnVScroll, provide only 16 bits of position data. GetScrollInfo and SetScrollInfo provide 32 bits of scroll bar position data. Thus, an application can call GetScrollInfo while processing either CWnd::OnHScroll or CWnd::OnVScroll to obtain 32-bit scroll bar position data.
|
|
|
|
|
Thank you Roger ..
Hope this will work ...
|
|
|
|
|
Hi,
In some of the singleton classes, I have seen that
People are keeping the destructor of singleton class in 'Public' Section of class.
Is it right to allow some one from outside to delete the singleton Object.
Thanks in advance,
Vinod.C.S
|
|
|
|
|
Vinod CS wrote: Is it right to allow some one from outside to delete the singleton Object.
how could you delete the object of Singleton class from outside, when it is not exposed to you. whole singleton concept is depend on static data!, fronm which you manage the lifetime of singleton class!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
I was taking abt implementing singleton clas in Threadsafe way using 'new':
mySingletonClass* mySingletonClass::GetInstance
{
if( 0 == m_pmySingletonObject )
{
m_pmySingletonObject = new mySingletonClass;
}
return pmySingletonObject;
}
Thnaks in advance,
Vinod.C.S
|
|
|
|
|
Vinod CS wrote: Threadsafe
then you might have to use syncronization object!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
By providing a public Destroy function that will delete the instance pointer. This way, you enforce a correct usage of the class.
As the pointer is deleted from within a member function, the destructor can be made private.
|
|
|
|
|
Cedric Moonen wrote: As the pointer is deleted from within a member function, the destructor can be made private.
Hi Cedric,
I doesn't understand what you want to say.. is there is any short coming in my comment!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
I don't know if that is the reason but there is a bug in the VC6 compiler: even if you provide a Destroy public method:
void CSingleton::Destroy()<br />
{<br />
if (m_pInstance)<br />
delete m_pInstance;<br />
}
You will have a compilation error saying that the destructor is public. So, to overcome this bug you have to make your destructor public.
I don't know if that is the reason but I encountered this problem before already.
|
|
|
|
|
Vinod CS wrote: People are keeping the destructor of singleton class in 'Public' Section of class.
When they do it is an error.
Normaly it is a static const object living in a global function.
Also, its c'tors and d'tors can be protected and construction made by a friend -factory class.
Or, the access is not on the whole class-interface, but only an Interface-pointer.
Though I speak with the tongues of men and of angels, and have not money, I am become as a sounding brass, or a tinkling cymbal. George Orwell, "Keep the Aspidistra Flying", Opening words
|
|
|
|
|
Hello,
I create a "MFC application" project in MSVC 2005.
But I want to add a class ref from tThread.
For example,
public ref class tThread
{
public:
XXXXXXXXXXXXX
};
I add this code in the Form1.h.
But it has a default class From1.
I create a new header file to include.
#include "mythread.h"
But it come some errors.
This is mythread.h
///////////////////////////
#ifndef MYTHREAD_H
#define MYTHREAD_H
public ref class tThread
{
public:
static void Threadsend();
}
#endif
/////////////////////////////
This is mythread.cpp
#include "mythread"
using namespace System::Threading;
static void Threadsend(){
Thread::Sleep( 0 );
}
What's wrong with my code or are there better method to do it?
Appreciate your reply.
Thank you.
Jane
|
|
|
|
|
Hi,
i never heared about a "ref class", but google lists some sites about it.
What do you like to do exactly?
Greetz
|
|
|
|
|
We have ref class and value class (on the CLI/C++) its better I write of MSDN
A ref class or ref struct can inherit from zero or more managed interfaces and zero or one ref types. A value class or value struct can only inherit from zero or more managed interfaces.
public ref class Items
{
private : int size;
....
};
public value class differ
{
private:
String^ str;
....
};
|
|
|
|
|
Hamid. wrote: We have ref class and value class (on the CLI/C++)
Seems as if you are in the wrong Forum...
Try your question in theManaged C++-Forum[^]
Though I speak with the tongues of men and of angels, and have not money, I am become as a sounding brass, or a tinkling cymbal. George Orwell, "Keep the Aspidistra Flying", Opening words
|
|
|
|
|
But I dont have any question.
|
|
|
|
|
There is no problem@@.
It works.
|
|
|
|
|
Hello,
I am confused about the type of vc++ .NET.
I want to use the string typed in the Textbox.
The property "Text" of Textbox has the type "string^".
I want to change it to char*.
I use the TextBox->Text->ToCharArray, but it is not char* type.
It is wchar_t type.
How could I convert the string^ type to char*?
Appreciate your reply.
Thank you.
Jane
|
|
|
|
|
|
|
Hamid. wrote: You asked on the wrong forum it was better you asked (Managed) C++/CLI[^].
i just going to do same.. you beat me this time!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
Do you want to learning C++.Net?
|
|
|
|