|
That's why I stated read the link CAREFULLY
You can link all your modules to the MFC libraries statically, but the restriction
I mentioned applies...
every module - EXE or DLL - gets its OWN MFC library. That means you can't pass
any MFC objects between modules. You can't even pass a CWnd to be the parent of
one of your dialog DLLs. Every module gets its own CRT as well, so each has its own heap.
There's no such thing as a "static DLL". We're discussing how MFC is linked TO your DLL.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Well, I can't use DLL's then, because CMainFrame passes CWnd to all my dialogs for loading. So I can't use DLL's. I guess DLL's are useful somehow, but I simply can't use them. Thanks for your help though.
A C++ programming language novice, but striving to learn
|
|
|
|
|
If you're linking everything statically, why not make a static library
to hold the common dialogs?
You'll have to make sure resource IDs in the library don't clash with
resource IDs in modules that use the library.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Mark, I don't know how? Can you tell me how? or point me to an example. I wouldn't know where to begin.
In the DLL I just completed, I, out of habit, checked both programs that the DLL would have been used in, to make sure all Controls were different(Resourse ID's). I didn't know you could make a "Static" Library, or what is supposed to be included in one.
A C++ programming language novice, but striving to learn
|
|
|
|
|
I have taken over several MFC projects in VS 6.0 and .NET that use a lot of the same code. I'm wanting to consolidate a lot of the sources files that are the same so that any changes I make will happen to all the other projects using the same code when they are rebuilt. What is the best way to organize this code? Just put them in a separate directory separate from the projects and include them in the project?
|
|
|
|
|
A project on their own and produce a DLL?
|
|
|
|
|
This page shows how to retrieve the command line a certain process was started with http://win32.mvps.org/processes/remthread.html if you know the PID. We have a runtime, a .exe-file. Several instances of the same file will be launched. The only difference between them is the port they’re connected to. The runtime is a CoDeSys runtime which we don’t have the source code for. The application is a CoDeSys (PLC IEC 61131-3) application which logs in to http://localhost:<port number>. (The CoDeSys ENI server occupies the localhost address so IIS cannot run if the ENI server is running.) We want to retrieve the command line arguments which were used when launching each runtime. So the question is: How do you do that if the only thing which differs them is the port of localhost they’re logged in to? How do you find the PID of the process which uses http://127.0.0.1:1200, http://127.0.0.1:1201, http://127.0.0.1:1202, http://127.0.0.1:1203, etc. etc?
|
|
|
|
|
I had a hard time reading your post due to lack of spacing, however, I believe the answer to the question in your title normally within windows is to type the following from a command prompt:
netstat -ano
there is probably a class or library that will make this easy to implement but I'll leave that up to you to google for...
|
|
|
|
|
I'm trying to override the global delete operator.
void operator delete(void* pAddr)
{
...
}
In this method I do some work and then I would like to call the default delete. However
::delete(pAddr)
always call my delete operator. In my code I have to use delete p; which should call my operator but within my operator I would like to call the default system defined delete operator.
Any idea how to call (obtain) the default delete operator?
Thanks,
Abyss
|
|
|
|
|
Abyss wrote: In this method...I would like to call the default delete.
How about calling free(pAddr) instead?
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Not sure if it is OK. My understanding is that a pointer allocated by new operator should be freed by delete and call free on the pointer can cause problems...
|
|
|
|
|
Abyss wrote: My understanding is that a pointer allocated by new operator should be freed by delete and call free on the pointer can cause problems...
True, but since you are also overriding the global new operator (hint: you are doing this, aren't you?), that is not an issue.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
You're too fast...
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]
|
|
|
|
|
delete is a Keyword, NOT a global function
Bram van Kampen
|
|
|
|
|
DavidCrow wrote: you are doing this, aren't you?
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]
|
|
|
|
|
delete is a keyword, not a global function!!!
Bram van Kampen
|
|
|
|
|
Probably you can't. Furthermore, if you override delete then you've also to override new , 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]
|
|
|
|
|
Hmm.
It strikes me that you have reached a language boundary.
Under the cpp model, you can only override functions as follows:;
Member Functions in a Derrived Class with the same Param list,
Member Functions in your original + Derrived Class class with different Param Lists.
Global Functions with different parameter lists.
'delete' is not a global function, but a keyword like 'if' and 'for'
you can override it with your own implementation, but, if you do so, you replace it. That is only possible because it is a keyword. If it were a global function, you would not be able to re-define it at all. (you'd get all types of linker errors)
My advice is: Re-Design the Code.
regards,
Bram van Kampen
|
|
|
|
|
Dear friends
please tell the answer
how many files can be opened in windows OS at a Time ?
by
paul
|
|
|
|
|
there is no such a limitation AFAIK.
IIRC, there is one at Process Level, but I don't know its limit.
I believe you can find it as a #define in some header file (not sure however)
|
|
|
|
|
I am asked by Micorsoft Technical Interview
|
|
|
|
|
Well, then they're interviewing you, not us..
Or you could argue that this is testing your ability to research things.
My answer would be: "If you need to know, your design is wrong".
Iain.
|
|
|
|
|
Does this [^] help?
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]
|
|
|
|
|
paul crescent wrote: how many files can be opened in windows OS at a Time ?
The limit referred to probably is the lowio level of the C Runtime Library which is 2,048 simultaneously opened. Read more here[^].
There are other limitations such as on stdio level, which is 512 by default but can be increased with a call to <a href="http://msdn.microsoft.com/en-us/library/6e3b887c.aspx">_setmaxstdio()</a>[<a href="http://msdn.microsoft.com/en-us/library/6e3b887c.aspx" target="_blank" title="New Window">^</a>] to a maximum of 2,048.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
Well,
There are no more hard and fast limits, unlike DOS, where you had to specify how many. The answer is, that it depends on resources, and what's consumed with each file. It also depends on resources required by the OS.
One answer would be, a Multitude more under XP than under Vista, on the same hardware. The other answer is Depends on the response time reqired. If you measure response time of the computer in weeks, the number would be determined by your disk size
Bram van Kampen
|
|
|
|