|
There can be a "crash" when multiple threads access the same resource. In your case it is the device context of the view.
You must use a critical section to lock the drawing code so that a thread cannot draw to the DC till other threads have released it.
«_Superman_»
|
|
|
|
|
What about separate it to different process and different plot client area.
Is it still crash ?
|
|
|
|
|
Then it will not because now there is no client areas being shared by multiple threads.
«_Superman_»
|
|
|
|
|
Can you give me some technic for mix multiple process and show on different client area but all process run on same program.
|
|
|
|
|
i have color mismatch problem in printpreview
pDC->SetTextColor(RGB(127,127,127));
pDC->TextOut(100,100,"hello");
and i m using Fujitsu DX2400 printer
the color looks proper in view but different in print preview
if i use diff printer like HP it works great
this color mismatch also happens for some more color codes
RGB(127,127,127) is one of them
read lot abt ICM in documentation also use Palettes
but no use
need some help...............
|
|
|
|
|
Hi
My application (say App.exe) is supposed to be launched by another process called Laucher.exe since some environment variables are needed to be set for App.exe to run. I am using CreateProcess API in Launcher.exe to set the necessary environment variables.
I had written a sample earlier where in both by Launcher.exe and App.exe were non-unicode (built in VC 6.0). But, currently I have moved to VS 2008 which where in the application comes with unicode settings by default. I have converted both Launcher.exe and App.exe to Unicode, but I am having a problem to use CreateProcess in Launcher.exe to launch App.exe
Since my App.exe is in unicode I think we have to set the lpEnvironment (in CreateProcess to CREATE_UNICODE_ENVIRONMENT flag) But just setting this and using the API the same way fails to launch my App.exe.
I could not find sufficient links on the internet which explain how to use this flag and launch the application in a unicode environment
Can somebody help me out if you have used this in advance?
Thanx
Vipin
|
|
|
|
|
After reading your question, I'm guessing your real problem is that CreateProcess API is failing in UNICODE builds. And that in the earlier NON_UNICODE builds it was successful.
If so, your title is very misleading.
Actually there is a difference in how you would call CreateProcess in UNICODE and NON-UNICODE builds.
In UNICODE builds, the lpCommandLine parameter of CreateProcess cannot be a constant because it will be modified internally. So you need to pass in a non-constant buffer here.
This is documented in MSDN, but you would need to read it properly, which most of us do not do.
«_Superman_»
|
|
|
|
|
Hi,
I am a retired social worker who creates eLearning materials that are given away to help people improve their health and to teach social work students. I need to create an unmanaged DLL that can be used to add drawing within an eLearning app which is capable of loading unmanaged DLL's and calling their functions, if these are specified.
On CodeProject, there is an excellent drawing DLL http://www.codeproject.com/KB/dialog/Basic_Drawing_Plug_in.aspx[^][^]but it is in C# which I suspect is managed code and not able to be loaded or functions called in the eLearning app.
As a novice in coding (have been trying to learn using MS's Express editions for VC++ and C#, which is a very steep learning curve for me), I am lost tyring to figure out a way to convert the C# to VC++, figure out the function calls so they can be scripted into the eLearning app, etc. With very limited understanding and skills, I keep getting error messages for whatever I try.
Any suggestions, leads, help in converting to unmanaged code plus specifying the function calls would be greatly appreciated. (Wrote to the DLL's author but have not heard back).
Thanks.
Kind Regards,
writer
|
|
|
|
|
No easy way I guess, unless somebody can do it for you. (somebody != 'I' )
Or you can get it done for a small fee by some freelancer.
Or you can wrap the managed code in a COM Callable Wrapper (CCW) and use it in unmanaged code.
But there is a steep (if not steeper) learning curve there as well.
«_Superman_»
|
|
|
|
|
Hi Superman,
Thanks for your reply.
It appears there is no easy solution.
However, I plan to try to learn more about unmanaged DLL's since these can be used by the eLearning authoring software that I use. Even if I can't create a drawing DLL in unmanaged code, I may learn enough to create something useful.
Again, thanks for your input.
Kind Regards,
writer
|
|
|
|
|
Post user defined Message and how to receive it
|
|
|
|
|
|
Hi ,
I want to compare 2 CStringArray... Please suggest best way to compare this arrays. Can it be easy to do using STL. I would like to have easiest way (using CStrinArray / STL )to do this..
Thanks:-
Mike
|
|
|
|
|
mikert_2008 wrote: Please suggest best way to compare this arrays.
Please explain what you mean by compare... You have two arrays of strings, what should compared exactly ? The number of strings in the arrays, each string to its corresponding in the other array, ... ?
|
|
|
|
|
It largely depends on what you mean by "compare". Are you wanting to compare each and element of two arrays? You can just do the comparison in a loop, can't you?
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
How to merge two XML files in one XML file???
Thanks in Advance
|
|
|
|
|
If by merge you mean append (as in your subject), with two files each will have a root, so you'd have to decide which root was going to be the root of your new file. Then you could copy all children of the root from the file to be discarded so they become children of the root in the new file. That is. of course, if the format of the files makes this a sensible thing to do.
|
|
|
|
|
Hi all,
i m place my application icon in system tray.
i have created a Taskbar Menu,in this menu one item has property of check or uncheck.
i want to working according to its check or uncheck position.
how can i check wheater the item is checked or not.
so please tell me how can i check or uncheck the menu item.
thanks in advance.
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
I believe this[^] should tell you all you need.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
HI,
I HAVE 1 PROJECT(IN MFC) IN WHICH THERE IS 1 BUTTON AS WRITE CLICKING ON IT 1 FILE FROM PC WILL BE WRITTEN IN RAM (WHICH IS ON BOARD).NOW I WANT TO SHOW 1 PROGRESS BAR WHILE WRITING IA GOING ON & IT SHOULD BE DISSAPPEAR AS SOON AS WRITING IS DONE.
HOW CAN I ACHIEVE IT????
THANKS IN ADVANCE...
|
|
|
|
|
You can add a progress bar in your application, initially in hide condition.
when you start write you should visible your progress bar through ShowWindow(SW_SHOW),and when writing is finished you can hide your progressbar tru ShowWindow(SW_HIDE).
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
Please, write in an understandable english and fix your keyboard, because it seems your caps lock key is broken...
|
|
|
|
|
I would implement a modeless dialog that contained a progress control. That dialog/control can be controlled via your main dialog as it does the (copy) work.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Hi,
In my application I need to get the complete Hard Drive size.
I am using Windows 2000.
Is there any API to get the size of hard drive in win2000?
I don't want to use WMI class (win32_DiskDrive).
Thanks in advance.
|
|
|
|
|
IOCTL_DISK_GET_DRIVE_GEOMETRY is another way to do it.
The API to use here is DeviceIoControl .
From Windows XP onwards you can use IOCTL_DISK_GET_DRIVE_GEOMETRY_EX to directly get the disk size.
«_Superman_»
|
|
|
|