|
I have created my client exe and server exe. Both are working fine, connection establish properly, message parsing is work properly. But prblem arise at the time of closing. I have used CSocket class and worked on vc++6.0 and Platfoem SDK sp2. Whenever i kill client exe from task manager, OnClose method of Server gets called, but, despite kill the exe when i restart my pc when exe is running condition the OnClose method of Server does not called and vceversa, same thing happens on both the end. Please give me suggestion if you have any idea or any different way to do this
abhi
|
|
|
|
|
AbhijitAkude wrote: any different way to do this
Use the Winsock2 API rather than CSocket. And make sure you find an article about the proper handling for closing sockets. Oh... and then read it of course.
|
|
|
|
|
Hi..All..
am using the method getsubitemrect.
CRect rect;
getsubitemrect(nitem,nSubitem,LVIR_BOUNDS,rect);
but am not getting the correct boundaries i mean rectangle of sub item.
Can any one suggest me if there is any other way to get sub item's rectangle..
thanq..
|
|
|
|
|
sheshidar wrote: but am not getting the correct boundaries i mean rectangle of sub item.
How are you verifying this?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi all,
How i should be able to create xml file using IXMLDOMNode.
Regards
|
|
|
|
|
Maynka wrote: How i should be able to create xml file using IXMLDOMNode
You can't. You need a IXMLDOMDocument to create an XML file.
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.
|
|
|
|
|
Using IXMLDOMDocument HOW CAN I DO THAT:
|
|
|
|
|
|
you're just one big tease
Yours Truly, The One and Only!
|
|
|
|
|
Well, a little effort must be done by the OP too
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 show you how to read and create an xml document and finally save it to file
http://www.awprofessional.com/articles/article.asp?p=169461&seqNum=1
Yours Truly, The One and Only!
|
|
|
|
|
|
I want to check that in target machine already register somefile.OCX or not.
How can I write the code for this issue?
Thanks
|
|
|
|
|
Hi
you have to check that in the registry;
so write code for that
|
|
|
|
|
If you know the relevant GUID s you can call CoGetClassObject or CoCreateInstance and check the return value.
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.
|
|
|
|
|
I have some code below, which uses the disk management code IOCTL_DISK_GET_DRIVE_LAYOUT. However, when I run the application, the error code 122 is produced (indicating that the DRIVE_LAYOUT_INFORMATION structure - which is pointed to - is too small). How would I rectify this problem?
Here is the code below:
<br />
BOOL GetDriveLayout()<br />
{<br />
BOOL bResult;<br />
DWORD dwRet =0;<br />
DRIVE_LAYOUT_INFORMATION p;<br />
<br />
bResult = DeviceIoControl(hDevice,IOCTL_DISK_GET_DRIVE_LAYOUT,NULL,0,&p,sizeof(p),&dwRet,NULL);<br />
<br />
if(bResult==FALSE)<br />
printf("Error: %d", GetLastError());<br />
<br />
return bResult;<br />
}<br />
Note that other IO functions such as IOCTL_DISK_GET_PARTITION_INFO work fine..
Thanks for your help!
--PerspX
"Nowadays, security guys break the Mac every single day. Every single day, they come out with a total exploit, your machine can be taken over totally. I dare anybody to do that once a month on the Windows machine." - Bill Gates
|
|
|
|
|
Depending on your OS version you could need to use DRIVE_LAYOUT_INFORMATION_EX which is documented here[^] and IOCTL_DISK_GET_DRIVE_LAYOUT_EX . You might want to consider using IoReadPartitionTableEx[^] to retrieve the partition information as well.
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
Thanks I sorted the problem out myself but I have used DRIVE_LAYOUT_INFORMATION_EX now instead aswell
--PerspX
"Nowadays, security guys break the Mac every single day. Every single day, they come out with a total exploit, your machine can be taken over totally. I dare anybody to do that once a month on the Windows machine." - Bill Gates
|
|
|
|
|
Hey Frnds
thanks to giveyour valuable time....
I need some conceptual help.
If i have a rect Object CRect(10,10,1000,1000)
and i frequently chane only (200,200,500,500) region rest remain unchange.
How InvalidateRect is useful? whether it redraw whole CRect(10,10,1000,1000) or just (200,200,500,500) on each OnDraw call..
thnaks
|
|
|
|
|
himuskanhere wrote: How InvalidateRect is useful? whether it redraw whole CRect(10,10,1000,1000) or just (200,200,500,500) on each OnDraw call..
just (200,200,500,500), as stated here [^]:
Before BeginPaint returns the display device context, the system prepares the device context for the specified window. It first sets the clipping region for the device context to be equal to the intersection of the portion of the window that needs updating and the portion that is visible to the user. Only those portions of the window that have changed are redrawn. Attempts to draw outside this region are clipped and do not appear on the screen.
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.
|
|
|
|
|
Hi,
I am working on propertysheet application wizard, to change my application icon i have change 16x16, 32x32, 48x48 of 256 colors, this is working fine.
when I change my settings(Right Clik on Desktop->properties->settings->color quality) to "Medium(16bit)background becomes block.Can anyone help me for this?
|
|
|
|
|
Hi!
I have a problem in retrieving printer information using FindNextPrinterChangeNotification() function.My code executes properly without any error and exception but all the values in LPPRINTER_NOTIFY_INFO structure are NULL or zero.code as follow
LPPRINTER_NOTIFY_INFO notification;
LPPRINTER_NOTIFY_OPTIONS notifyoption;
notifyoption = (LPPRINTER_NOTIFY_OPTIONS)HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, sizeof(PRINTER_NOTIFY_OPTIONS) );
notification = (LPPRINTER_NOTIFY_INFO)HeapAlloc ( GetProcessHeap (), HEAP_ZERO_MEMORY, sizeof(PRINTER_NOTIFY_INFO) );
OpenPrinter("HP LaserJet 3200 Series PS",&hprinter,NULL);
if(hprinter == INVALID_HANDLE_VALUE)
MessageBox("printer not available","",MB_OK);
hnotify = FindFirstPrinterChangeNotification(hprinter,PRINTER_CHANGE_ALL,0,notifyoption);
notifyoption->Flags = PRINTER_NOTIFY_OPTIONS_REFRESH;
if(hnotify == INVALID_HANDLE_VALUE)
MessageBox("Invalid handle hnotify","",MB_OK);
DWORD retcode = WaitForSingleObject(hnotify,INFINITE);
if(retcode == WAIT_OBJECT_0)
{
BOOL ret = FindNextPrinterChangeNotification(hnotify,&changeNotify,notifyoption,(LPVOID*)notification);
if(ret !=0)
{
if(notification->aData[0].Type == PRINTER_NOTIFY_TYPE)
MessageBox("printer notification","",MB_OK);
sprintf(msg,"Field=%d",notification->aData[0].Field);
MessageBox(msg,"",MB_OK);
if(notification->aData[0].Field == PRINTER_NOTIFY_FIELD_SERVER_NAME)
{
MessageBox("Printer Name is","",MB_OK);
memcpy(printername,(char *)notification->aData[0].NotifyData.Data.pBuf,notification->aData[0].NotifyData.Data.cbBuf);
MessageBox(printername,"",MB_OK);
}
else
MessageBox("other than printer name","",MB_OK);
FreePrinterNotifyInfo(notification);
}
else
MessageBox("error in executing","",MB_OK);
ivalue of Field and cBuf is NULL
please if anyone can identify the problem..it will be very helpful for me
Thnaks in advance
|
|
|
|
|
Could it be because you appear to have not set the Version field of the 2 PRINTER_NOTIFY structures? MSDN recommends setting the Version to 2 see here[^]
|
|
|
|
|
Hi
consider the function
void ClassName::Fun()const
{
//Here we cant change the value of the datamember
}
Is there any benefit of using the const member function.Like Performance benefit.
VIBIN
"Fool's run away,where angle's fear to tread"
|
|
|
|
|
Generally const function are GetXXX methods, which will return only values. It ensures that the data members will not be changed by mistakenly.
Declaring a member function with the const keyword specifies that the function is a "read-only" function that does not modify the object for which it is called.
Regards,
Paresh.
|
|
|
|
|