|
Neville Franks wrote:
Also add TRACE statements at the end of the thread functions so you can see when they finish.
I did it.
|
|
|
|
|
m_pThread1 = (CThread1*)AfxBeginThread(RUNTIME_CLASS(CThread1), THREAD_PRIORITY_NORMAL, 0, 0);
m_p31Thread->SetOwner(this);
hThreads[handl++] = m_p31Thread->m_hThread; Seems like you're launching the thread m_pThread1 but yet it is m_p31Thread 's handle that is inserted into hThreads (and possibly this handle is invalid at the time of insertion.)
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Nicely spotted Joaquín. I must say that I found the reuse of m_pThread confusing. Looks like it should be a class member at all. And he shouldn't be using old style C casts.
Neville Franks, Author of ED for Windows. www.getsoft.com
|
|
|
|
|
Within your for loop you increment the m_nThreadsNbr with two every time
you start two threads. This should work for the first iteration but during your second iteration the value of m_nThreadsNbr is the number of threads started during BOTH iterations but the handle array only contains the thread handles from the last iteration.
Replace the
DWORD dw = WaitForMultipleObjects(m_nThreadsNbr, hThreads, TRUE, 5000);
with
DWORD dw = WaitForMultipleObjects(handl, hThreads, TRUE, 5000);
or reset the m_nThreadsNbr to zero in the begining of the for iteration.
In your switch you test the return value from WaitForMultipleObjects against
WAIT_OBJECT_0 + 0, WAIT_OBJECT_0 + 1 and WAIT_OBJECT_0 + 2 in order to see which thread that has terminated BUT when you call the WaitForMultipleObjects you set the bWaitForAll parameter to TRUE which will result in that when WaitForMultipleObjects returns WAIT_OBJECT_0 this means that all threads are terminated. WAIT_OBJECT_0 + 1 and WAIT_OBJECT_0 + 2 will never be returned from WaitForMultipleObjects as long as bWaitForAll is TRUE.
|
|
|
|
|
I want to know what's the type of a MSOffice file (Word, Excel, Access, PowerPoint, ...). How can i do ?
Thanks.
Aziz Rajim
|
|
|
|
|
They have their own file formats, different from one another. There is some stuff on CP, I know Excel exposes it's via COM to allow some work with it, I believe it includes loading & saving.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
"But there isn't a whole lot out there that pisses me off more than someone leaving my code looking like they leaned on the keyboard and prayed that it would compile.
- Jamie Hale, 17/4/2002
|
|
|
|
|
you'll need to get at the underlying com objects
which one ar eyou wanting to get at?
bryce
|
|
|
|
|
Hi,
My application run Ms Word Automated and then I insert some data there, the main problem comes when I have to insert formated tables, then it goes damn slow, some minutes to generate a medium size table ( I guess if the user will type it manually faster XDDDDD ).
Is there any way to speed that process up ? ( I've tried disabling the output screen til it is finished, but that doesn´t help much ).
Is it better to use Adobe Acrobat format than Ms Word for real issues ?
Thanks in advance, Greetings
Braulio
|
|
|
|
|
The way to improve the performance (assuming your code is ok), is to reduce the number of calls you make to the Word object. Try inserting the text in one piece, convert it to a table, then format it.
Adobe and word do completely different things. They are certainly not interchangeable. If what you want to do can be done in Acrobat, Word is probably the wrong program. (and vice versa)
Hope this helps,
Bill
|
|
|
|
|
Thanks for the tip,
I will try to reduce the number of calls, and do it all as compact as possible.
I've been searching, and found two interesting things:
1. Instead of using Word, just do the tables using RTF ( not so pretty nice looking but...), copy it to the clipboard and paste it in the Word instance, that goes incredibly faster than the automation solution ( but is a pain in the ass to try to make pretty layouts with that... ).
2. I found one article that tells you the problems that has Word 200 with the tables, and some workarounds, you can find it in:
"Maximising the performance of Word tables" at
http://www.mvps.org/word/FAQs/TblsFldsFms/FastTables.htm
What I miss is a way to pass the table in XML format to Word, and then he could handle the XML data to convert it to the specific Table format of word.
Thanks for your help, greetings
Braulio
|
|
|
|
|
How can I change size of DateTimePicker Controls at runtime ?
These are not members of COleDateTime:
m_StartTime.GetClientRect( rect);
m_StartTime.MoveWindow( rect);
Cheers
Hans
|
|
|
|
|
I´d like to change window font styles at runtime. I created a dialog with a few DateTimePicker controls but I cannot change their fonts. All other controls ( ListBox etc. ) support this:
GetFont()->GetLogFont(&LogFont);
LogFont.lfHeight = 16;
NewFont.CreateFontIndirect(&LogFont);
// Set Font Size
m_MyControl.SetFont(&NewFont);
But what about DateTimePicker controls ?
Cheers
Hans
|
|
|
|
|
|
Hi Friends
I am writing a profile string using WriteProfileString , I can read it using getProfileString,
Problem is I want to know were it is written in system registry, Platfrom is windows 2000 server.
Thanks
Gau
Gaurika Wijeratne // www.gaurika.com //
|
|
|
|
|
I think:
HKEY_CURRENT_USER\Software\MyCompany\MyApp\Settings
Mazy
"The path you tread is narrow and the drop is shear and very high,
The ravens all are watching from a vantage point near by,
Apprehension creeping like a choo-train uo your spine,
Will the tightrope reach the end;will the final cuplet rhyme?"Cymbaline-Pink Floyd
|
|
|
|
|
I think this is correct:
HKEY_CURRENT_USER\Software\MyCompany\MyApp\Local AppWizard-Generated Applications
Mazy
"The path you tread is narrow and the drop is shear and very high,
The ravens all are watching from a vantage point near by,
Apprehension creeping like a choo-train uo your spine,
Will the tightrope reach the end;will the final cuplet rhyme?"Cymbaline-Pink Floyd
|
|
|
|
|
I've seen couple of messages here that discuss the VC.NET and Managed C++. What I understod I can't programm in VC.NET without using Managed C++??
I don't know a s*** about Managed C++ and don't know what it is too...
Will I survive VC.NET without any knowledge in Managed C++???
------------------------------------
Rickard Andersson, Suza Computing
ICQ#: 50302279
I'm from the winter country SWEDEN!
------------------------------------
|
|
|
|
|
In the same way that you can use C++ without knowing anything about namespaces or templates, you can use VC++.NET without ever using MC++. I have no intention of ever using it, although I also admit to doing next to no C++ in .NET, simply because I focus on learning C# at home. When I have used C++, I've used it for CP articles, and it's a matter of public record that none of them compile to the CLR, i.e. they do not use Managed C++.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
"But there isn't a whole lot out there that pisses me off more than someone leaving my code looking like they leaned on the keyboard and prayed that it would compile.
- Jamie Hale, 17/4/2002
|
|
|
|
|
Visual C++ .NET still allows you to program unmanaged (native win32) apps. You've still got MFC and STL and all the other fun bits you've always had.
In fact VC++.NET is the *only* .NET language that allows you to write native apps, or to write native and managed code within the same executable image.
It slices, it dices...
cheers,
Chris Maunder
|
|
|
|
|
Thanks for your reply!
Now I know that I CAN write usual Win32 API apps and MFC apps with the new enviroment!
But I can't open my old VC6 projects into Vc.NET? That can't be allowed!?
------------------------------------
Rickard Andersson, Suza Computing
ICQ#: 50302279
I'm from the winter country SWEDEN!
------------------------------------
|
|
|
|
|
Yes, but you must allow VC to convert them to the new format.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
"But there isn't a whole lot out there that pisses me off more than someone leaving my code looking like they leaned on the keyboard and prayed that it would compile.
- Jamie Hale, 17/4/2002
|
|
|
|
|
If you know C++ you know Managed C++, in my modest opinion is just C++ with more classes and garbage collection. Its awesome.
Next time you create a class just do this experiment and let me know
__gc class whatever
{
};
instead of
class whatever
{
};
Cheers
Al
|
|
|
|
|
Does anyone here know how many page table entries can be cached by a Pentium III TLB (translation look-aside buffer)?
Cheers,
Tom Archer
Author, Inside C#
Please note that the opinions expressed in this correspondence do not necessarily reflect the views of the author.
|
|
|
|
|
|
Could anyone help me in generating a visibly distinct color from a set of existing COLORREFs? I have tried bitwise transformations in conjunction with GetRValue(), GetGValue(), GetBValue()... functions... but sometimes end of with dark colors of the Blue, Red or Green range which are not visible distinct.
|
|
|
|