|
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
|
|
|
|
|
Hi All
I am try to edit regedit values in VISTA OS.It is working when UAC off.But when UAC is on then it's not working.Code is here
HKEY hKey;
DWORD dwDisp = 0;
LPDWORD lpdwDisp = &dwDisp;
CString l_strExampleKey = "SYSTEM\\CurrentControlSet\\Services\\USBSTOR";
CString l_strDWordSample = "Start";
DWORD dwVal = 4;
LONG iSuccess = RegOpenKeyEx (HKEY_LOCAL_MACHINE, "SYSTEM\\CurrentControlSet\\Services\\USBSTOR", 0L, KEY_READ , &hKey);
if(iSuccess == ERROR_SUCCESS)
{
RegCreateKeyEx( HKEY_LOCAL_MACHINE, l_strExampleKey, 0L,NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hKey,lpdwDisp);
RegSetValueEx (hKey, l_strDWordSample, 0L, REG_DWORD,(CONST BYTE*) &dwVal, sizeof(DWORD));
}
RegCloseKey(hKey);
Plz help me where i am wrong..
Thanks in advance
|
|
|
|
|
See here[^]
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Hi all,
I'm wired with this two days now.
In a chr* buffer I got a int in ASCII.
I want to convert into UNICODE and attach a stringstream, which is a UNICODE stream.
How can I do it.
Help really appreciate.
Thanks a lot,
I appreciate your help all the time...
CodingLover
|
|
|
|
|
CodingLover wrote:
I want to convert into UNICODE...
Check out wchar_t .
"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
|
|
|
|
|
Check out [^] and [^].
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]
|
|
|
|