|
***** What I want is I should get exact no of entries and filenames as the no of files copied..***** When I copy files in the monitored directory through 4 cmd's all with copy command copying files from windows, system32, c:\, d:\ directory at a time.. this function ReadDirectoryChangesW() does not give correct output. It misses many files entries and also shows repetitive filename as file added and then modified. It is all because till the system writes the file completely, it continuously keeps giving the notification too. so we have multiple entries for same file. ***** What I want is I should get exact no of entries and filenames as the no of files copied.. So I think if I hook CopyFile/CreateFile(A/W) API, then I can trace all the files created/copied in c:\temp (putting c:\temp as the filter).. Please help.. Thanks in advance..
|
|
|
|
|
|
I am getting the following error
error RC2135: file not found: STRINGTABLE
error RC2135: file not found: 0xF000
1>
error RC2135: file not found: 0xF001
1>
None of the items pointed to by the resource compiler are files
I am at a loss
MSDN states for this error The file specified in the Resource Compiler command line was not found
I did a build from Visual Studio Professional 10.0
I don't know what is on the resource compiler command line
|
|
|
|
|
ForNow wrote: I am getting the following error Where?
ForNow wrote: I don't know what is on the resource compiler command line Look in the Properties window.
Use the best guess
|
|
|
|
|
Hi,
I am using ATL::CAxWindow for hosting some Activex control in my mfc mdi application.
How do I use the scrollbars of an atl::CAxWindow ?
The code I used to create ATL CAxWindow.
CAxWindow m_AxWnd;
CMDIChildWnd::Create(lpszClassName, lpszWindowName, dwStyle, rect, pParentWnd, pContext);
AtlAxWinInit();
RECT altRect;
GetClientRect(&altRect);
m_AxWnd.Create(m_hWnd, altRect, NULL, WS_CHILD|WS_VISIBLE|WS_HSCROLL|WS_VSCROLL);
m_AxWnd.CreateControl(L"Some ActiveX control");
Thanks,
|
|
|
|
|
CAxWindow inherits from ATLs CWindow which has a set of Scrolling Methods: EnableScrollBar, GetScrollInfo, GetScrollPos etc so do these handlers do the scrolling? That's presuming they're getting messages from the ActiveX control.
|
|
|
|
|
My legacy app. uses this message handler to do button enabling / disabling. However it gets called very frequently (eg on mouse move).
is there any way of filtering / controlling the messages that cause this function to get called? I can't see why I'd want to do anything with my toolbars & icons in response to UI messages anyway.
Thanks
|
|
|
|
|
Simon Langdon wrote: I can't see why I'd want to do anything with my toolbars & icons in response to UI messages anyway. You may need to disable a menu item based on some condition. You may have a counter in one of the status bar panes that needs updating. There are multiple uses for this macro.
"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
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
Yes, to be clear I can't see why _I_ would want to handle this message. But does MFC manage this message handler for every window in my app with a Message Map? I'm trying to decide if there's anything in my code base responsible for calling this unnecessarily.
|
|
|
|
|
|
If the logic that decides if the buttons should be enabled or disabled is too complicated it is advised (do not ask me to find who advised it, I just remember it somehow) that you do not use this method. You could always use CToolBarCtrl::EnableButton() for this and control it from within other parts of the program
|
|
|
|
|
One place that can fire off updating is the internal OnIdle. This is a fake message handler, called from the MFC message loop. So, you'll get updates a lot, but only when the message queue has "calmed down". So, if you get it a lot, it's because you don't have a lot else going on.
Iain.
I am one of "those foreigners coming over here and stealing our jobs". Yay me!
|
|
|
|
|
Hello there
I am working on a C++ MFC app that has a user login option and the software will store upto
15 passwords used by a user.
Now i want to store each password used by a user in a string array and make sure that the user
doesn't use an old password when updating the password.
i.e., password once used cannot be re-used and an existing password will expire after a set number of days.
The question is what kind of collection class i need to use for efficient management of old passwords?
CArray?CList? CString array?
Any sample code will help.
Thanks in advance.
|
|
|
|
|
It sounds like a trivial issue, use whichever types you're comfortable with. STL vectors and CStringArrays both leap to mind; do you need to save this data somehow? CStringArrays support CArchive but you may want to think about encryption or some other safety feature.
|
|
|
|
|
If you're only storing CStrings then CStringArray[^] would be a good choice. If you're storing something else, one of the other collections probably would be more appropriate, here[^] are some examples of thier usage, there are lots of others on the web. here[^] is a link that should help you to decide which collection might be best.
|
|
|
|
|
Donguy1976 wrote: The question is what kind of collection class i need to use for efficient management of old passwords? Since you are only dealing with 15, and only searching the collection when the user is logging in (e.g., once per day), it likely does not matter the data structure you use.
"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
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
|
Personally I would use a vector, add a new password at the end when needed and remove the first one when size() becomes larger than 15. The scurity issues were already mentioned in the otherreplies.
|
|
|
|
|
Hi, I have written a code in C++ which works on the "POINT" user defined type i.e. POINT = (x,y).
I am giving input in int form, it is converting it into point might be using "template<int p="">". I am retrieving these point from another function which is a header file of mine.
Now the problem is, I am calling this function in NS-3 software/program, I am unable to convert this point form into integer.
* Can i return more than one value from a function, because point has two values i.e. X and Y.
Please help me out.
|
|
|
|
|
Assuming you mean the POINT structure[^], you could pass it back by pointer, or pass in a pointer or reference that the called function fills in.
Use the best guess
|
|
|
|
|
Here is my some part of my code....
int my_encrypt()
{
typedef EllipticCurve<263> ec_t;
ec_t myEllipticCurve(1,1);
ec_t::Point P = myEllipticCurve[2];
cout << "some point P = " << P << ", 2P = " << (P+P) << "\n";
int a = irand(1,myEllipticCurve.Degree()-1);
ec_t::Point Pa = a*G; // public key
cout << "Alice' public key Pa = " << a << "*" << G << " = " << Pa << endl;
ec_t::Point Pk = a*Pb;
ec_t::ffe_t c1( m1*Pk.x() );
ec_t::ffe_t c2( m2*Pk.y() );
I need to return these three values (Pa, C1, C2) into my main function.
|
|
|
|
|
Sorry, but you lost me at typedef EllipticCurve<263> ec_t; .
Use the best guess
|
|
|
|
|
then change your function:
int my_encrypt(ec_t::Point * pPa, ec_t::ffe_t * pc1, ec_t::ffe_t * pc2 )
{
*pPa = Pa;
*pc1 = c1;
*pc2 = c2;
return 0;
}
You may as well use the approach suggested by Richard, that is embed Pa, c1, c2 into a struct and pass the pointer to such a struct to your function.
Veni, vidi, vici.
|
|
|
|
|
Hi.. i have used the structure to pass three different variable as shown below...
int main()
{
struct result t1;
t1 = my_encrypt();
cout << t1.pa << t1.c1 << t1.c2 <<;
}
struct result my_encrypt()
{
typedef EllipticCurve<263> ec_t;
struct result
{
ec_t::Point Pa;
ec_t::ffe_t c1;
ec_t::ffe_t c2;
}t;
ec_t::Point Pk = a*Pb;
ec_t::ffe_t t.c1( m1*Pk.x() );
ec_t::ffe_t t.c2( m2*Pk.y() );
return (t);
}
I am getting so many errors.. Please tell me anything wrong declaration here.
Can i declare that structure as global...
|
|
|
|
|
Quote: int main()
{
struct result t1;
t1 = my_encrypt(); Should be:
int main()
{
struct result t1 = {0};
my_encrypt(&t1);
Quote: struct result my_encrypt()
{ should be:
int my_encrypt(struct result * pt1)
{
Please note, there are other (unrelated) errors in your code.
Veni, vidi, vici.
|
|
|
|