|
That's not allowed, see, for instance [^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
No, but you can do this.
: _name(name)
{
_id = id;
_salary = salary;
}
The difference is that _name(name) is initialization and _id = id is assignment.
This is equivalent to
type _name = name; and
type _id;
_id = id;
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
Hello su_penguine,
Its called constructor initializer list. Check this[^] and this[^] for more information.
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
Does anyone know why Skype seems incompatible with Vista Home edition?
Sorry its not a C++ question. But you guys are the best.
|
|
|
|
|
Ric Ashton wrote: Does anyone know why Skype seems incompatible with Vista Home edition?
Because your question is incompatible with this forum.
Better place to ask :Here[^]
He never answers anyone who replies to him. I've taken to calling him a retard, which is not fair to retards everywhere.-Christian Graus
|
|
|
|
|
Ric Ashton wrote: Sorry its not a C++ question.
You are indeed correct.
|
|
|
|
|
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
C is my preferred programming language. I know it is not the expected answer, but since you're our fan...
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
The first 2 books didn't address these issues and the third book assumes the reader has the following knowledge, so I turn to codeproject for the answers, google came up with mixed results for some of the following, so I was hoping a community with experience could sum it up nicely instead of working through google more then what I have,
What exactly are the following datatypes
1. Handle
2. PVOID
3. DWORD
Also, a general question, why use pointers (*) if you can use Addresses (&) to reference objects?
|
|
|
|
|
1,2 and 3 are not C++ types. They are code defined types so you should be able to go to the definition using the IDE tools you are working with.
The general rule I go by is to only use pointers when absolutely necessary. Mostly this translates to when it has been determined that using the heap is required. Also translates to when a reference type will not satisfy the requirements.
|
|
|
|
|
Handle : Handle to an object. It may point to any object. For example a Handle to a window.
PVOID is nothing but a void*. "P" means a pointer.
DWORD is 32 bit unsigned integer.
EliottA wrote: Also, a general question, why use pointers (*) if you can use Addresses (&) to reference objects?
The general answer is , if you can use & do not use *. Moreoever you can send * as *&.
He never answers anyone who replies to him. I've taken to calling him a retard, which is not fair to retards everywhere.-Christian Graus
|
|
|
|
|
You need to buy the complete reference book.
Something like the 'The Waite Group's' Turbo C++ Bible, or
something more up-to-date.
Utilising DWORD (for example) is a complex issue reserved for
programmers with some experience.
To find out what it is used for and how it is used you might
involve yourself with the complex issue of 'sound' and search
the internet for applicable code in this area.
I think this is why nobody had yet replied.
|
|
|
|
|
EliottA wrote: What exactly are the following datatypes
1. Handle
2. PVOID
3. DWORD
See here.
EliottA wrote: Also, a general question, why use pointers (*) if you can use Addresses (&) to reference objects?
See here.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
|
My app allows users to start a 'helper' applet that runs independently. I am using a mutex to limit this applet to a single instance. I use the mutex both to prevent starting the second instance from my app (by CreateProcess or ShellExecute)AND to have any second instance started outside my (by clicking icons, etc) to self-terminate.
How can I have them switch to the current instance of the applet? That is, if they select to run the applet from my app I don't want to ignore it or display a message that an instance is running. I want to make that instance be get focus and be the top most application.
Thanks,
-G
modified on Wednesday, March 4, 2009 1:39 PM
|
|
|
|
|
Is there some reason you bolded your entire post? I'm so distracted by it I can't even read the post.
|
|
|
|
|
Exactly. That's really harmful to the eyes.
He never answers anyone who replies to him. I've taken to calling him a retard, which is not fair to retards everywhere.-Christian Graus
|
|
|
|
|
Not intentionally.
That is how the post came up when I started it. I thought the preview just came that way. Reviewing it, I see that there as indeed a bold tag around it all, which I have since removed (I hope)
Sorry.
-G
|
|
|
|
|
negativeG wrote: I want to make that instance be get focus and be the top most application.
SetWindowPos()[^]
|
|
|
|
|
Sure, but how do I find the hWnd for the Applet (it is a dialog based) from my App?
There is some recourse if I start the Applet from my App using CreateProcess, but if it is run from the command line, my app has no knowledge of it.
-G
|
|
|
|
|
negativeG wrote: Sure, but how do I find the hWnd for the Applet (it is a dialog based) from my App?
Ah, a new question. Sorry I mistook you for someone that had a clue about what they were doing.
Good luck.
|
|
|
|
|
negativeG wrote: I want to make that instance be get focus and be the top most application.
See the InitInstance() method in this example.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Thanks!
I had to massage it a little since I have a Dialog based app, but it is working great now!
-G
|
|
|
|
|
|
If you're using Visual Studio 2003 or later, it might be easier to use CImage[^], as that has built-in 'save as jpeg' functionality?
alexhalt wrote: But at this line
(void)jpeg_write_scanlines( &cinfo,
jsmpArray,
cinfo.image_height );
I've got the following error
Improper call to jpeg library in state 100
Looking at the code for libjpeg, 100 is the 'initialisation' state. This error would be raised by jpeg_write_scanlines if you hadn't called jpeg_start_compress.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|