|
Aljechin wrote: Eg: catch(CFileException Cfe)
it is a bad practice to catch exceptions by value (except for integral types)
Aljechin wrote: There is one API call known as GetLastError for this purpose
it will not return details of exception. it is a Win API to retrieve last Win32 error for the current thread.
also, microsoft specific TRY/CATCH should be avoided, and standard try/catch used instead, for reasons stated here[^]
|
|
|
|
|
Hi guies,
I am new to VC++.
I have to write a code which contain connect method and which connect's
to server.
Anyone can give me that procedure,Pl'z.(which contains connect method).
yuwraj
|
|
|
|
|
http://www.codeproject.com/internet/winsockintro02.asp
never say die
|
|
|
|
|
it would help if you could be more specific in your questions, what kind of server, etc.
if you are talking about connecting through sockets, have a look at this[^] article. also, try google, it should return thousands of hits on this topic
|
|
|
|
|
|
Yuwraj wrote: I have to write a code which contain connect method and which connect's
to server.
How about NetUseAdd() or WNetAddConnection2() ?
"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
|
|
|
|
|
Hi,
I want to findout whether notepad.exe is running in taskmanager or not. if i create a process to open notepad.exe then i can find process id and close it, but i am not opening notepad.exe through process.
pls help me, waiting 4 ur reply
bye
trinadh
|
|
|
|
|
Here is an example...
#include <windows.h>
#include <stdio.h>
#include "psapi.h"
void PrintProcessNameAndID( DWORD processID )
{
char szProcessName[MAX_PATH] = "unknown";
HANDLE hProcess = OpenProcess( PROCESS_QUERY_INFORMATION |
PROCESS_VM_READ,
FALSE, processID );
if (NULL != hProcess )
{
HMODULE hMod;
DWORD cbNeeded;
if ( EnumProcessModules( hProcess, &hMod, sizeof(hMod),
&cbNeeded) )
{
GetModuleBaseName( hProcess, hMod, szProcessName,
sizeof(szProcessName) );
}
else return;
}
else return;
printf( "%s (Process ID: %u)\n", szProcessName, processID );
CloseHandle( hProcess );
}
void main( )
{
DWORD aProcesses[1024], cbNeeded, cProcesses;
unsigned int i;
if ( !EnumProcesses( aProcesses, sizeof(aProcesses), &cbNeeded ) )
return;
cProcesses = cbNeeded / sizeof(DWORD);
for ( i = 0; i < cProcesses; i++ )
PrintProcessNameAndID( aProcesses[i] );
}
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
|
|
|
|
|
thanks for giving me reply,
i try this code if i get any doubt i get back to u.
bye
trinadh
|
|
|
|
|
Thanks to MSDN
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
|
|
|
|
|
|
Error:Cannot open include file: 'psapi.h':
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
|
For header files other than my own, I use angle brackets <> instead of quotes. In any case, does the file exist on your machine?
"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
|
|
|
|
|
My program needs to be synchronised with my data server.
I must do it into my program, in VC++ 6 (not in .NET).
I can not find any function in msdn which do it.
I've another solution,;) instead of synchronising, I need to get the system time of the server. But I can not found any function to do this.
Does someone has already realize it ?
Firejano
|
|
|
|
|
First off, what kind of data are you synchronising?
Instead of depending on the time of the server, can you not depend on the time of the content/file that you are trying to synchronise ?
-Prakash
|
|
|
|
|
I try to synchronise my computer system time, with server one.
Firejano
|
|
|
|
|
|
thanks,
with the msdos command "net time /SET /YES \\my_server" you can synvhronise computer system time with the server one
Tchao
Firejano
|
|
|
|
|
I have a task that to capture the printing spool file (might be EMF file),
I want to install my application to monitor all the printers' jobs and get all the EMF Files . Cound anyone give me the suggestions or code snippet?
How to capature all the EMF files?
Thanks
|
|
|
|
|
|
thanks very much,how can you find these useful information?
|
|
|
|
|
having the memory of an elephant (and looking like one) helps - a couple of years back I was looking for a Print Monitor, and while these werent the references I had in mind (I think in the original reference I had, 'GhostScript' figured prominently) just doing a google on "c++ print monitor" or "c++ printmon" found these ones for you ..
'g'
|
|
|
|
|
I have the first experence to get the print job by my code. thank you.
BUT very disppointed that I found in my spooler directory, there is a file with ".SPL" extension, I used emf viwer , that can't be recongized. I want to catch the EMF file that the client sent to server, where can i find the EMF file ,need i dig the emf file data out from SPL file?
Could you give me more about the EMF file capture. ( I dont have Windows DDK).
Thanks in advance
Rudolf
|
|
|
|
|
Im sorry, right now I cant offer much more, except this, http://www.codeproject.com/dotnet/EMFSpoolViewer.asp[^] which might give you enough of a handle, especially if you check the references etc, to be able to parse the EMF file format
'g'
-- modified at 23:55 Wednesday 4th January, 2006
|
|
|
|