|
Could you smell something??
Not exactly. I think you should ensure that it's a 'magic control' that causes the crash. What happens when you comment out the ShowUI call?
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
HI,
Thanks for your interest, I traced the problem for sometime. So this is the result I got from it.
Now, I dont override CWinApp::Run(). I moved all the UI initialization to InitInstance (). Now, the application gets initialized properly, but it crashes inside CMenu::DeleteTempMap().
Do you why this happend?
TIA
Regards
Srinidhi
|
|
|
|
|
hi all,
can anyone tell any command should be used for setting sampling rate for recording?
regards,
jim
|
|
|
|
|
I would like to know if someone could answer me to simple problem: We suppose that we create a class MyClass where there are methods(method1(), method2()...) where one have to use another method of MyClass. For example, suppose that method1 need of method2 in its implementation, how could i do that?
thanks in advance
gerald
|
|
|
|
|
I don't understand ? You want to call method1() from inside method2() ? What's the problem ? Just do it.
If you mean from another instance of the class, make the method static and you'll only have one instance of the method across all classes.
Christian
#include "std_disclaimer.h"
The careful application of terror is also a form of communication.
Eagles may soar, but weasels don't get sucked into jet engines.
|
|
|
|
|
Not sure what you are after, perhaps you are talking about 2 objects, & passing one object into the other & calling a method.
Please Expand.
Gerry.
|
|
|
|
|
Y'know, if you answered the guy who asked the question instead of me, he'd get an email alert that you were offering to help him. That would probably be a good thing.
Christian
#include "std_disclaimer.h"
The careful application of terror is also a form of communication.
Eagles may soar, but weasels don't get sucked into jet engines.
|
|
|
|
|
Sorry about that, clicked on the wrong button.
Gerry.
|
|
|
|
|
So could i do that:
double MyClass::method1()
{....}
double MyClass::method2()
{.
.
.
double m=method1();
.
}
gerald
|
|
|
|
|
Yes, you can do that....You need to decide if the methods are public or private!
Gerry.
|
|
|
|
|
|
Absolutely.
You could also go
return method1();
at the end of method2 if you wanted to. It's completely available to you.
Christian
#include "std_disclaimer.h"
The careful application of terror is also a form of communication.
Eagles may soar, but weasels don't get sucked into jet engines.
|
|
|
|
|
|
This Visual C++ is rather strange to me and I like to know about pointers... I´ve been working with Visual C++ only a two months and now this hole thing is just banging the head in the wall... So how these pointers are used? Meaning that where you construct the pointers and when you use them?
There were before a question, where somebody disclaim a working with directories etc. And there is pointer
pListoBox-> How you generate this kind of pointer in the code? Here is code which I copy / pasted earlier discussion (This code is written Carlos Antollini):
while(haveFile)
{
havefile = finder.FindNextfile();
if(finder.GetFileName().Find(".") == -1 && !finder.IsDirectory())
pListBox->AddString(((LPCTSTR)finder.GetFileTitle());
}
|
|
|
|
|
Pointers can be used anywhere in the programs you write. These are to save memory on startup and are faster to access and easier passed between methods.
We can allocate memory, use the resources, & deallocate the memory, keeping our system in good shape.
So, if we had.
someFunction() {
CListBox myListBox //Allocate memory on stack.
myListBox.AddString(""); //Call method.
}//Object destroyed on exit (out of scope).
or we could have
someFunction() {
CListBox* pListBox = new CListBox; //Allocate memory on stack.
pListBox->AddString(""); //Call method.
delete pListBox; //Destroy memory, give the system back the memory on the heap.
}
We can easily pass our pointers to other functions, saving time, no overhead in copying objects, copy by reference or copy by value, value is slower.
Hope this helps a bit....The best way to get experience with pointers is to use.
Gerry.
|
|
|
|
|
I think you can go read "A Beginner's Guide to Pointers"
which written by Andrew Peace. You can find this article in this site, it is quite helpful.
http://www.codeproject.com/cpp/pointers.asp
Hope this can help you...
|
|
|
|
|
Thanks for advises! I go and look that article...
And thanks very much of that code before, it clears also this thing much!
|
|
|
|
|
Thanks for advises! I go and look that article...
And thanks very much of that code before, it clears also this thing much!
|
|
|
|
|
I will look that article and thanks also that code, it helped out for understanding pointers!
|
|
|
|
|
I'm writing program about database.
In my database i have 3 tables:
CDINFO, PERSON, GETGIVE
And i have 3 fields in CDINFO table:
FILMNAME ---> Text
FILMCODE ---> Integer
COUNT ---> Integer
I'm using of three objects of CDaoRecordset for opening each table ...
Now, i want to add new record in CDINFO:
COleVariant var;
char *szFilm = new char[50];
var.vt = VT_INT;
GetDlgItemText(IDC_EDIT1, szFilm, 50);
var.intVal = GetDlgItemInt(IDC_EDIT2);
m_rsCDINFO->AddNew();
m_rsCDINFO->SetFieldValue("FILMCODE", var);
m_rsCDINFO->SetFieldValue("FILMNAME", szFilm);
m_rsCDINFO->SetFieldValue("COUNT", var);
m_rsCDINFO->Update();
SetDlgItemText(IDC_EDIT1, "");
SetDlgItemText(IDC_EDIT2, "");
delete[] szFilm;
This code have not any error or warning, but when i'll running this code, program indicate to me error about: "Out of memory" !!!
Please tell me, what is my wrong ?
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
Not sure, but can you not run BoundsChecker against it, to identify any memory leaks.
Gerry.
|
|
|
|
|
I use several dialogs in my project that are hosted in a splitter pane. The dialogs are created with new and create. They show up normal. Then I like to put them in a list or assign it to a general member. Something like this:
In some class:
CWindow * m_pWindow = NULL;
In another class:
CLocProp *pdlgProp = new CLocProp;
pdlgProp->Create(m_hWnd);
// here pdlgProp is send with sendmessage as a LPARAM (pointer is casted)
// in the class with the messagehandler:
m_pWindow = (CWindow*) lParam;
delete m_pWindow; // Debug assetion that this pointer is not valid
In the good old MFC days this was not a problem. With all the template stuff it gets difficult to hold a grip of this Windows stuff. Is it save to cast it to a CWindow*? If not, how should this be done? What if I want to put dialogs of a different type in a list. Then I need a common base class (CWindow).
Also, if I don't send the dialog through the lParam parameter, An assign it to CWindow* directly after its creation and then delete it, I also get the assertion.
Please help!
|
|
|
|
|
What can I do to reconstruct the project ????
|
|
|
|
|
You don't need the dsw file to open a project. If you still have the dsp file (the actual project file), open that instead and a new dsw will automatically be generated.
--------------
"Aagh!! I'm a victim of a Random Act of Management!"
|
|
|
|
|