|
Still learning how to code wrote: What header file is required and where can I get it ?
It would really help if you stated what compiler you are using. I suspect that you need to install the Platform SDK or Windows SDK. You should also check the value of your _WIN32_WINNT and _WIN32_IE preprocessor definitions.
Best Wishes,
-David Delaune
|
|
|
|
|
Hi David,
I am running VC++ Ver 6.0
Having followed Luc's advice (see above), I visited the forum postings associated with the article. Within that there was a posting concerning compile errors similar to mine, and the author stated that it was simply a matter of changing the order of header and library directories to make PSDK at the top. Looking in Tools/Options/Directories, I could not see PSDK listed and therefore believe that this is my problem. So I downloaded Microsoft Platform SDK (R2) which seemed to be supported in my OS, WinXP. Only after the download and install, I see early within the documentation:-
Warning You cannot use the libraries from the current Platform SDK with Visual C/C++ 6.0 because the libraries were compiled using the new /GS switch to enable buffer overrun detection code. Using libraries compiled with this switch with Visual C/C++ 6.0 results in link errors. Specifically, the linker reports that it cannot find __security_cookie or __security_check_cookie.
I guess that the webpage must have specified this somewhere but I must have missed it.
Any idea how I get to the right version ?
Thanks for your help !
Doug
Edit: XP SP3 by the way !!
|
|
|
|
|
Still learning how to code wrote: I am running VC++ Ver 6.0
I suspected that would be the case. I am also still using VC6 for maintaining my older projects. The Febuary 2003 Platform SDK was the last version compatible with VC6. I would not recommend attempting to use a later version.
*edit*
It actually looks like Microsoft removed them from the public download center according to Sheng Jiang. Here is a Microsoft forum post on the subject:
http://social.msdn.microsoft.com/Forums/en/windowssdk/thread/83205c43-ef46-447d-ae54-92bbeb543c38[^]
Get it while you can...
Best Wishes,
-David Delaune
modified on Sunday, November 28, 2010 5:32 PM
|
|
|
|
|
Hi David, I saw somewhere on the web that the last PSDK compatible with VC6 was "the February 2003 version". This is surely the version prior to R2 (as the latter is a problem for VC6) isn't it ?
I think that it also said the Feb 2003 version wasn't available from MS on the web ! So where can I get it ?
Doug
|
|
|
|
|
Whoops, sorry about that... looks like I linked to the wrong SDK. One sec, I'll edit the post and fix it.
*edit*
I could not find the febuary 2003 version at the public Microsoft download center. However I did find some direct links in the Microsoft forums. You should get it while its still available...
You should probably get the SP6 as well if you don't already have it installed.
Visual Studio 6 Service Pack 6[^]
Best Wishes,
-David Delaune
modified on Sunday, November 28, 2010 5:39 PM
|
|
|
|
|
Still learning how to code wrote: Then if the control needs attention, I can write an asterisk character to the associated edit box. Although this works, it would be more noticeable if the asterisk had a foreground colour other than black (e.g. red).
See here.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
Hi David, Thanks very much for bringing this to my attention - looks very interesting and useful article. Why didn't I think of changing the background colour of the control rather than the foreground (retorical question !). It does raise my original point though - why CAN't you change the foreground colour (or have I missed it ?) ?
Doug
|
|
|
|
|
Still learning how to code wrote: It does raise my original point though - why CAN't you change the foreground colour (or have I missed it ?) ?
Call SetTextColor() instead of SetBkColor() .
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
Of course ! (Just going though the code now, and beginning to see how to about this)
Thanks for your help !
Doug
|
|
|
|
|
Hi,
I need to develop a program which will copy files to a user specified destination.I evaluated SHFileOperation function. but it does not provide an option to display custom progress bar. Is there any way other function which will allow to display custom progress bar during file copy.
Thanks,
John.
|
|
|
|
|
You could use basic read and write functions to copy the data and thus manage your progress bar within your own program. It does mean that you will have to do a little more work yourself but everything has a price.
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
|
I had a nagging feeling I had missed something obvious; thanks for the reminder.
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
|
Hello, How can i use Lpt Capture on Windows 98 to capture lpt1 port data sended from dos application.
Thank's for your help.
|
|
|
|
|
Hi all ! I'm working at chat client/server likes yahoo. I have some trouble while sending a file to server and then distributes to others client.
Here is my code : On client
void CSimpleChatClientDlg::OnBnClickedButton1()
{
CFileDialog FileDialog(TRUE,
"*.*",
NULL,
OFN_HIDEREADONLY,
"Any Files (*.*)|*.*||");
if(FileDialog.DoModal() == IDOK)
{
UpdateData(TRUE);
CString PathName ="SHARE:ALL:" + FileDialog.GetPathName();
int Len=PathName.GetLength();
char* sendBuff=new char[Len+1];
strcpy(sendBuff,LPCTSTR(PathName));
send(sClient,(char*)&Len,sizeof(Len),0);
send(sClient,(char*)sendBuff,Len,0);
long nRead = 0;
BYTE byBuffer[BUFFER_SIZE];
CString strPath = FileDialog.GetPathName();
CFile myFile;
myFile.Open(strPath, CFile::modeRead | CFile::typeBinary);
long fileLen = myFile.GetLength();
send(sClient,(char*)&fileLen,sizeof(fileLen),0);
int count = 0;
while (true)
{
nRead = myFile.Read( byBuffer, BUFFER_SIZE );
if(nRead > 0)
{
if(nRead < BUFFER_SIZE)
send(sClient,(char*)&byBuffer,fileLen,0);
else
send(sClient,(char*)&byBuffer,BUFFER_SIZE,0);
}
else
break;
}
myFile.Close();
UpdateData(FALSE);
delete sendBuff;
}
}
On the Server
if(des_name.Compare("SHARE")==0)
{
i=Cbuff.Find(':');
des_name=Cbuff.Left(i);
mess=Cbuff.Right(Cbuff.GetLength() - i - 1);
if(des_name.Compare("ALL")==0)
{
CFile file;
file.Open(mess,CFile::modeWrite | CFile::typeBinary);
long lenFile=recv(sock.sk,buffer,buffLength,0);
long nfilerecv=0;
while(nfilerecv < lenFile)
{
nfilerecv += recv(sock.sk,buffer,buffLength,0);
}
m_msgString+=name_array[i_send];
m_msgString+=":";
m_msgString+=mess;
m_msgString+="\r\n";
UpdateData(FALSE);
}
else
UpdateData(FALSE);
delete buffer;
return;
}
I have send the exact len of the file but i can not receive the file on server. Is there anyone can help me !
|
|
|
|
|
Looking at your server code above you seem to have some lines missing. You also say "I have some trouble while sending", but we have no real idea what trouble; try explaining your problem in some more detail rather than expecting us to analyse your code without really knowing what we are looking for.
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
Honestly, i have no idea for receiving data from client. Although i can send the byte of the file, but set up buffer to receive file is ... The code from server site is just like the code i use to transfer text messages . If s.o could help me on that. I really appreciate.
Thanks !
P/s . I used winsock2 library to do this project, not CSocket likes some projects that had proble likes me before.
|
|
|
|
|
As I said before look at your server code; this is what you have:
while(nfilerecv < lenFile)
{
nfilerecv += recv(sock.sk,buffer,buffLength,0);
}
m_msgString+=name_array[i_send];
m_msgString+=":";
m_msgString+=mess;
m_msgString+="\r\n";
UpdateData(FALSE);
}
else
UpdateData(FALSE);
delete buffer;
return;
}
There is obviously an if statement missing there so I have no idea what you are trying to do in the missing code. There is nothing special about transferring the contents of a file between two systems. You just need to tell the receiving system how much data to expect so it waits until everything is received, and this would normally be done within a loop of continuous recv() calls, until either the total amount of data is transferred or some other indication that the transfer is complete.
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
Just out of curiousity, what do you think this line does?
long lenFile=recv(sock.sk,buffer,buffLength,0); Hint: it does not set lenFile to the value you sent with this sequence
long fileLen = myFile.GetLength();
send(sClient,(char*)&fileLen,sizeof(fileLen),0); If you're lucky, it returns 4 (see here[^]).
|
|
|
|
|
Hello all;
I am writing a tiny phone book program using classes.
using namespace std;
class phonebook{
public :
void add_new();
private :
char *name;
char *family;
};
void phonebook::add_new(){
phonebook *temp=new phonebook;
cin >> temp->name;
cin >> temp->family;
}
int main(int argc, char *argv[])
{
phonebook::add_new();
system("PAUSE");
return EXIT_SUCCESS;
}
Any work I do; I can't get a name and family. my program should be dynamic.
What should I do to get response?
Thanks in advance...
|
|
|
|
|
Since your code will not even compil e successfully it is little wonder it doesn't work. You are making a static call to a non-static method (phonebook::add_new(); ), which is invalid.
Try looking at your design here, every time you call add_new() you create a new phonebook object but you do not save it anywhere. Consider the contents of a real phonebook, the book contains entries and each entry contains names and numbers. So you need a collection of some sort to hold all your entries; this could be a class or one of the STL types. Perhaps you should try this without using classes as a first attempt to get the concepts right and then convert to classes later.
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
Hi all,
i m using MCIWnd function to play sound file.
when i m execute the command MCIWndPlay,its increase the threads counter but not decrese the thread counter even sound is end now.
please tell me can i find sound play by MCIWndPlay is end now or how can i close this thread.
or there is any method by which thread is automatically end when sound is finish.
please help me for this.
thanks in advance.
|
|
|
|
|
You may need to use the wait flag to wait until the operation completes. I think the test and notify are alternative options, but you need to read the documentation[^] for full details.
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
How can I load put a swf in resources and how to load it?
Currently I am adding swf in resouces using "Add -> Resources", what type should I choose there?
I am using put_Movie function to load swf. It's working fine with external swf but I want to put swf in resources; this function accepts BSTR as argument which is path of swf so what I will give there. I am expecting something like
put_Movie(L"res://myswf.swf/#2/#234");
|
|
|
|