|
Hi,
For creating Restore point we use below structure,
typedef struct _RESTOREPTINFO {
DWORD dwEventType;
DWORD dwRestorePtType;
INT64 llSequenceNumber;
TCHAR szDescription[MAX_DESC];
} RESTOREPOINTINFO, *PRESTOREPOINTINFO
In it why is it necessary to specify 2nd param 'dwRestorePtType'
whatever I install or do... system shud take restore point...I think so...Do tell Ur comments... is there any specific reason???
coz if I dont set this parameter, system gives me error code-13 i.e DATA IS INVALID
thanks in advance
Supriya Tonape
-- modified at 2:30 Wednesday 19th October, 2005
|
|
|
|
|
Ussualy, an application passes a pointer to such an object to the SRSetRestorePoint() function and needs to know what action to take on certain events. For example, to cancel the creation of a restore point, you could call SRSetRestorePoint() with dwRestorePointType set to CANCELLED_OPERATION, dwEventType set to END_SYSTEM_CHANGE, and llSequenceNumber set to the sequence number of the restore point.
SkyWalker
|
|
|
|
|
I wanted to know why SRSetRestorePoint() does not work in Vista? Do we need to specify any other parameters?
SRSetRestorePoint() returns true in XP but false in Vista (I'm executing the same piece of code in the two m/cs). Please help!
|
|
|
|
|
How to get the size of a removable disc connected on the USB port
|
|
|
|
|
If you are referring to the drive's capacity, you can use the Win32_DiskDrive WMI class.
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
I'm running the code shown below, and it's just too slow. I'm reading 17k rows and 59 columns from a CSV file and it takes 3 minutes. My computer is not the fastest (5 year old Celeron processor) but still...
I got some great suggestions yesterday: One person mentioned that I should read larger chunks of data instead of one character at a time. Problem is, I don't know how.. Can anybody help?
Note: rawData and record are STL vectors.
rawData.reserve(numberRecords) ;
int counter=0 ;
do
{
counter += 1 ;
std::vector <std::string> record ;
record.reserve(numberVars) ;
for(int i=0; i<numbervars-1; i++)
="" {
="" char="" buff[100]="{0}" ;=""
="" data-="">getline(buff,sizeof(buff),',') ;
record.push_back(buff) ;
}
std::getline(*data,value) ;
record.push_back(value) ;
rawData.push_back(record) ;
std::vector < std::string >::iterator j ;
j=record.begin() ;
record.erase(j, j+numberVars) ;
} while (counter < numberRecords) ;
Thanks,
Hamlet
|
|
|
|
|
Alright buddy, u can use the read function to read a buffer into memory and then read byte by byte from there, check if u r reading past the buffer and if so, then only re read from the file the next chunk. And if u r really serious, u can try to implement these in a class like this:
class CMyFile : public ifstream
{
void *m_pvBuffer;
unsigned long m_ulBufferSize;
unsigned long m_ulSeekPosition;
public:
CMyFile(void);
~CMyFile(void);
CMyFile& operator>>(string& param_string);
};
use the read function, interpreting of buffer and various checks in the opertor>> function.
the above is only a general idea and by no means a complete solution.
"Do first things first, and second things not at all."
— Peter Drucker.
|
|
|
|
|
let's say i read a chunk wih read() and then parse the chunk for commas and end-of-line separators. what happens if the chunk stops between commas or lines?
hey do i really have to spoon feed u?
{
...
...
if(... )
{
...
}
no more questions please...
"Do first things first, and second things not at all."
— Peter Drucker.
|
|
|
|
|
I am developing an SNMP Agent. I want to use sockets to send/recieve data, for which I need the services of a socket. The code works fine, ie compiles correclty.
#include "Connector.h" // The file that defines of the CAsyncSocket derived class Connector
Connector Cn;
// Entry Point for the DLL
BOOL APIENTRY DllMain(...)
..
{
WSADATA wsaData;
long Events = FD_READ | FD_WRITE | FD_CONNECT | FD_CLOSE | FD_ACCEPT;
WSAStartup(MAKEWORD(1,1),&wsaData);
AfxSocketInit();
switch(ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
/* The problem lies here. If I don't use this line then the Agent will send traps correctly. But when I create this socket nothing happens. The Agent does not send traps. It kind of just stops working.
Cn.Create(128,SOCK_DGRAM,Events,"127.0.0.1");
break;
...
}
I dont seem to know what is the problem.
Please Reply as soon as possible as I am working on a project.
Thanks
|
|
|
|
|
Just a guess, could it happen beacuse you are calling WSAStartup() and AfxSocketInit() for every call of DllMain?
You might considder moving those function calls into DLL_PROCESS_ATTACH
|
|
|
|
|
It is not working. I've probably tried all the combinations. Now, since it is an extension Dll, I am calling AfxInitExtensionModule and AfxTermExtensionModule from DLL_PROCESS_ATTACH and DLL_PROCESS_DETACH respectively. But still the problem persists. ie the dll does not respond when I try to create the socket.
Plz check it out, if you could.
Thanks
|
|
|
|
|
Definitely no inheritance. The objects have different roles: use inheritance sparingly, and only when a derived class is is the same "thing" as the superclass, with a couple of extra bells and whistles
Particularly with the same "thing" idea...when using inheritence???
FYI...the guy is refering to a set of classes like...
CxDatabase<br />
CxValidator<br />
CxAuthorize
|
|
|
|
|
When confused wether or not to use inheritance, i go by "is a" or "has a" rule explained in Deitel, "C++ - How to program".
In the above case, the same "thing" refers to "is a" case.
Well, I am absolutely comfortable with the above idea.
|
|
|
|
|
Yes, I agree. Inheritance is used too much, and containment is not used enough ( has-a, instead of is-a ).
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hello,
I totally agree. Inheritance is a good thing, but certainly too much in a lot of cases. Some disadvantages come with inheritance. One thing are extra physical dependancies. If you use too much inheritance, your compilation process will take considerably more time.
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
Inheritence is used much more then containment
this is due to many reasons supporting advantages of inheritence
"Everthing has its own specail importance " Quote by some great person
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
Yes, this is true. But it's also often used without thought.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I have a class that is derived from CDialog that declares the following:
<br />
BEGIN_EVENTSINK_MAP(CColorPage, CPage)<br />
<br />
ON_EVENT_RANGE(CColorPage, IDC_COLOR_BUTTON1, IDC_COLOR_BUTTON10, -607 , OnMouseUpButton, VTS_I4 VTS_I2 VTS_I2 VTS_I4 VTS_I4)<br />
END_EVENTSINK_MAP()<br />
When I compile the code, I get the following error messages:
C:\TMLnkV32\ColorPage.cpp(92) : error C2509: '_GetBaseEventSinkMap' : member function not declared in 'CColorPage'
c:\tmlnkv32\colorpage.h(26) : see declaration of 'CColorPage'
C:\TMLnkV32\ColorPage.cpp(92) : error C2509: 'GetEventSinkMap' : member function not declared in 'CColorPage'
c:\tmlnkv32\colorpage.h(26) : see declaration of 'CColorPage'
C:\TMLnkV32\ColorPage.cpp(92) : warning C4273: 'protected: static struct AFX_EVENTSINKMAP const CCmdTarget::eventsinkMap' : inconsistent dll linkage. dllexport assumed.
C:\TMLnkV32\ColorPage.cpp(92) : error C2491: 'CColorPage::CTabPageSSL::CDialog::CWnd::CCmdTarget::eventsinkMap' : definition of dllimport static data member not allowed
C:\TMLnkV32\ColorPage.cpp(96) : error C2248: 'OnMouseUpButton' : cannot access protected member declared in class 'CColorPage'
c:\tmlnkv32\colorpage.h(66) : see declaration of 'OnMouseUpButton'
I am looking for suggestions as to what I am doing wrong.
Thanks in advance.
Eldon Zacek
|
|
|
|
|
Maybe this MSDN example helps:
struct A {
virtual int vfunc() = 0;
virtual int vfunc2() = 0;
};
struct B : private A {
using A::vfunc;
virtual int vfunc2();
};
int B::vfunc() { return 1; }
int B::vfunc2() { return 1; }
SkyWalker
-- modified at 3:48 Wednesday 19th October, 2005
|
|
|
|
|
Thanks for looking at this, I found the problem. I forgot to include DECLARE_EVENTSINK_MAP in the ".h" file.
Eldon Zacek
|
|
|
|
|
DrawText is too slow when string is long enough and without "\n" among the string charaters.any body knows another way instead DrawText?
thanks regards.
|
|
|
|
|
TextOut()
It's frustrating being a genius and living the life of a moron!!!
|
|
|
|
|
Great! But I have a problem with multiline text,I want to text it like a multiline edit control does. I don't know when should I break up the line and start a new line to text. in another word:
I need a method to cauculate one character's width, it isn't only limited in english characters. thanks,so much
life is like a box of chocolate,you never know what you r going to get.
-- modified at 1:42 Wednesday 19th October, 2005
|
|
|
|
|
I think you need GetTextExtent
Dr.pi
|
|
|
|
|
hi all, i am making an multithread client that connects to differents servers using differents threads.
in the main window the user select the numbers of connections that the program will start.
To make make this i created the threads inside a loop like this:
GetDlgItemText(IDC_SIMULTANEOS, n);
int a = _ttoi(n.GetBuffer(n.GetLength()));
for(LONG i=0; i<a; i++)="" {
="" m_servername.gettext(i,="" str);
...
....
="" pthread-="">ResumeThread();
}
The program creates succefully the number of connections to the server specified in a, for example it creates 2 threads.
Now, i need to do read operations on the different threads created.
I can see theat write and read operations works only on the last process(thread, connection) created.(sniffing packets i
realize that the data pushed are in the higher port number of the two established connections on my local machine to the
second server on the list).
How can i identify the different threads created in the loop and make write and read operations on them??
Thanx in advance.
|
|
|
|