|
|
Hi
I am making an application in VC++ 6.0 and my application type is Dialog based application with static link libeary.
Now problem is that ->
Suppose i am in form one and using its button event coding(When i will reach to form two)
Now when i am at form two form one will also open
mense now there will be two form open
I want that when i will reach at form two form one will close automatically
At a time i will be at only one form.
Please any one told me how i do it.
Regard's
Kaushik
|
|
|
|
|
I hope, both your forms are Modal. In that case you do not need to close the 1st dialog as that will be inactive in any case.
Do you have any specific reason for that?
Manoj
Never Gives up
|
|
|
|
|
Yes
According to client requirment I want to do it
Regard's
Kaushik
|
|
|
|
|
Yeah, like Manoj says, if both dialog are modal, why you would want to close the 1st. dialog?.
However, you could call CDialog::ShowWindow(SW_HIDE) to hide the 1st dialog, and call CDialog::ShowWindow(SW_SHOW) to show it again.
Demian.
"I have always wished that my computer would be as easy to use as my
telephone. My wish has come true. I no longer know how to use my telephone."
-Bjarne Stroustrup, computer science professor, designer of C++
programming language (1950- )
|
|
|
|
|
I have some thread in my project that on of them is blocked but I don't know in which line in my code the thread have been blocked. how can I know where my thread is blocked?
Agh
|
|
|
|
|
mehrdadov wrote: how can I know where my thread is blocked?
Try stopping it in the debugger and then checking where each of your threads is.
I enjoy occasionally wandering around randomly, and often find that when I do so, I get to where I wanted to be [^].
Awasu 2.3 [^]: A free RSS/Atom feed reader with support for Code Project. 50% discount on the paid editions for CP members!
|
|
|
|
|
But when a thread is stoped I can't understand where it's stoped even if it was in debugger if you know a approach please help me
Agh
|
|
|
|
|
If you're using VC6:
- In the Debug menu you will find a Threads menu item. This lets you switch between the threads in your program.
- Look at the call stack (View|Debug Windows) to see the stack for the current thread.
Other versions of VS will have something similar.
I enjoy occasionally wandering around randomly, and often find that when I do so, I get to where I wanted to be [^].
Awasu 2.3 [^]: A free RSS/Atom feed reader with support for Code Project. 50% discount on the paid editions for CP members!
|
|
|
|
|
Also, insert TRACE lines inside the thread and see which one is not getting called.
--
=====
Arman
|
|
|
|
|
My thread is main thread so I can't search only in one function and If I set TRACE function for all of class it can't work successfully because It need a lot of CPU time
Agh
|
|
|
|
|
As Taka mentioned, break the execution when you think a thread is deadlocked.
In the Debug/Threads window, double click on each of your app's threads. That sets the debugger's
focus to that thread and brings the source code up with the current execution pointer shown.
If it's pointing at a wait function, it's probably stopped right there. If a dialog pops up
stating there's no source code available then look at the stack trace and go back to the nearest
line of code you find that is in your source code. That will be the current call in progress
on that thread.
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Hi all:
I have a question here:
I successfully read all the words from a text file one by one, and all the words have been stored in a "map<string, int="">", where "string" is a word and "int" is the number of total occurrence of the word.
Now I need to put all the words into a "vector<string>", what I have done is pretty silly:
vector<string> Vec(this->table.begin(),this->table.end());
Since the are all members of a class WordTable, so I used this-> pointer.
I think my mistake is trying to use:
vector( input_iterator start, input_iterator end ); but I used wrong pointers.
Can any one help?
Thank you
|
|
|
|
|
Hi all:
I know what to do now, but still my program crashes. Below is my codes:
map<string, int="">::iterator m_pos;
vector<string>::iterator v_pos;
vector<string> vec;
v_pos = vec.begin();
int n = 0;
for (m_pos = this->table.begin(); m_pos != this->table.end(); m_pos++) {
vec.insert(v_pos + n, m_pos->first);
n++;
}
return vec;
Can anyone see what is wrong with this block of codes?
Thank you
|
|
|
|
|
Don't use v_pos and insert(). Look at vector::push_back().
I enjoy occasionally wandering around randomly, and often find that when I do so, I get to where I wanted to be [^].
Awasu 2.3 [^]: A free RSS/Atom feed reader with support for Code Project. 50% discount on the paid editions for CP members!
|
|
|
|
|
Thank you a lot Taka Muraoka.
It worked.
|
|
|
|
|
hi i am httpsendrequest for downloading a file. sometimes the programhangs at this request. why this is happening and how to solve it? pls help me.
Arise Awake Stop Not Till ur Goal is Reached.
|
|
|
|
|
You need to post some of your code (using "PRE" tags) if you want to get a reasonable response.
|
|
|
|
|
You can use InternetSetOption() to set a timeout for operations done on a given handle (in your case, the handle to the HTTP request).
|
|
|
|
|
hi
how can i make Windows CE.Net 4.2 Emulator not to grab Alt+Tab and let my Windows handle it normally?
thx
|
|
|
|
|
Hi,
I have a big problem with the following code:
int _tmain(int argc, _TCHAR* argv[])
{
class2 *c2 = new class2();
class1 *c1 = new class1();
c1->doit(c2);
return 0;
}
class2::class2(void)
{
hold = new char*[2];
hold[0] = new char[10];
hold[1] = new char[10];
hold[0] = "test";
hold[1] = "me";
}
void class2::get(int index, char *result)
{
result = hold[index];
return;
}
class1::class1(void)
{
}
void class1::doit(class2 *c2)
{
c2->get(0, pszTmp);
c2->get(1, pszTmp);
return;
}
The Problem is that pszTmp never points to the arrays contents of the array hold.
When I run the code in the debugger it always stays a <bad pointer="">.
Does anyone know what I am making wrong?
P.S.: I am using Visual Studio 2005
|
|
|
|
|
Look at what this is doing:
void class2::get(int index, char *result)
{
result = hold[index];
return;
} You are assigning a new value to the parameter result . Function parameters are passed by value, so the new value is not visible to the caller. Change the parameter to a char*&
|
|
|
|
|
zeus2000 wrote: void class2::get(int index, char *result)
if you want to use result as an OUT (i.e. a return) value then you have to add a level of indirection, making it a pointer:
void class2::get(int index, char * *pResult)
{
*pResult = hold[index];
return;
}
anyway, you don't need this, because you can use the function return value:
char * class2::get(int i)
{
return hold[i];
}
anyway, you don't event need this, because (at least it seems) hold is a global var.
BTW: don't use global vars and always check if index are inside array boundaries, in your code.
Hope that helps
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.
|
|
|
|
|
Thanks for the 'pointers' .
I will try your suggestions.
|
|
|
|
|
On a side note:
hold[0] = new char[10];
hold[0] = "test"; does probably not do what you intend. The allocated array at the first line is lost by the second line assignment (since the variable only holds an address, not a byte sequence)
Either just use the second line, or you'll need to copy the character data to the allocated array using e.g. ::lstrcpy() .
You also might want to consider using const char* instead of just char* when it comes to parameters or function return values for this variable.
|
|
|
|