|
I prefer the second approach, and namespace is meant for this purpose (avoid name clash). I would suggest if you can group a set of classes, function, user defs... as some software module then declare them with in a namespace rather than declare only the enum within a namespace region. And if you are using the enumeration only within a class then declare the enumeration within the class declaration.
|
|
|
|
|
You've also the following option
class WaveTool
{
public:
enum
{
Sine,
Triangle,
Sawtooth
};
};
i.e. to wrap the enum inside a class that has the responsibility of offering related services.
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
|
|
|
|
|
<br />
m_hThread1 = CreateThread(NULL, 0, ThreadFun1, this, 0, &m_dw1);
m_hThread2 = CreateThread(NULL, 0, ThreadFun2, this, 0, &m_dw2);
How to get thread 1 using memory size when program run.
|
|
|
|
|
yoda speak ?!!?
Sure i am not what talking you are.
Seriously, it depends what the thread is doing; and normally, it's the same way as find finding out
what the current/main thread is doing.
|
|
|
|
|
Maximilien wrote: yoda speak ?!!?
Sure i am not what talking you are.
Or:
What you are talking about, I am not sure of.
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi,
a thread does not use memory, except for its stack;
when it creates some objects, they will occupy some memory, but they do not belong
to the thread, and they sit in the heap, common to all threads of the process.
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
I'm thinking about writing an application to access some unix shares from a windows server, is it possible to create an NFS mount in C++?
|
|
|
|
|
alchong wrote: is it possible to create an NFS mount in C++?
The phrase 'NFS mount' implies a device driver. It is generally not recommended to develop Microsoft Windows device drivers in C++ however it can be done.
Microsoft supplies the IFS Kit[^] for developing file systems and file system filters.
If you however simply want to use something already available (or have some common sense) then perhaps you can use Microsoft Windows Services for UNIX[^] This link will give you a head-start.
http://www.openfree.org/pet/index.php/Mount_an_NFS_share_from_Windows[^]
Best Wishes,
-David Delaune
|
|
|
|
|
David, thanks for the response, I think my question may have been too brief, and I think I should explain what I want to do. Basically there are some shares on a Unix machine that I would like to look at and determine the contents. Currently we run a batch file that maps these shares to a drive letter (on a windows box) I'd like to just automate that and add extra code to do some reporting on the file contents. I was hoping to do this in C++, and that some library out there existed that I could use to map these unix shares. I'd eventually like to make it a web service, but that is the next challenge.
|
|
|
|
|
Are you wanting to access those shares via UNC?
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Yes that's correct, I would like to access it by UNC. Currently we have a batch file that calls some executable nfs.exe ( I think it's a hummingbird's ) which mounts unix shares, which allows us to see those shares from a windows box.
|
|
|
|
|
alchong wrote: Yes that's correct, I would like to access it by UNC.
You appear to have two separate issues here. Mounting shares (using nfs.exe), and accessing them using UNC are not the same thing. For the former, see here. For the latter, unless otherwise indicated, the Win32 API recognizes UNC.
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Thanks for the quick reply, I was thinking about just invoking the executable from an app. I curious if anyone knew if there were any standard WIN32 API that was available.
|
|
|
|
|
alchong wrote: I curious if anyone knew if there were any standard WIN32 API that was available.
Probably, but without knowing what nfs.exe was doing internally, I wouldn't know. You might could use depends.exe to open nfs.exe and see what functions it is importing from the Win32 API. That would give a big clue.
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
|
Are you wanting to rename the file?
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
You have to provide more information. What do you mean by "identity"? By what or whom was the file "banned"?
"It is better to remain silent and be thought a fool, than to open your mouth and remove all doubt."
--Groucho Marx
|
|
|
|
|
|
I have lots of dialogs in my application and these dialogs are used with 1600 1200 resolution. Now, this application is ready to use but i want to run it with different resolutions. I wrote an different application(or function or class with function) to do this and it sets all of controls' size of a dialog as resolution but for only one dialog. How can I apply this solution for all my dialogs? For example May all of my dialogs inherit from my new class(is it a good solution) or what else? Please help.
|
|
|
|
|
The solution is really up to you. How many dialogs do you have?
There are several articles on codeproject dealing with resizable dialogs - they should give you a headstart. But they will require work for every dialog.
I don't see any other way though - how a dialog stretches / shrinks will be very dependent on the job it's doing. ie, You may have a bos asking for some text, with an OK button. You want the text box to change in width, but not the button.
Iain.
Plz sir... CPallini CPallini abuz drugz, plz plz help urgent.
|
|
|
|
|
I think you can use of WM_SIZE.
|
|
|
|
|
I found that early that it's a b-itch to try to find ways to automatically resize dialogs and move controls in a
natural ways ( looking good in different resolution). I tend to make certain the dialogs work in the smallest
resolution supported.
BUT :
If you find a way to way to generalize a behaviour to resize your dialogs that can work for any dialog in your
application, then having a base class that does the resize is a good way to do it.
Good luck.
|
|
|
|
|
mehmetned wrote: I have lots of dialogs in my application
So then that is the actual problem, however I suppose I should assume that for one or more reasons you are not interested in solving that problem. Therefore I would have you look at this.[^] I don't know if I ever tried to use it in Dialogs, probably not since Dialog based apps are lame. However I used it often in MFC View based applications and it works perfectly. It may or may not help you and your thousand dialog problem.
led mike
|
|
|
|
|
I use a toolbar and a richedit control in a dialog to do some text edting.
A common scenario is:
the user select some text, then go to the toolbar to click some button.
But my problem is that as soon as the user click the toolbar, the selection in richedit control disappear, which make the user puzzled.
How can I keep the selection visible even if the focus is not in the rich edit?
|
|
|
|
|
The rich edit inherits most of its styles from normal edit.
Try using the ES_NOHIDESEL style, and see if it helps.
Iain.
Plz sir... CPallini CPallini abuz drugz, plz plz help urgent.
|
|
|
|