|
john john mackey wrote: I can't even see a listing of the IDC_ resource for any of these buttons, I'm totally infuriated Mad
Stay cool . Select the control, right click, "properties". You will get it's ID from the ID property. Any control you drop on the dialog will have it's ID.
Also,you might know, you can enable/disable any control without creating a control variable.
GetDlgItem(RESOURCE_ID)->EnableWindow(true/false);
Also, I'm just noticing. The member variable for Radio button DDX is by default is BOOL! quite misleading. It should've been int rather. God only knows why they changed it to BOOL.
Also any beginners who would think BOOL as bool will have an excellent day
He never answers anyone who replies to him. I've taken to calling him a retard, which is not fair to retards everywhere.-Christian Graus
|
|
|
|
|
Thanks for this advice! I will try it out.
Regarding the single group box, I think I will create separate group boxes for the 3 sets of radio buttons I have, but just make them NOT VISIBLE (hide the group boxes).
Thanks again.
|
|
|
|
|
How can I write DllMain function in C language for Borland C++ 5.5.1 compiler
|
|
|
|
|
|
dataminers wrote: How can I write DllMain function in C language...
See here.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"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
|
|
|
|
|
Hi All,
Anyone have c code for Boyer-Moore or BMH? I don't want to take the time to translate (and debug) pseudo code from my Algorithm Analysis textbook. I'd like to paste and compile.
No wiki please. I already know their stuff is broken. How much crap can one site publish and claim it is fit for consumption?
Jeff
|
|
|
|
|
|
Hi David,
DavidCrow wrote: http://www-igm.univ-mlv.fr/~lecroq/string/node14.html[^]
I ran across these. Unfortunately, some assembly is required and there are no instruction on calling 'void* p = Find(needle, haystack)'. Perhaps I am asking for too much.
DavidCrow wrote: Specfically what?
Run it: Wiki's Boyer-Moore Horspool[^] implementation.
Here's one of the best examples. A fellow claimed Dr. Adler's ADLER-32 reference implementation was wrong because it did not agree with wiki: Need peer review: May have found mistake in Adler-32![^].
Jeff
|
|
|
|
|
This is from my bag-o-tricks library, but it's been a long time since I've tested or used them.
const char* CBTextSearch(const char* pSearchStr, const char* pStr, int textLen)
{
if (!pSearchStr || !*pSearchStr)
return pStr;
if (!pStr || !*pStr)
return NULL;
if (textLen < 0)
textLen = (int)strlen(pStr);
int searchStrLen = (int)strlen(pSearchStr);
int pSkipTable[256];
int i;
for (i = 0; i < 256; i++)
pSkipTable[i] = searchStrLen;
for (i = 0; pSearchStr[i]; i++)
pSkipTable[(BYTE)pSearchStr[i]] = searchStrLen - 1 - i;
register int right = searchStrLen - 1;
while (right < textLen)
{
int j;
for (j = searchStrLen - 1, i = right; j >= 0 && pSearchStr[j] == pStr[i]; j--)
i--;
if (j == -1)
return &pStr[i + 1];
right = max(i + pSkipTable[(BYTE)pStr[i]], right + 1);
}
return NULL;
}
const wchar_t* CBTextSearch(const wchar_t* pSearchStr, const wchar_t* pStr, int textLen)
{
if (!pSearchStr || !*pSearchStr)
return pStr;
if (!pStr || !*pStr)
return NULL;
if (textLen < 0)
textLen = (int)wcslen(pStr);
int searchStrLen = (int)wcslen(pSearchStr);
int* pSkipTable = (int*) _alloca(searchStrLen * sizeof(int));
int i;
for (i = 0; i < searchStrLen; i++)
pSkipTable[i] = searchStrLen - 1 - i;
register int right = searchStrLen - 1;
while (right < textLen)
{
int j;
for (j = searchStrLen - 1, i = right; j >= 0 && pSearchStr[j] == pStr[i]; j--)
i--;
if (j == -1)
return &pStr[i + 1];
for (j = searchStrLen - 1; j >= 0; j--)
{
if (pSearchStr[j] == pStr[i])
{
right = max(i + pSkipTable[j], right + 1);
break;
}
}
if (j < 0)
right = max(i + searchStrLen, right + 1);
}
return NULL;
}
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
Hi Joe,
That was it. I did modify a bit to get a compile under boring old 'C': pSkipTable[(unsigned)pSearchStr[i]]
Thanks.
Jeff
|
|
|
|
|
I've been using Visual C++ V6.0 for some years now. I believe it's not possible to reuse the code for a dialog box created in one app in another. Is this true? If not, how do I do it? If it is true, is there a more recent version of C++ that permits reuse? Many thanks, David George
|
|
|
|
|
What do you mean by "code for a dialog box"? Do you mean the class derived from CDialog or do you mean the resource of the dialog that sits in an .rc file?
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
That was quick! I think I mean both of them. First the dialog resource created in the dialog editor and the class, based on CDialog, used to manage it. Many thanks for a speedy response. DG
|
|
|
|
|
Unless you're not telling us all of your requirements, the two pieces you mention can be put into another project with little to no changes.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"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
|
|
|
|
|
The requirement I have is simply to copy the code (both resource and management class) from a prototype program and paste it into another different program, so it can be used with little or no modification. I have no specific program in mind at the moment. But I would like to build a library of dialog resources for future programs I write if this is possible. I have no idea how it could be done. Once again, many thanks, DG
|
|
|
|
|
As other speedy people already pointed out, you can reuse dialog resources and classes, unless they are not written to be reusable. I used an .rc2 file, giving a "string ID" to the dialog resource instead of a numeric one, placing the control/commond IDs into a "custom resource.h" and of course the .h and .cpp for the class of the dialog to move commonly used things around projects and this works fine, you just have to remember that you have to explicitly set the .rc2 to be compiled by the resource compiler tool otherwise the resource won't be added to your executable and then you can scratch your head why your dialog does not get displayed when it should.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
oh yea!
that brought nostalgic memory when we did all sorts of resource sharing in RC2 files in the late 90's.
Yusuf
Oh didn't you notice, analogous to square roots, they recently introduced rectangular, circular, and diamond roots to determine the size of the corresponding shapes when given the area. Luc Pattyn[^]
|
|
|
|
|
"The older the grandpa', the longer he had to walk in the biggest storms barefoot to school in his days".
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
As I recall, you can copy a dialog box from the resources of one VC6 project to another. You open them both with the dialog resources visible, hold down Ctrl, click on the resource for the dialog you want to copy, and drag it to the resources window of the other project.
|
|
|
|
|
Hi,
I've reused dialogs where I made a .h and .cpp file that defined the class and a .rc file to define the dialog layout. I based the class on ATL::CDialogImpl<...>. Though I couldn't use a .rc file straight from one project in another, I had to do some work to make sure the .rc file for the dialog contained nothing but information on the actual dialog. I then #include'd the .h and added the .rc as a resource to a new project.
|
|
|
|
|
Hi guys and gurls,
Does anyone know how u can get two dates and then work out the difference s that it can display someones age?
|
|
|
|
|
In MFC:
To get two dates from controls on a dialog, look at: CDateTimeCtrl.
To work with date / times, use CTime.
To subtract them, you can use CTimeSpan also.
That should give you things to search for and learn from.
Iain.
In the process of moving to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), give me a job!
|
|
|
|
|
|
No im using visual basics and i really only know the basics of visual so dont really knowhwo to use what you have suggested
|
|
|
|
|
Neal beavis wrote: No im using visual basics
Why are you posting this in the C++ forum then ?
|
|
|
|