|
Arrow icon? Do you mean a question mark? According to the documentation, the Context help checkboxes on both the More Styles and Extended Styles tabs are directly related to the question mark in the title bar of the dialog.
|
|
|
|
|
yeah i meant the question mark.
And yes, i checked those 2 already.
But i still don't see it
|
|
|
|
|
I'm at a loss at this point. Perhaps you could create a test application that sports one dialog box. Play with those two "help" checkboxes and then see how the test application differs from the application that does not work.
|
|
|
|
|
The context help style can't be used if the dialog has minimize and/or maximize buttons.
--Mike--
Yeah, payin' the bills with my mad programming skillz.
Defraggin' my hard drive for thrills.
Homepage | RightClick-Encrypt | 1ClickPicGrabber
"You have Erica on the brain" - Jon Sagara to me
|
|
|
|
|
the problem was i had to enable 'system menu' in Dialog properties. Now i have the context help style with a 'X' close button next to it .. can i hide the 'X' (close) button and still having the context help style?
Greetings and thanks for the fast response
Jens
|
|
|
|
|
I am hosting user interface components in a com dll. My question is when a user clicks a button on a dialog, where should the code to handle the click reside??
A. The form where the click occurred
B. A business object in which case a sink would have to exist between ui dll and business object dll
C. None of the above in which case i have no clue where to put the code?
Help
Thanks
|
|
|
|
|
As with any dialog, it should have an onclick handler for the button. The code in the onclick handler can then communicate with the business object dll.
|
|
|
|
|
Thanks, I wasn't sure if it was then necessary to add a processing component for the ui to talk to which would in turn call the business component. This would further encapsulate the dialog code but in turn would create a headache as to who holds the reference pointer to the business object.
|
|
|
|
|
Hi,
For binary string i have following loop which calculate the
difference of 0' and 1'.
int CMyDlg::ZeroOneDiff(char *str, int length, char sbit)
{
int i;
char tmp;
char backup[60];
int iZero, iOne;
int iDiff;
tmp = sbit;
memset(backup, 0, 28);
for(i=0; i<length; i++){
if(="" (str[i]="=" '1')="" &&="" (tmp="=" '0'))="" {
backup[i]="1" ;
}
else="" if(="" '1')){
backup[i]="0" if((str[i]="=" '0')="" '0')){
backup[i]="0" '1'))="" ;
}
tmp="backup[i];
}
iZero" =="" 0;
ione="0;
iDiff" 0;
for(i="0;" i<length;="" i++){
if(backup[i]="=" izero++;
else="" ione++;
}
idiff="" +="(iZero" -="" ione);
return="" idiff;
}
for="" example,="" for="" binary="" string="010001000100100" and="" start
bit="" '0',="" we="" can="" call="" above="" function="" as
int="" diff="ZeroOneDiff(string," 15,="" '0');
i="" really="" want="" to="" know="" if="" there="" is="" a="" fast="" method="" doing="" this="" (using="" &,="" |,="" ^,="" <<,="">> operators )? especially, when the length of the binary string is bigger, the fast method is more valuable.
Thanks in advance!
chen
|
|
|
|
|
What does the function do? In other words, what IS the difference between 0' and 1'?
|
|
|
|
|
If the first or start bit is '0', the function translate
the 010001000100100 into
011110000111000
otherwise if start bit is '1', the translated binary string is
100001111000111
and then, calculate the sum of 0 and 1 in the new string
and finally return the difference of 0 and 1:
sum of 0 - sum of 1.
that it!
chen
|
|
|
|
|
I guess I'm just slow but I'm still not clear as to what this is doing. When 010001000100100 is translated to 011110000111000, some of the 0s get translated to 1s while others do not. Likewise, some of the 1s get translated to 0s while others do not.
Since there does not seem to be a linear pattern as to when a 0 gets translated to a 1 and vice-versa, bit-flipping doesn't seem to be a possible solution. I may be wrong on this.
|
|
|
|
|
You can see what is doing by make attention in the first loop.
where the new bit (0' or 1') is determined by the last new bit and the
bit at same position in the origional binary string and use the following
translate rule: if the bit in the origional string at a position is 0,
the new bit can be set with the same value of the last bit (in new string).
otherwise, reverse.
chen
|
|
|
|
|
If you look at your example, you'll notice that the 1s in the original string toggles replacing 0s by 1 or 0 (ie, each time a 1 is met the following 0s are replaced with 1s or 0s). This cannot be made easily with bitoperators.
chen wrote:
and then, calculate the sum of 0 and 1 in the new string
and finally return the difference of 0 and 1:
You loose time, you only need to count the 0s or the 1s, and then do length-number of 0s (resp. 1s), since you are in ... binary (if you have the 0s, all other are necessarily ... 1s)
The following loop should do it :
bool b=sbit;
int tmp=0;
for(i=0 to strlength)
{
if (str[i]==1)
{
b=!b;
}
if (b) tmp++;
}
return (length-tmp);
~RaGE();
|
|
|
|
|
I think you have some errors in your code. Can you post the correct code? Also post a more complete definition of what you're trying to accomplish.
-Sean
----
Shag a Lizard
|
|
|
|
|
Sory for the error.
I'm interested in how to enhence the calculation speed of the for loop.
Now the correct code:
==========================================
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int ZeroOneDiff(char *str, int length, char sbit)
{
int i;
char tmp;
char backup[60];
int iZero, iOne;
int iDiff;
tmp = sbit;
memset(backup, 0, 28);
for(i=0; i<length; i++){
if( (str[i] == '1') && (tmp == '0')) {
backup[i] = '1';
}
else if( (str[i] == '1') && (tmp == '1')){
backup[i] = '0';
}
else if((str[i] == '0') && (tmp == '0')){
backup[i] = '0';
}
else if((str[i] == '0') && (tmp == '1')) {
backup[i] = '1';
}
tmp = backup[i];
}
iZero = 0;
iOne = 0;
iDiff = 0;
for(i=0; i<length; i++){
if(backup[i] == '0') iZero++;
else iOne++;
}
iDiff += (iZero - iOne);
return iDiff;
}
void main()
{
char str[60] = "010001000100100";
int diff = ZeroOneDiff(str, 15, '1');
printf("%d\n", diff);
}
============================================
chen
|
|
|
|
|
By what gauge are you using to measure its current speed?
Why are you only setting the first 28 bytes of backup, which is 60 bytes, to 0?
The only change I could possibly make to this would be something like:
iOne = 0;
for (i = 0; i < length; i++)
{
if ('1' == backup[i])
iOne++;
}
return (length - iOne);
You could actually do this counting in the other 'for' loop. This would save having to iterate through the string again
You could also change the first loop to something like the following, but any gain would be negligible. If this function is only called a few times, this is really a moot exercise.
if ('1' == str[i])
{
if ('0' == tmp)
backup[i] = '1';
else
backup[i] = '0';
}
else
{
if ('0' == tmp)
backup[i] = '0';
else
backup[i] = '1';
}
BTW, read the FAQ regarding how to format code when certain reserved symbols are used. The '<' symbol should be "& lt" and the '>' should be "& gt", minus the space. This is evident in the 'for' loop of your code.
|
|
|
|
|
It's obvious that below method is shorter but I am NOT sure its performance is better. (Depond how big is your binary string)
Looks like it's CS freshman's assignment
int ZeroOneDiff2(char *str, int length, char sbit)
{
int nZero = 0, nOne = 0, nNext = 0, nTmp = atoi(&sbit);
char c;
for(int i = 0; i < length ; i++)
{
c = str[i];
nNext = atoi(&c);
nTmp ^= nNext;
if(nTmp)
nOne++;
else
nZero++;
}
return nZero - nOne;
}
|
|
|
|
|
This indeed counts but I don't see the "translation" code.
|
|
|
|
|
>>> I don't see the "translation" code.
What is that???????????
If you like to see the result of "backup[]", just add this line in the end of for loop
printf("%d",nTmp);
If it's what you mean "translation".
Come on, this should be the assignment for the "C" 2-month-experience beginner....
|
|
|
|
|
Anonymous wrote:
What is that???????????
The code that translates "010001000100100" into "011110000111000." The code snippet that you provided does indeed count 1s and 0s but it does not appear to do the OP's translation requirement. Do you concur?
|
|
|
|
|
???? The method only return Zero - one as integer.
Does the method print/compute "translatioin" for user????????
I am out of here. It's not worth to "chat"...........
|
|
|
|
|
You obviously missed Chen's original post. It had TWO 'for' loops. The first one translated the string. The second one counted the 0s and 1s.
|
|
|
|
|
I have a popup in my pc that have me very tired.
Every time that I start my explorer it starts and I am very closer to format my machine....
any body knows where I can look in the registry to find the dll that is making that. The popup is the green lotery of USA. Please any body can help me. May be Michael Dunn knows where the dll is....
Thanks in Advance
Carlos Antollini.
Pi Five[^]Creator
Sonork ID 100.10529 cantollini
|
|
|
|
|
Unfortunately, IE launching popup-ad windows is an all too common occurence these days. Its not a DLL that is the culprit but embedded script and/or an ActiveX control.
One thing you can do is to change your browser's security settings. By default, most items are set to Enable, where they should actually be Disable or Prompt.
Another is to install an ad-blocker program. These are just BHOs (Browser Helper Objects). Some are good while others aren't.
|
|
|
|