|
If u get it then pls email me the
header and the dll file
as i cannot download the 300+MB of
SDK platform for those files
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
its better you install the SDK, you will then keep looking for other header fiels and other dll and libs.
-Prakash
|
|
|
|
|
Ok thanks prakash
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
vikas amin wrote: as i cannot download the 300+MB of
SDK platform for those files
HI Vikas,
as you working for company, they must have MSDN subscription, there you can find cd containing copy od PSDK and other related Plateform Update
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Hi there, Iv wrote a program to transfer files between a cleint and a server,the code works fine for small files but not for large files,im going to post the code wich i hope will help other people trying to do something similar and in hope that i can get some suggestions on how to improve the code iv wrote.
{
char *buffer;
char sizebuf[20] = "";
long SizeOfFile = 1;
long BytesSent = 0;
std::ifstream file ("C:\\Windows\\Example.exe" std::ios::in | std::ios::binary | std::ios::ate);
if (!file)
{
MessageBox(NULL,"Error Opening File",NULL,MB_OK);
}
SizeOfFile = file.tellg(); //get size of file
file.seekg (0, std::ios::beg);
ltoa(SizeOfFile,sizebuf,10); //put sizeoffile in char buf
send(newsock,sizebuf,strlen(sizebuf),0);//send the size to client
buffer = new char[SizeOfFile];
file.read (buffer,SizeOfFile).eof();
do{
BytesSent = send(newsock,buffer,SizeOfFile,0);
}while(BytesSent < SizeOfFile);
Here i dont know if i should be reading blocks of the file into the buffer in the do while loop or out side of the loop and i dont know how to equally divide the file into "Chunks" to be sent separatly and rebuilt the other side help would be appriciated
{
char buffer[20];
long SizeOfFile = 0;
char* recvfilebuf;
recv(Socket,buffer,sizeof(buffer),0); //recv size of file to be d/l
SizeOfFile = atol(buffer);
ZeroMemory(buffer,20);
recvfileBuf = new char[SizeOfFile];
std::fstream file (C:\\Example.exe, std::ios::out | std::ios::binary | std::ios::ate); //Dir of our new .exe
if (!file)
{
MessageBox(NULL,"Error Opening File",MB_OK);
}
do
{
recieved = recv(Socket,recvfileBuf,SizeOfFile,0); //recv actuall file
file.write(recvfileBuf,recieved).eof(); //write new file
}while(recieved < SizeOfFile);
ZeroMemory(buffer,20);
}
I know there is a better way of doing what im trying to do but its hard without extensive know how on the subject..Any comments would be greatly apriciated
Thankyou
|
|
|
|
|
thes3cr3t1 wrote: the code works fine for small files but not for large files
Why not? What are you (not) seeing that is wrong?
thes3cr3t1 wrote: file.read (buffer,SizeOfFile).eof();
What is this?
thes3cr3t1 wrote: Here i dont know if i should be reading blocks of the file into the buffer in the do while loop...
Yes you should, unless you are reading all of the file at once.
"The words of God are not like the oak leaf which dies and falls to the earth, but like the pine tree which stays green forever." - Native American Proverb
|
|
|
|
|
It looks like you typed this off the top of your head, because the example would not work as is.
The do while for recieving and writing data will probably go into an infinite loop, because recieved will probably never be greater than or equal to SizeOfFile . recv may only be reading the amount of data that is currently available (per documentation), that may be less than the whole file, so you need to read it in chunks and use a seperate variable to keep track of the total amount read.
Some thing like the following should work:
int written;
int recieved_so_far = 0;
do {
recieved = recv(...);
if( recieved == 0 ) {
continue;
}
else if( recieved < 0 ) {
}
recieved_so_far += recieved;
written = file.sputn(recfileBuf,recieved);
if( written != recieved )
} while( recieved_so_far < SizeOfFile );
Good luck!
INTP
Every thing is relative...
|
|
|
|
|
How can I prevent a dos box appearing on screen when I run a batch file? I want it to run invisibly in the background.
Same question for a .exe
Thanks
KevinSheedy
|
|
|
|
|
http://www.codeproject.com/win32/runsilent.asp[^]
Love Forgives--Love Gives--Jesus is Love <marquee direction="up" height="50" scrolldelay="1" step="1" scrollamount="1" style="background-color:'#44ccff'">
--Owner Drawn
--Nothing special
--Defeat is temporary but surrender is permanent
--Never say quits
--Jesus is Lord
|
|
|
|
|
Hi!
I have some problems with this class. This class is implemented in a dll and it is called in own thread (GUIThread()). In GUIThread(): OleInitialize(NULL) is called, after main dll function (dllMain()) is called, and then dllMain() exits OleUninitialize() is called.
So:
- The 'this' pointer is not the same, for example, in OnInitDialog() and in a hmtl event-handling function, and I would like to refer to 'this' pointer, the application is aborted with a memory error.
- If GUIThread() is finished and I would like to run this thread again, the program aborted with a memory error, or some thread, which were started by MFC when CHtmlDialog class was used at first, isn't finished and there will be memory leaks.
Any ideas?
Balage
|
|
|
|
|
I want to print using the CView ,
when the Appliaction is open to view
the frame ,the size of font is fine
visible and in perfect size.
But when i give print preview the
size decreases , and also in print
the smae size is visible .
Can anyone give me some good link on
print and printpreview using the CScrollview
or CView.
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
http://www.codeproject.com/printing/printingtricksandtips.asp
|
|
|
|
|
Thanks
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
How do you run a batch file or another executable using C/C++?
Thanks
KevinSheedy
|
|
|
|
|
system("cmd.exe");
Love Forgives--Love Gives--Jesus is Love <marquee direction="up" height="50" scrolldelay="1" step="1" scrollamount="1" style="background-color:'#44ccff'">
--Owner Drawn
--Nothing special
--Defeat is temporary but surrender is permanent
--Never say quits
--Jesus is Lord
|
|
|
|
|
KevinSheedy wrote: How do you run a batch file or another executable
See ShellExecute
ShellExecute[^]
ZeePain! wrote: This seems like one of those programs that started small, grew incrementally, building internal pressure, and finally barfed all over its source code sneakers. Or something.
thedailywtf.com[^]
|
|
|
|
|
|
Is there a simple function or class for getting the time in windows? The simpler the better.
Thanks
KevinSheedy
|
|
|
|
|
CTime time = CTime::GetCurrentTime();
CString csTime = time.Format("%H:%M:%S");
MessageBox(csTime);
Love Forgives--Love Gives--Jesus is Love <marquee direction="up" height="50" scrolldelay="1" step="1" scrollamount="1" style="background-color:'#44ccff'">
--Owner Drawn
--Nothing special
--Defeat is temporary but surrender is permanent
--Never say quits
--Jesus is Lord
|
|
|
|
|
Also can use COleDateTime::GetCurrentTime()
Anilkumar
|
|
|
|
|
|
KevinSheedy wrote: Is there a simple function or class for getting the time in windows? The simpler the better.
CTime sTime=CTime::GetCurrentTime();
or
SYSTEMTIME systime;
ZeroMemory(&systime,sizeof(systime));
GetLocalTime(&systime);
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
I am using Visual C++ 6.0 and I am trying to learn about sdi but
my vc does not support code like:
(CProgNameView*)...
What could be done?
BB
-- modified at 4:20 Thursday 5th January, 2006
|
|
|
|
|
While creating the SDI aplication you need to select the baseclass of the view as CHtmlView
-Prakash
|
|
|
|
|