|
GrumbleWeedster wrote: At the moment CFileReplace is an empty default dialog with and OK and Cancel button.
There are no custom functions in place...
Based on that, can we then assume that it has no bearing on the problem?
Also, answering this question will go a long way towards the solution.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
I may have found a solution but can anyone tell me if it could cause a problem?
Changing the code in PreTranslateMessage(MSG* pMsg) stopped the error from occuring:
Original Code: (Not Working)
<br />
if( pMsg->message == WM_DROPFILES) OnDropFiles(pMsg->wParam,pMsg->lParam);<br />
return CDialog::PreTranslateMessage(pMsg);<br />
Modified Code: (Working)
<br />
if( pMsg->message == WM_DROPFILES)<br />
{<br />
OnDropFiles(pMsg->wParam,pMsg->lParam);<br />
::TranslateMessage(pMsg);<br />
::DispatchMessage(pMsg);<br />
return TRUE;<br />
}<br />
else return CDialog::PreTranslateMessage(pMsg);<br />
As I said, this does make the function work correctly, but is it a solution or is it just diverting from the error?
|
|
|
|
|
GrumbleWeedster wrote: if( pMsg->message == WM_DROPFILES)
What's this? Why are you looking for this message in the PreTranslateMessage() method? You should be handling the WM_DROPFILES message via the message map:
BEGIN_MESSAGE_MAP(CMyDlg, CDialog)
ON_MESSAGE(WM_DROPFILES, OnDropFiles)
END_MESSAGE_MAP()
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
Dialog based applications can't seem to handle drop files that way.
Nothing is ever added to the list when items are dropped. The only way I've found to enable drag and drop in a dialog based app is intercept the message in PreTranslateMessage()
|
|
|
|
|
GrumbleWeedster wrote: My problem is, everything works fine until the end of the DropFiles function is reached..when it returns the program crashes from the following Assert:
ASSERT(::IsWindow(m_hWnd));
Anyone know how to fix this?
So what is happening within the DropFiles() function?
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
This error can occours if you destroyed that CWnd object into the DropFiles function.
else, be more clear to understand how the error comes, or how work the function.
Have a nice code day
|
|
|
|
|
I am building a directshow source filter, but I received the error message "LoadLibrary("xxx.ax") failed - The specified module could not be found." when I registered the filter. I used some DLL to build the filter. Thanks for any information about the error message.
|
|
|
|
|
I think the error message is pretty clear no ? There is a missing library. Add this missing file in the proper folder (probably the working directory) to solve the problem.
Otherwise give more information about the problem.
|
|
|
|
|
Thanks. You are right. I used dependencywalker to find out what dlls are missing, and added those dlls in the same directory. Problem was solved.
|
|
|
|
|
how to having some 32 bit number invert only a single bit in it
some clever stuff of ~&| ops is needed
0100101010011[1]001001010100111001 to invert 1 value bit
0100101010011[0]001001010100111001
or
01001010100111[0]01001010100111001 to invert 0 value bit
01001010100111[1]01001010100111001
9ine
|
|
|
|
|
DWORD dw = 0xFC246A09;
DWORD mask = 0x00008000;
if ((dw & mask) == mask) {
dw &= ~mask;
}
else {
dw |= mask;
}
|
|
|
|
|
If you just want to toggle you could use xor
dw ^= mask;
codito ergo sum
|
|
|
|
|
oh yes just to toggle
9ine
|
|
|
|
|
thanks BadKarma, i was actually wondering about it (didn't forget it), but it's ok.
i also updated my article on bitwise flags[^]...
|
|
|
|
|
oh I remembered this is one proper op
dw &= ~mask;
probably something more brief
if(dw & mask) //bit=0
dw |= mask;
else //bit=1
dw &= ~mask;
9ine
|
|
|
|
|
i don't like removing the curved braces, because they can end in heavy problems (especially when using macros...
i disadvise you to do so ; moreover, it won't produce lighter code after the compilation, so why writing less readable code ?!
but as badkarma suggested, you can also use the ^ XOR operator. but be careful !!! the mask variable must have only one bit set at a time, otherwise you could have several bits switching...
|
|
|
|
|
the fewer the code the better, so it is quite normal to use if(!a) instead of if(a==0)
9ine
|
|
|
|
|
9ine wrote: the fewer the code the better
false.
the explicit cast you don't do, the compiler will do them implicitely itself.
so don't loose the readability point
moreover, read this[^]
|
|
|
|
|
9ine wrote: ...it is quite normal to use if(!a) instead of if(a==0)
I don't consider that to be normal at all.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
9ine wrote:
0100101010011[1]001001010100111001 to invert 1 value bit
0100101010011[0]001001010100111001
Try:
unsigned int x = 0x4A9C9539;
x &= ~0x40000;
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
I need to toggle it simultaniously 1to0 or if 0to1
xor is good
9ine
|
|
|
|
|
Right. You'll need the XOR operator to do both. My suggestion was just for one (i.e., 1 to 0). To go the other way (i.e., 0 to 1), use the OR operator.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
David, this will only unset the bit if it was set, but won't switch the state of the bit
|
|
|
|
|
|
Hi!
Does somebody know, if there is shareware to create class diagrams or flowcharts of programs? I already tried Jude, but thats only for JavaScript?
Thank you very much!
-- modified at 8:47 Tuesday 18th April, 2006
|
|
|
|