|
I am trying to study how functions with POINTER PARAMETER WORKS. Do you know any good links which will provide me with the details of FUNCTIONS WITH POINTER PARAMETERS
|
|
|
|
|
|
I'm wondering if you're going to again delete your post after getting the answer. For your reference, here is the link[^].
Best,
Jun
|
|
|
|
|
Hey Jun,
Im new to this thing so im just messing around .. hahaha
|
|
|
|
|
It's Ok. Hope you enjoy here.
Best,
Jun
|
|
|
|
|
|
Jay03 wrote: ...how Functions with pointer parameters work.
They work just the same as any other function does. When calling them, simply pass the variable's address instead of its actual value.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Has anyone written any code to expand a string with embedded environment variables in it, e.g.
%systemroot%\system32\drivers\etc\hosts
.. to form a literal string (as required by functions such as CreateFile()):
c:\windows\system32\drivers\etc\hosts
?
Many thanks.......
cheers,
Neil
|
|
|
|
|
|
Thanks. I thought there had to be something, just couldn't spot it.
You the man!
cheers,
Neil
|
|
|
|
|
Anyone know how to place an HBITMAP into a PDF File? or Save a CDC as a PDF File?
Chris
|
|
|
|
|
|
|
I am using a CMSChart. When I want to save this thing as a file I have to copy the chart into the clipboard as a bitmap and then I can bring it out of the clipboard into an HBITMAP. From there I can save it as a bmp or a jpg. But then the user can easily go into paint and try to change the contents. If I could put the HBITMAP into a pdf then the average user will not be able to change or manipulate the picture.
Chris
|
|
|
|
|
Hi,
I am having an application written in vc++ in which it is having multiple threads (to say 2 threads) running parallel. These threads are created by the user at the same time, but ofcourse one after the other. I want them to be syncronized with each other so that they wont be off even by 33.3msec. Actuallly these two threads generate waveform signals through 2 waveform generator boards which finally generates images. So, the framerate will be at 30Hz. The problem is each thread generates two differnt images at the same frame rate, but while I replay the images they are "sometimes" off by one frame(33.3msec).
thanks,
-Pavan
|
|
|
|
|
Have you implemented any synchronization mechanism between the two threads, or just created them and let them go?
Best,
Jun
|
|
|
|
|
mswin does not provide us with much control of threads. They do not even give us a simple control to temporarily disable switching of threads. Just imagine if we could disable switching momentarily so that we could execute a couple of lines of code and guarantee that no other threads were run in between. It could prevent a mess of control flags.
Anyway, I always suggest... DO it in one thread! Then you do not have these problem!
Just livin a dream.. dont wake me!
|
|
|
|
|
mikeorama12345 wrote: Just imagine if we could disable switching momentarily so that we could execute a couple of lines of code and guarantee that no other threads were run in between.
Isn't this what a critical section does?
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
All a critical section does is prevent another thread from running the protected section of code. He was asking about totally preventing other threads from running, which isn't possible.
--Mike--
Visual C++ MVP
LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
VB > soccer
|
|
|
|
|
It is, but I think you have to be running Windows 3.1
|
|
|
|
|
Michael Dunn wrote: He was asking about totally preventing other threads from running,
I don't think so, but I'd like to hear what the originator says.
Michael Dunn wrote: which isn't possible.
Why not?
Best,
Jun
|
|
|
|
|
Jun Du wrote: I don't think so, but I'd like to hear what the originator says.
Isn't this the only way both threads can remain time synchronized? I mean the only way I can see this to work is he has to have a dual processor dual core machine with the two threds on their own cpu and that the operating system will never schedule any other threads (or yield execution) on either of the cpus that are runing the two threads.
|
|
|
|
|
My reply "I don't think so" is to Michael's comment that the originator wanted to prevent other threads from running. I think what the originator wanted (or needed) is sychronizing the tweo threads so that they output the same frame at a given time.
I see two issues mixed with the originator's question: real-time and synchronization. By real-time, I mean that the simulation time your program complete goes hand-in-hand with your wall clock, no faster no slower. Lets say you're simulating the traffic on a highway. You want your program to complete the simulation of one sencond traffic within one second time. Only this way you can acheive real-time. Multiple CPUs can help to acheive real-time through better parallelism. But if the computation is very simple, one CPU can do the job too. As you may notice now, parallelism is not a necessity in pursuing real-time.
Synchroniztion is a different issue. It is about the collaboration between two threads. It has nothing to do with how fast your CPU is. You don't need multiple CPUs to acheive synchronization. One of the major purposes for synchronization is protecting resources shared by more than one thread.
Best,
Jun
|
|
|
|
|
mikeorama12345 wrote: mswin does not provide us with much control of threads.
Compared to what, Linux?
|
|
|
|
|
That is what Mutex's, Semaphores/Critical Sections are for.
Almost forgot ... and events.
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
-- modified at 15:31 Tuesday 27th June, 2006
|
|
|
|