|
This is a loaded question. It depends what you want to do. If you want to get an interface up quickly, then the answer is obviously VB. If you want have maximum flexibility then you need C++, where you can create controls derived from those provided by MFC. Personally I have my doubts about how fast VB is compared to someone who is proficient in VC, but on the other hand your components are obviously going to be written to take advantage of VB's hiding implimentation details from you, which further simplifies your task.
Did I just recommend VB to someone ? I'm hoping not.... Personally I would go VC++/MFC if I was doing it professionally and VC++/WTL if I was doing it for fun ( because I've not done much WTL ).
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
Write it in whatever you are most experienced with. I had a similiar situation where I had a Telephony component written as a COM object. At first I thought that it would be easier and quicker to write the UI in VB. However in the end I decided to use MFC because that is what I've been using for the past 8 years.
Michael
|
|
|
|
|
Anyone know if the CDTPicker can do 00:00 - 24:00 format? If so, how does one achieve this?
Right now I can only get it to go from 00:00 to 23:59. If anyone could point me to some decent instructions regarding the control I'd most appreciate it.
Regards,
John
|
|
|
|
|
If anyone could point me to some decent instructions regarding the control
MSDN has more info here.
You can try to use 'callback fields' in the format string. However, I'm not sure if you'll be able to go beyond 23:59.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
>MSDN has more info here.
>
>You can try to use 'callback fields' in the format string. However, I'm not >sure if you'll be able to go beyond 23:59.
Thanks for the advice, and I think that the callback fields will work provided I can do one of the following:
a) Get access to the event of a click on the dtpicker's spin control so that I can use it to modify the psuedo-hour-field that I created.
or
b) Get the dtpicker to display itself such that the spin control AND the drop down menu are not visible nor accessable. I don't want to give the user any false affordances.
Regards,
John
|
|
|
|
|
What's the problem?
After 23:59 comes 00:00.
I have never ever seen anything showing the clock as 24:00, its always 00:00 or 0:00.
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
24:00 is a valid time according to ISO 8601. 24:00 on day N == 00:00 on day N+1. The seconds field should be able to show values 00-60 bacause of leap seconds. See here for more information.
|
|
|
|
|
24:00 is a valid time according to ISO 8601.
It seems like you are right about that.
But, you would only show 24:00:00 for a single second, then it would shift to 00:00:01.
And leap seconds... How often do you need one of those in a timepicker?
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
>How often do you need one of those in a timepicker?
For my purposes I just need to be able to enter a time into a database for any given day, and I have to be able to input from 00:00 all the way to 24:00 for that day. So yes, if I can get the timepicker to read 24:00:00 then that will be just fine. The problem is how? I can't find any way to go past 23:59 right now.
Regards,
john
|
|
|
|
|
I'd like that all common controls such as CEdit and CButton have a specific function. But it is not implemented in the CWnd class. How can it be derived by the children of CWnd? Or is there any way else to solve this problem without changing code of MFC?
Tiny Flying Elephant
I love flying...
|
|
|
|
|
Please be more specific. What do you want to achieve with this special function?
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
I'd like to make a little modification on the MFC source provided in directory "\Program Files\Microsoft Visual Studio\VC98\MFC\SRC", but I just don't know how to let the modified code take effect.
Tiny Flying Elephant
I love flying...
|
|
|
|
|
Might I suggest this is a hugely BAD idea ? I'm not sure if it can be done, but if you do it, you'll create code incompatible with MFC42.dll ( you'll need to statically link ) AND incompatible with every other development machine on the planet. Why not derive from the MFC class you want to change and make the change in your derived class ? That's what it is for.
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
When I use unicode in my CRichEditView based class I can input Unicode characters only from keyboard, and when I try input its by function SetWindowText every character, which takes code after FF, printing as two different character, how I can correct this.
|
|
|
|
|
Hi,
I'm exporting a template class from my MFC extension DLL, but as soon as I start using the template class outside the DLL, I get linker errors.
The template class in the DLL looks like this (myClass_Object is also defined inside the DLL):
template <class afx_ext_class="" caggregate="">
class AFX_EXT_CLASS myClass_Aggregate : public myClass_Object
{
public:
myClass_Aggregate()
{
....
}
...
}
I use the aggregate with a class from inside the DLL as the template class and the linker error looks like this (myClass_TreeFileNode is a subclass of myClass_Object):
DumpDB.obj : error LNK2001: unresolved external symbol "public: int __thiscall myClass_Aggregate<class myclass_treefilenode="">::IsEmpty(void)const " (?IsEmpty@?$myClass_Aggregate@VmyClass_TreeFileNode@@@@QBEHXZ)
Am I not exporting the class correctly??
Dave
Structured programming vs. chaotic mind boggling
|
|
|
|
|
Have you tried to implement a method
int IsEmpty(void)
{
...
return n;
}
???
Seems like the linker can't find the body of this function...
Is it a virtual class you are inheriting from?
Or is int IsEmpty(void) defined as:
in IsEmtpy(void) = 0; ??
|
|
|
|
|
I've implemented all the functions inside the class and it all worked when it was still outside the MFC Extension DLL...
There is one thing though, but I don't think it could cause this error: the implementation is done in the .h-file.
I would like to try to move the implementation to the .cpp-file, but I never got that working on a template class...
Structured programming vs. chaotic mind boggling
|
|
|
|
|
It shouldn't make any difference if the implementation is
in the header or in the cpp. The linker doesn't care.
It's just a matter of making readable code.
Doing all your implementation in the header, just makes the code
harder to maintain than necessary.
The key point is that the linker can't find the implementation
of that method.
|
|
|
|
|
the implementation is done in the .h-file.
So there's no need to mark the template as exported. What happens when you remove AFX_EXT_CLASS?
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
I tried it this way as well:
template <class caggregate="">
class AFX_EXT_CLASS myClass_Aggregate : public myClass_Object
{
public:
myClass_Aggregate()
{
...
}
...
}
but it doesn't make a difference. It just keeps on saying that it can't link to the specific templated instance... For example, when I do this:
myClass_Aggregate<myclass_object> bla;
it says it can't find the implementation of
myClass_Aggregate<class myclass_object="">::~myClass_Aggregate<class myclass_object="">(void)
The weird thing is that it apparantly CAN find the implementation of the CONSTRUCTOR...
I've been looking around a little, but am quite pessimistic about a good outcome for this problem.... Please help me before I get depressed
Structured programming vs. chaotic mind boggling
|
|
|
|
|
The code posted in last msg still contains AFX_EXT_CLASS. Are you sure you've actually removed AFX_EXT_CLASS?
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Wait, I'm a little off here, I guess....
I would like to use the template class outside the DLL (i.e. export the template class). But when I remove the AFX_EXT_CLASS from the class definition of myClass_Aggregate, the class won't be exported at all, right? So then I won't be able to use it outside the DLL, right???
Or perhaps I don't understand this very well...
Structured programming vs. chaotic mind boggling
|
|
|
|
|
1) When you post code, replace > and < with > and <. The template arguments are lost without that - I had to view the HTML source to find out that you're using AFX_EXT_CLASS in template argument declaration. This isn't necessary.
2) Template itself doesn't produce any code, so there's no need to export it. All information is in .h file, as you have already mentioned.
3) Your template derives from non-template myClass_object. This class must be exported.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
>1) When you post code, replace > and < with > and <. The template arguments are
>lost without that - I had to view the HTML source to find out that you're using
>AFX_EXT_CLASS in template argument declaration. This isn't necessary.
Whoops. Sorry. Never thought of that. Pretty stupid of me.
>2) Template itself doesn't produce any code, so there's no need to export it. All
>information is in .h file, as you have already mentioned.
Right.
>3) Your template derives from non-template myClass_object. This class must be exported.
It was already exported, but it didn't seem to help. My theory about the whole messy situation is that template-classes can't be exported. I read somewhere else over at CodeGuru.com that the template construction is a compile-time trick and since the extension dll has already been compiled, it probably can't use any template classes.
I've solved the problem by repeating the code of the template class inside the .h-file that I distribute together with the .lib en .dll file. That way it is compiled both in the extension DLL and in the application that uses the dll. Not an ideal solution, but it works for now.
If anyone has valuable input about this situation, I'd love to hear it!
Thanks for all your help so far.
Dave
Structured programming vs. chaotic mind boggling
|
|
|
|
|
What exactly do you want to achieve? Do you want users of your DLL to pass types unknown inside the DLL as template arguments?
myClass_aggregate<classFromSomeOtherExeOrDll> x;
In this case, you need to distribute .h file. Template construction occurs at compile time - this is no surprise, because template itself is not a complete type. Compiler needs to know what are the template arguments.
Or -- maybe you just want to export a few specializations of your template, like this:
myClass_aggregate<classFromThisExtenstionDll> y;
myClass_aggregate<anotherClassFromThisExtenstionDll> z;
In this scenario you have one more option - you can explicitly instantiate the type. See "Explicit Instantiation" in C++ Language Reference included in VC++ help and KB article Q168958 for more details.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|