|
"Great job, team. Head back to base for debriefing and cocktails."
(Spottswoode "Team America")
|
|
|
|
|
Hi all
Could anyone please show me a good link which gives an in depth study of C++, i mean how the storage occurs, how an object is kept in memory, how all the things are done under ground.
Regards
The Best Religion is Science.
Once you understand it, you will know God.
|
|
|
|
|
|
The Best Religion is Science.
Once you understand it, you will know God.
|
|
|
|
|
Imho, you're more likely to find this kind of information in a textbook.
/ravi
|
|
|
|
|
Those were old days......felt we will find everything on the net
The Best Religion is Science.
Once you understand it, you will know God.
|
|
|
|
|
|
hi i tried to set the ip address using netsh as
UpdateData(TRUE);
CString para3 ;
para3.Format(( "Local Area Connection"));
CString ipadd;
ipadd.Format(_T("%s"),m_IpAddress);
HINSTANCE hInt;
CString command;
command.Format(("/cnetsh interface ip set address name=%s static %s %s %s 1"),para3,m_pIpadd,m_subnet,m_gateway);
system(command);
the values are from editboxes.is anything wrong with this code. this havent set the ip.
Arise Awake Stop Not Till ur Goal is Reached.
|
|
|
|
|
deeps_cute wrote: CString para3 ;
para3.Format(( "Local Area Connection"));
It is not necessary to call Format() . Just assign the string literal directly.
deeps_cute wrote: CString ipadd;
ipadd.Format(_T("%s"),m_IpAddress);
ipadd is not used. Is that intentional?
deeps_cute wrote: system(command);
Is the value of command correct at this point?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
yes i assigned the value of m_ipadd directly. the vale returned from command is correct.
UpdateData(TRUE);
char para2[1024];
strcpy (para2, "\"Local Area Connection\" ");
CString command;
command.Format(_T("netsh interface ip set address name=%s static %s %s %s 1"),para3,m_IpAddress,m_subnet,m_gateway);
system(command);
Arise Awake Stop Not Till ur Goal is Reached.
|
|
|
|
|
deeps_cute wrote: the vale returned from command is correct.
The value returned by system() is an integer which is zero or one of E2BIG, ENOENT, ENOEXEC or ENOMEM. I suspect you meant to capture the text output of the call. If that's the case, you may want to see this[^] article.
Corrected article link[^]
/ravi
|
|
|
|
|
thats nice but whats the case when we use shellexecute instead of system("")
-- modified at 11:59 Tuesday 6th March, 2007
Arise Awake Stop Not Till ur Goal is Reached.
|
|
|
|
|
deeps_cute wrote: thats nice but whats the case when we use shellexecute instead of system("")
As MSDN says, system() passes a command to the command interpreter, which executes the string as an operating-system command while ShellExecute() performs an operation on a file.
/ravi
|
|
|
|
|
Sorry, I pointed you to a C# article. See this[^] article instead.
/ravi
|
|
|
|
|
deeps_cute wrote: char para2[1024];
strcpy (para2, "\"Local Area Connection\" ");
You went from bad to worse. What's wrong with:
CString para2(\"Local Area Connection\"); or
CString para2 = "\"Local Area Connection\""; deeps_cute wrote: the vale returned from command is correct.
So what is it? You should be able to take the exact string (i.e., the contents of command ), paste it into a command prompt, and get the desired results. If not, then command is not formatted properly.
deeps_cute wrote: command.Format(_T("netsh interface ip set address name=%s static %s %s %s 1"),para3,m_IpAddress,m_subnet,m_gateway);
Is the value of para3 the same as it was in your initial post?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
yes it is the same.the value of command is "netsh interface ip set address name="Local Area Connection" satic 192.168.168.110 255.255.255.5 192.168.168.168. but it havent set the ipaddress
Arise Awake Stop Not Till ur Goal is Reached.
|
|
|
|
|
deeps_cute wrote: netsh interface ip set address name="Local Area Connection" satic 192.168.168.110 255.255.255.5 192.168.168.168
Can you issue this at a command prompt?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I need to make my toolbar active by default in explorer after setup.
Johny
|
|
|
|
|
In single-thread application
------------------------------
SetTimer(hwnd, 1, 10, (TIMERPROC) NULL); <br />
<br />
... OnTimer(...)<br />
{<br />
Fun();<br />
}<br />
<br />
void fun()<br />
{<br />
......<br />
} ------------------------------
If fun() run slow, fun() will read write global variable, need like multiple-thread add read-write lock? This example use EnterCriticalSection, LeaveCriticalSection or which API function best?
If fun() not read write global variable, when it will use lock and unlock?
thanks.
|
|
|
|
|
mfc_dialog wrote: In single-thread application
...
need like multiple-thread add read-write lock?
I don't really understand what you mean, it's not clear to me whether your application is single-threaded or multi-threaded.
As always when different threads are accessing the same data the threads have to be synchronized. Using ::EnterCriticalSection() and ::LeaveCriticalSection() is a good choice.
If your application is single-threaded there's no need for thread synchronization since all data will be both read and written by the one and only thread.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
Is it true that VS6 doesn't allow you to use template member functions in a non-template class? I keep getting a "C2893: Failed to specialize function template" error.
|
|
|
|
|
Steve_Harris wrote: C2893:
I think, this error is part of post VS6 compilers. Can you show code, causing this error ?
This error occurs if, compiler cannot instantiate any of template type.
|
|
|
|
|
the VS6 compiler is far from beeing a recent compiler, and I would not be surprised that it will not support some more modern constructs like those.
|
|
|
|
|
I believe MSVC6 allows this. Can you post the code in question?
Steve
|
|
|
|
|
HI all
I have a piece of code in C which fails . This function tries to open a .wav file ..
The function is
int audio_file =open(filename,flag,AUDIO_PERMISSION);
if(audio_file<0)
{
\\ ...failure to open file so restart the CPU
}
The return value as defined in errno.h is EMFILE=24 => "Too many files opened"
What could be the reason for this failure and how to prevent it ? This problem has not been reproduced by me but only at a customer's site .
Can anyone please help me ?
redindian
|
|
|
|