|
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 ?
|
|
|
|
|
sorry everyone i get them mixed up everytime visual studio
|
|
|
|
|
So, you are using Visual C++ then ?
Which kind of application did you create (console, win32 or MFC) ?
|
|
|
|
|
|
Neal beavis wrote: No im using visual basics and i really only know the basics of visual
Good pun.
BTW be aware: Visual Basic developers shouldn't taint this forum.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
That's no sooo difficult. Like you are able to compute, inwardly, someone's age, given its date of birth, so you should be able to code the algo.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
culd you use something like
cin>>dateToday
cin>>birthDate
cout<<dateToday-birthDate=age
?
|
|
|
|
|
It actually doesn't look a good plan.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
How about difftime() ?
"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
|
|
|
|
|
how do u use this my friend :s
|
|
|
|