|
A Senior Software Developer should be able to evaluate C++ and C#.
|
|
|
|
|
I have a VS2005 (WinXP) project that compiles perfectly with zero warnings or errors that i recently migrated to VS2008 (Vista), and on initial compile i got these three errors:
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\netioapi.h(155) : error C2146: syntax error : missing ';' before identifier 'PhysicalMediumType'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\netioapi.h(155) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\netioapi.h(155) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
And i can't figure out what is causing it. I know it's related to network I/O, but not sure what inparticular. Anyone have any suggestions?
Thanks!
|
|
|
|
|
You need to #include
ntddndis.h
or
netioapi.h
Best Wishes,
-David Delaune
|
|
|
|
|
You'll need to get your header files in order.
At the line the errors occur, the compiler does not recognize the "PhysicalMediumType"
type. You need to examine the header files (including nesed ones) above that line to
find out why.
maybe some info here will help[^]
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
hi
I made a listview control with LVS_REPORT style .......
My task is when i select any item from the listview control and delete it....the focus should go on to the next item......not only focus but next item should be selected......
Thanx in advance
AbidBhat
|
|
|
|
|
Have you looked into the LVM_SETITEM and/or LVM_SETITEMSTATE messages?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi all,
I am writing a multi-threaded program that runs multiple Ftp clients with different transfer types to connect to different ftp servers. The general sequence of each session is:
CInternetSession::CInternetSession ();
CInternetSession::GetFtpConnection ();
.....
Do all kinds of weird and wonderfull things like get, put, pwd etc.
.....
CFtoConnection::Close ();
delete m_FtpConnection;
CInternetSession::Close ();
delete m_Session;
Basically it all works as expected. The only problem is that the ftp server's log always ends with:
0325 15:05:12 (00000984) 172.29.9.67 connection aborted
0325 15:05:12 (00000984) 172.29.9.67 connection closed
and I don't like the "connection aborted" part, since my clients will probably come back to me asking what the hell is going on here!!!!
It does not matter if I remove the close statements or the delete statements. Only when I remove the whole close and delete part, will I not get the aborted message. I then however also not get the "connection closed", so that in a next cycle the ftp server's log show things like:
0325 14:24:20 (00000fa8) 172.29.9.67 connection reset
0325 14:24:20 (00000fa8) 172.29.9.67 connection closed
When I use the standard window ftp manually and do something there, then I see a log like:
0325 14:52:05 (00001084) NBK0188.cew.centric.lan D(0) 172.29.9.67 user1 QUIT
0325 14:52:05 (00001084) NBK0188.cew.centric.lan S(0) 172.29.9.67 user1 logoff R D P
0325 14:52:05 (00001084) 172.29.9.67 connection closed
0325 14:59:38 (000017a8) 172.29.9.67:2235 connected to 172.29.9.67:21
The quit probably coming from the "bye" command, however I do not see any equivalent in the CFtpConnection or CInternetSession classes.
Does anyone have any bright ideas on the subject? Would be greatly apreciated!
Thanks in advance,
William
|
|
|
|
|
William Engberts wrote: The quit probably coming from the "bye" command, however I do not see any equivalent in the CFtpConnection or CInternetSession classes.
You are kidding right?[^]
led mike
|
|
|
|
|
Sorry, I wish I were, but alas there is no "Quit" routine. There is a close which I obviously use, but that one results in the "Connection aborted" line in the ftp server's trace (although I am not sure weather it is the connection's close of the session's close)
Regards,
William
|
|
|
|
|
Um William, did you even look at the link in my post? It's to the documentation for the Command(...) method so you can send a bye command to the server.
led mike
|
|
|
|
|
Mike,
Sorry, I missed the link. It however turns out that, since I am working with Studio 6, the CFtpConnection does not (yet) know the Command method. The article however refers to the separate FtpCommand instruction, and that indeed does the trick and solves my problem. Thanks a lot!!
William
|
|
|
|
|
Glad you got a solution. In future posts include that information about VC6 up front. Most people are not going to know you are using it unless you tell them.
led mike
|
|
|
|
|
First let me say that I am not a CInternetSession expert, simply because I generally migrate to the lower levels of development. However with that being said I can make a guess to what is happening based on the error message you have posted.
You see, when you attempt to open a connection... a three way handshake takes place. Here is a fairly good visual explanation:
http://www.youtube.com/watch?v=z40w3G8szK0[^]
And when you close the connection you must also wait for a handshake sequence to complete. Unfortunately I could not find a video for this. Maybe this URL will suffice:
http://www.freesoft.org/CIE/Course/Section4/11.htm[^]
Here is Microsofts detailed explanation on the whole thing.
http://support.microsoft.com/kb/172983[^]
In laymens terms... when you close() a connection. What is happening is that a message called FIN is sent to the other side and your client goes into a FIN_WAIT state. At this point it is waiting for the other side to respond. Unfortunately with your code:
CInternetSession::Close ();
delete m_Session;
You are probably deleting the object before it has completed the connection termination handshake.
I believe you need to implement a status callback:
http://msdn2.microsoft.com/en-us/library/73cf84cs(VS.80).aspx[^]
And inside OnStatusCallback() you need to wait for INTERNET_STATUS_CONNECTION_CLOSED status.
http://msdn2.microsoft.com/en-us/library/4bwy8hw5.aspx[^]
Best Wishes,
-David Delaune
|
|
|
|
|
I have writen code as
BOOL bResult = fileFind.FindFile(strFilePath);
if(bResult)
{
bResult = fileFind.FindNextFile();
CTime createTime;
CTime modTime;
fileFind.GetCreationTime(createTime);
fileFind.GetLastWriteTime(modTime);
CString strCreateTime = createTime.Format("%H:%M:%S, %A, %B, %d, %Y");
CString strModifyTime = modTime.Format("%H:%M:%S, %A, %B, %d, %Y");
}
but I am getting wrong values as
Thursday, January, 01, 1970
Please help me to solve this problem
|
|
|
|
|
It sounds like you're unable to even get these values. I bet the CTime int values is 0.
What exactly do you mean by "remote files"?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<a href="http://www.soonr.com">SoonR Inc -- PC Power delivered to your phone</a>
|
|
|
|
|
Hi Dudes am developing NDIS driver can any one guide me with step by step development of NDIS DRIVER. in "C" on winCE platform. As am a freshier i dont know how to develop ndis driver.
THANKS IN ADVANCE.
|
|
|
|
|
Hi there,
You should ask this question in the Hardware / Device Drivers forum[^] and I will attempt to assist you there. When you move your question into the correct forum, you should be more specific with the query. For example, what type of NDIS driver... filter... miniport... passthrough. You should probably just play around with the samples provided in the Microsoft DDK first.
Best Wishes.
-David Delaune
|
|
|
|
|
I want to start the new process from the winodws service with currently logged in user credential(token) - Like using CreateProcessAsUser
Note: I dont want to use CreateProcesswithLogon as it needs Password, and we cant access the Password in service.
Also, I want to start the process only if some user in logged in to the terminal.
any ways to do this task ?
|
|
|
|
|
Dear geniuses,
Would you guys please teach me how to call a c program, which is a source code of C actually, from MFC/C++? Is it possible to call "mpeg2dec.dsw", which is the program that i wanna call, from the situation below??
void CMP3Dlg::OnBnClickedMpegdecoder()
{
// TODO: Add your control notification handler code here
}
Thank you
John
|
|
|
|
|
Assuming mpeg2dec.dsw has c functions that you want to call from your MFC app,
Why don't search it Calling C from C++[^]
Basically it involves avoiding C++ name-mangling by specifying the linkage specifier as C for C module. see Using extern to Specify Linkage[^]
if the mpeg2dec project has header files for those functions you are interested in your C++ program. specify the linkage as C in your C++ files.
extern "C" {
#include "mpeg2dec.h"
}
|
|
|
|
|
johndoelee wrote: Would you guys please teach me how to call a c program, which is a source code of C actually, from MFC/C++? Is it possible to call "mpeg2dec.dsw", which is the program that i wanna call, from the situation below??
The above make little sense.
What do you want to do? Do you need to call an executable? Do you need to invoke exported functions of a library?
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
|
|
|
|
|
To start up another program (e.g., Visual Studio) via code, see here.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Dear David,
I can successfully implement the program that I wanna call after adopting the method you suggested. Thank you!
Best regards,
John
|
|
|
|
|
Dear all,
Thank you for the suggestions from you guys.
Actually, I added a button on the GUI, which is the source code from Mr. Tahir Naeem from http://www.codeproject.com/KB/cpp/media_player.aspx[^]. That button is designed to call an exe from a C project for mpeg2 decodng.
For testing the program, I tried to call windows messenger by the program. The path of MSN is tested and can be called by cmd. The mpeg2dec.exe can be run at cmd as well.
However, the trials still don't work after I copied and modified the code form the suggested webpages from you guys added inside the OnBnClickedMpegdecoder(). I tried extern "C"{}, WinExec () and ShellExecute (). No window for MSN login can be displayed.
Where should I add the exe calling command? Is it inside the OnBnClickedMpegdecoder()?
I am sorry to bother your guys again as I'm a programming beginner. Grazie!
John
|
|
|
|
|
Just include required header files in c code, that is all
It is never late to learn
|
|
|
|