|
Hahahahaaha,
Maybe my home computer is too powerful (AMD900, 512Mb RAM....), but my school's computer just has 256Mb RAM.....
So, basically, I can do nothing except asking the school to replace those computer????
Thank you very much~~~~~~
|
|
|
|
|
ChiYung wrote:
but my school's computer just has 256Mb RAM.....
It's more than enough - I don't believe your project is *that* complex. VC installation may be screwed somehow - if it fails on one machine, try with another. Your teacher(s) should be smart enough to get where the problem is.
Tomasz Sowinski -- http://www.shooltz.com ** If you're going to rape, pillage and burn, be sure to do things in that order. **
|
|
|
|
|
Here's what the MSDN says about that error...
-------------------------------------------
Linker Tools Error LNK1102
out of memory
There was not enough memory for the tool to run. Probably the paging file exceeded available disk space.
If a shortage of disk space is not the cause, note the circumstances of the error, try to isolate the problem and create a reproducible test case, then consult the technical-support help file or the technical-support section in one of your manuals.
----------------------------------------------------
so check the disk space on your computer.
|
|
|
|
|
Hi,
My base dialog(CMyDlg) have 3 buttons and 2 childs windows. Which are delived from CPropertyPage and each have 2 buttons and edit control. My question is how to route focus when user press "TAB". Route focus from 1. after to 2. after to 3. button in CMyDlg and next route it to first childs windows. After when focus has last control (in first child w.) and user press TAB route focus to second child windows and so on ... As you have only 1 base dialog which have all control.
::SendMessage(pWndParent->m_hWnd, WM_NEXTDLGCTL,0,0); I use this but its only for control with WS_TABSTOP ( not for windows.
Could you suggest some link ? or how to do it ??
Thanks very much
Wiizi
|
|
|
|
|
Make sure the property page/child windows have WS_EX_CONTROLPARENT extended style set. You can force this on during initialization.
Tim Smith
I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
|
|
|
|
|
I need to create two threads at the same time - meaning I cannot wait for one thread to complete before I create the second because they both have continuous loops inside their functions.
What do I need to do in order to create and run both threads? Could you give me some sample code or direct me to the correct function(s)?
Thanks in advanced.
Hiep Dang
|
|
|
|
|
You just create the two threads in sequence. Creating the second thread won't wait for the first to finish.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I can see the splash panel for that app now -
"Ladies and gentlemen, thank you for purchasing this program. Please sit back and relax, and try to ignore the sound of buckling metal as we initialize our threading model."
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
John Simmons / outlaw programmer wrote:
Ladies and gentlemen, thank you for purchasing this program. Please sit back and relax, and try to ignore the sound of buckling metal as we initialize our threading model."
Hhahahahahaha
Can I steal that for a new sig please?
Sorry to dissapoint you all with my lack of a witty or poignant signature.
|
|
|
|
|
Be my guest.
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Cruel but too true. I hope I never have to fly in that Aeroplane.
Neville Franks, Author of ED for Windows. www.getsoft.com
|
|
|
|
|
Use the CreateThread function to initialize two HANDLE variables in your windows callback procedure. By default, the functions/objects associated with the handles will execute concurrently.
ralf.riedel@usm.edu
|
|
|
|
|
Create them both suspended, and then start them. Then ensure you are using whatever synchonization primitives are needed to get your threads working correctly. Go read Threads 101.
Neville Franks, Author of ED for Windows. www.getsoft.com
|
|
|
|
|
When filling the BROWSEINFO struct, provide a callback function.
Use the following:
int CALLBACK MyBrowseCallbackProc(HWND hwnd, UINT uMsg, LPARAM lParam, LPARAM lpData)
{
if (uMsg == BFFM_INITIALIZED) {
LPCTSTR path = (LPCTSTR) lpData;
SendMessage(hwnd, BFFM_SETSELECTION, TRUE, (LPARAM) path);
}
return 0;
}
LPCTSTR path = "c:\\whatever\\you\\want";
BROWSEINFO binf;
...
binf.lpfn = MyBrowseCallbackProc;
binf.lParam = (LPARAM) path;
pidl = SHBrowseForFolder(&binf);
Happy coding
Peter
The cops still stand around and eat koeksisters - Paul Watson, The Lounge, 2002
|
|
|
|
|
Hi, the following code is in a function. I'm doing multithread. When my thread function call this function, i got error message and program terminate......what happened????? HELP!!!!!
{
cs.Lock(); //Critical Section Lock
std::vector <SCHEDULER_MESSAGE>::iterator Scheduler;
if (!Scheduler_MSG.empty())
{
for ( Scheduler = Scheduler_MSG.begin() ; Scheduler != Scheduler_MSG.end() ; Scheduler++ )
{
if (((*Scheduler).msg == ABORT_MSG) || ((*Scheduler).msg == COMMIT_MSG))
{
std::vector <WAITQUEUE_STRUCT>::iterator Iter;
for (int i=0; i<NumOfDBObject; i++)
{
if (LockTable[i].CurrentThread == (*Scheduler).pThread)
{
LockTable[i].CurrentThread = NULL;
LockTable[i].CurrentLock = CurrentNoLock;
}
if (!LockTable[i].WaitQueue.empty())
{
for ( Iter = LockTable[i].WaitQueue.begin() ; Iter != LockTable[i].WaitQueue.end() ; Iter++ )
{
if ((*Iter).pThread == (*Scheduler).pThread)
LockTable[i].WaitQueue.erase(Iter);
}
}
}
Scheduler_MSG.erase(Scheduler); //Finished and erase this message
}
}
}
cs.Unlock(); //Critical Section Lock
}
|
|
|
|
|
Using erase on a vector invalidates the iterators.
Maybe if you changed your loop to...
while (!(!Scheduler_MSG.empty())
{
Scheduler = Scheduler_MSG.begin();
.... the rest of the code
}
Tim Smith
I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
|
|
|
|
|
So i change the code liked this:
while (!Scheduler_MSG.empty())
{
Scheduler = Scheduler_MSG.begin();
AfxMessageBox("Update start");
if (((*Scheduler).msg == ABORT_MSG) || ((*Scheduler).msg == COMMIT_MSG))
{
//AfxMessageBox("In the IF loop");
std::vector <WAITQUEUE_STRUCT>::iterator Iter;
for (int i=0; i<NumOfDBObject; i++)
{
if (LockTable[i].CurrentThread == (*Scheduler).pThread)
{
LockTable[i].CurrentThread = NULL;
LockTable[i].CurrentLock = CurrentNoLock;
}
if (!LockTable[i].WaitQueue.empty())
{
for ( Iter = LockTable[i].WaitQueue.begin() ; Iter != LockTable[i].WaitQueue.end() ; Iter++ )
{
if ((*Iter).pThread == (*Scheduler).pThread)
{
LockTable[i].WaitQueue.erase(Iter); <=====Something wrong here...
}
}
}
}
//AfxMessageBox("Before erase");
Scheduler_MSG.erase(Scheduler); //Finished and erase this message
//AfxMessageBox("After erase");
}
}
I found something wrong in the statement LockTable[i].WaitQueue.erase(Iter); (stated)... when i disable this line.....it's no terminate message.........how to change it?
Thanks!!!!!
|
|
|
|
|
It is the exact same problem. Calling erase invalidates the iterator.
Tim Smith
I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
|
|
|
|
|
Your iterator has been invalidated after erase. Change your loop to this and it should work fine.
for ( Iter = LockTable[i].WaitQueue.begin() ; Iter != LockTable[i].WaitQueue.end();)
{
if ((*Iter).pThread == (*Scheduler).pThread)
{
iter=LockTable[i].WaitQueue.erase(Iter); // chg here
}
else // chg here
{
++iter;
}
}
|
|
|
|
|
I have a button on my dialog window that i need to give it a function to get the value of an edit box and insert it into a combo box. I can get this working so that it can do it once. But what i really need is for it to hold the value in the combo box and store it there, then when i change the value of the edit box and press the button again to add it to the combo box, both the first value is still there as is also the second one.
Please oh please help me.
Help me to help you............(jerry maguire)
|
|
|
|
|
Maybe something like this would do the trick.
your_on_button_click_handler () {<br />
<br />
CString s;<br />
MyEditBox.GetWindowText ( s );<br />
int pos = MyComboBox.AddString ( s );<br />
MyComboBox.SetCurSel ( pos );<br />
<br />
}
cheers,
-Ben
|
|
|
|
|
Here's an obscure one for you. I fought this battle long ago and came up with a workaround, but we're now looking for a more legitimate solution than my hack.
Objects that are DECLARE_SERIAL depend on MFC's runtime class info. If you add a class to your program but do not instantiate an object of that type, you will not be able to deserialize this class from disk. This is because the linker scans the code generated from IMPLEMENT_SERIAL that adds a CRuntimeClass object to the global list of runtime class objects (that get traversed on serialization operations), and strips it out if there's no reference to that class. Pointers don't count. Consequently, when you try to deserialize a class that hasn't been instantiated, the global list routine politely asks, "Class? What class?" and declines the serialization request.
The hack was to have a function called at startup that just instantiated an object of each type on the stack. The linker saw the reference, and therefor didn't strip the code. Ugly, cheap & sleazy, but it worked.
However, now we want to do things "the right way" and actually understand and solve the problem. And so I put it to you, my low level guru friends, how the heck do you tell the linker to leave the darned object alone, regardless of whether or not it's been instantiated?
This is a quick summary of a rather obscure problem, be happy to offer further details. However, I'm thinking that I can't be the only one to have fought this battle. Any brilliant insights would be most appreciated.
Kapla.
Chistopher Duncan
Author - The Career Programmer: Guerilla Tactics for an Imperfect World (Apress)
|
|
|
|
|
Try /OPT:NOREF. That might do it.
Tim Smith
I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
|
|
|
|
|
Tim Smith wrote:
Try /OPT:NOREF. That might do it.
Man, I was hoping that it would be something that simple. Unfortunately, no joy. The search continues.
Hey, if you don't end up in the middle of the MFC code every now and then, you're just not having any fun, right?
Chistopher Duncan
Author - The Career Programmer: Guerilla Tactics for an Imperfect World (Apress)
|
|
|
|
|
This worked like a dream, I thought I would never find the solutions to this problem.
Thanks.
AndyC
|
|
|
|