|
I have done this by using the following steps:
1) Start new Window Forms Project. Rename Form to MainForm, just so we both know what I'm referring to. You can just remember this bit if you have more than 2 brain cells.
2) Add ChildForm to Project.
3) Add Menu to MainForm, with MenuItems for adding child forms. Complete the event handlers.
4) Now add your Panel to MainForm and Dock as required.
5) NOW!! set IsMDIContainer to true for MainForm.
Works for me! Hope it helps you.
[Edit]
I have just realized that the above is complete rubbish. Oh it works, but the order is irrelevant.
I have just created a new application in which I set IsMDIContainer before doing anything else, it still worked,
So I don't know what is going wrong with your application.
[/Edit]
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
|
Hi all,
I'm new to c# and I'm wondering how to access the sound card from my code so that I can sample the sound.
Thanks in advance
Darren
|
|
|
|
|
If I have a multi-thread program, how can I know on which core
each thread run ?
Thanks..
--
Evyatar
|
|
|
|
|
Are you really using Multicore ??
The thread can only use Multi cores if its run using Parallel Extension. Its there if you add the Threading.dll that comes with the extension pack.
Otherwise, the process can run in a single core.
|
|
|
|
|
That isn't even true. Why do you think it is?
|
|
|
|
|
Then what does Parallel extension do ?
Tricky Programming on Multi-Core Processors[^]
You can see, threads running concurrently in more than one core if Parallel extension is used. Does this work with normal threads as well ?
If this is so, then I wonder what are the advantages of Parallel Extension ever.. And also why one would ever use an object of Task .
|
|
|
|
|
The parallel extensions have task stealing and convenient constructs such as Parallel.For
The parallel extensions can use multiple cores because they use threads
|
|
|
|
|
Thank you so much.
|
|
|
|
|
Hi,
AFAIK you can't. Threads can run on any available core, and they are not restricted to a single core, so they may hop over to another one after a thread switch. You can reduce that freedom by setting ThreadAffinity/ProcessorAfinity but you really have to know your stuff to take advantage of that.
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
|
|
|
|
|
On Vista or higher there is a new function called
GetCurrentProcessorNumber. I think thats exactly what you are looking for.
Greetings
Covean
|
|
|
|
|
Right. The Win32 functions GetCurrentProcessorNumber and GetCurrentProcessorNumberEx are available through P/Invoke since Vista/Win7 respectively.
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
|
|
|
|
|
What about NTGetCurrentProcessorNumber ? Seems to be available on older OS's
[DllImport("ntdll"), SuppressUnmanagedCodeSecurity]
public static extern int NtGetCurrentProcessorNumber();
|
|
|
|
|
The doc says: "NtGetCurrentProcessorNumber may be altered or unavailable in future versions of Windows. Applications should use the GetCurrentProcessorNumber function instead."
It is available on my Vista system; don't know about Win7.
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
|
|
|
|
|
|
I want to measure core thruput on variety of programs.
|
|
|
|
|
Thanks all ..
I will go t check your answers and will come to give feedback...
|
|
|
|
|
Hi all ..
The GetCurrentProcessorNumber() work wonderful ..
so thanks to all the helpers
|
|
|
|
|
Hi,
Please mark the helpful answer(s) by clicking "Good Answer". I've done it for you now.
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
I did do that..
|
|
|
|
|
Hi again..
Is there any another solution for win XP ?
I try this:
<br />
[DllImport("ntdll"), SuppressUnmanagedCodeSecurity]<br />
public static extern int NtGetCurrentProcessorNumber();<br />
and I get this exception:
System.EntryPointNotFoundException was unhandled
Message="Unable to find an entry point named 'NtGetCurrentProcessorNumber' in DLL 'ntdll'."
Source="XP_Multicore_try_0"
TypeName=""
StackTrace:
at XP_Multicore_try_0.Program.NtGetCurrentProcessorNumber()
at XP_Multicore_try_0.Program.loop() in C:\Documents and Settings\evyatarv\Desktop\XP_Multicore_try_0\XP_Multicore_try_0\Program.cs:line 24
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException:
|
|
|
|
|
hello,sir i have designed a software in c# .net.i have used the my sql databse.its working ok in my machine,becoz i have created it in my machine.packaging is ok.i have generated the sql script.when i am instaling this software instalation becomes successful,and also mysql databse.but when i am going to access the page its showing unhandle exception error.i have not used crystal report in my project.please help how will i instal it in other machine??its urgent.give me step by step procedure.
|
|
|
|
|
Step by Step procedure for what? All you have said is how successfully each part has gone. No, information about your problem except you have an unhandled exception.
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
You say a lot for someone who really tells us nothing. What is the exception ? Do you have .NET installed on the other machine ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
I use API following to disable minimize, maximize box in windows. But i can't do that with restore button. I'm quite confused.
SetWindowLong(hwnd, GWL_STYLE,0x16CC0000);
0x16CC0000: remove maximize, minimize box. But i can't find the other code for restore box.
|
|
|
|