|
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
|
|
|
|
|
Actually I wanted what you first described... But reflecting on it, I only want to use the aggregate for subtypes of the myClass_Object class, so that may bring me to your second case...
Is it so, that when I explicitly instatiate a supertype, that it will also work for all subtypes of that supertype??
In that case I am probably able to solve it the elegant way, anyway!
Thanx a lot!
Structured programming vs. chaotic mind boggling
|
|
|
|
|
HELP!!
I been trying for a while to get this right with various methods but to no avail..
the closest I got had little effect. Any help will be appreciated J
// In header file
//{{AFX_DATA(COutgoingMessage)
enum { IDD = IDD_MESSAGE_OUT };
CButton m_btnOK;
CButton m_btnCancel;
CStatic m_ctlToLabel;
CStatic m_ctlTo;
CEdit m_ctlBody;
CString m_Body;
CString m_To;
//}}AFX_DATA
// in the source file
void COutgoingMessage::OnSetFont()
{
// TODO: Add your specialized code here and/or call the base class
CFont font, *pFont;
BOOL bCreated = font.CreateFontIndirect(&m_lf);
ASSERT(bCreated);
// Done with the font. Delete the font object.
pFont = &font;
CDialog::OnSetFont(pFont);
m_ctlBody.SetFont(pFont);
font.DeleteObject();
//UpdateData( FALSE );
}
// NOTE !! I have tried many different methods this is the only method that shows a difference. However the is no visual chance in the font face!
can anyone give me any suggestions??
I have used the CLabel class elsewhere and found it useful, I tried to create my own CMyEdit Class using this as an example but to no avail..
what am I doing wrong??
|
|
|
|
|
font.DeleteObject();
You're deleting the font. Don't do that.
Move the CFont object to a member variable of COutgoingMessage .
--Mike--
http://home.inreach.com/mdunn/
Ford: How would you react if I said that I'm not from Guildford after all, but from a small planet somewhere in the vicinity of Betelguese?
Arthur: I don't know. Why, do you think it's the sort of thing you're likely to say?
|
|
|
|
|
Thanx for the info,
I made the changes yoy sudjested but now I cant see the text.. the font appears 'transparent', I can type and the cursor appears to move??
I do have a OnCtlColor that changes the color of the edit box .. but even if I diable this I get the same result???
any ideas??
|
|
|
|
|
Where I can find a DirectShow-campatible MPEG-2
Decoder that software based???
Please help me, thanks.
|
|
|
|
|
We are working on a Graphic designing application, which uses more system resources. So when app. starts, it works in a normal speed. But as other applications are started, our application slows down.
|
|
|
|
|
Because they too are taking up CPU cycles and yours is very resource hungry, from the sound of it.
You can set the priority of your program to help alleviate this, but don't go too high or you'll bring down your system, or make other programs behave unreasonably sluggishly. The idea lsolution is to increase your priority when you have the focus, and decrease when you do not, and let the user decide the level to which this occurs.
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.
|
|
|
|
|
So add more memory. You're running into swap issues most likely.
|
|
|
|
|
i'm trying to write a small win32 console program that will output security for each directory on a hard drive.
i can iterate through each ACE in a DACL easy enough, but i'm stumped as to how to figure out what access is allowed by the ACE->Mask 32-bit DWORD value. Any help interpreting this is greatly appreciated... Thanks!!!!
"A friend will help you move. A real friend will help you move a dead body."
|
|
|
|
|
i figured this out...
if anyone's interested, the process is to create access masks for each type of access you want to check, and run the function
BOOL bAccess = AreAllAccessesGranted(Mask, DesiredMask);
and check the return BOOL value.
|
|
|
|
|
How to set gatekeeper when i use netmeeting sdk?;P
hi
|
|
|
|
|
Question #1.
Anyone know how to make a tooltip show all the time? I have created my own thumbnail control derived from CWnd for displaying thumbnails... duh. And I want the tooltip to stay on and follow the cursor like i've seen on some webpages.
Question #2.
I'm having a difficult time with the tooltips when I scroll. It seems to get the tooltips all confused so they forget to popup. I think it has something to do with the tooltip rect and when I scroll that rect has moved and is no longer valid.
Anyone have any ideas on these 2 items?
|
|
|
|
|
#1: you need 'tracking tooltips'. More info in Platform SDK/User interface services/Windows Common Controls/Tooltip Controls/Using Tooltip controls.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Thanks. There's not a lot of info about 'tracking tooltips' in MSDN. Do you know of any other resources with perhaps a code sample?
|
|
|
|
|
There's not a lot of info about 'tracking tooltips' in MSDN
MSDN has the example code that creates a tracking tooltip and moves it around. It's demonstrated with plain Win32, but it should be trivial to use it with MFC.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
I have an SDI CFormView. Lets say the single page is called CMyFormView. I put a property sheet inside CMyFormView, so I created files:
CMyPropertySheet.h and, CMyPropertyPage1.h
CMyPropertySheet.cpp CMyPropertyPage1.cpp
How can I send a value from CMyFormView to CMyPropertyPage1? The user in CMyFormView typed in some informatoin. I want to know what informatoin they typed while in CMyPropertyPage1.
Currently I save it to a file, and then when they click on a button which pops up a CDialog that contains a property sheet and pages, I then retrieve that informatoin from a file. I was wondering if there is an easier way. Please, any response any one can give me will be greatly appreciated.
Sincerely,
Danielle (an overworked graduate student)
|
|
|
|
|
Is there a way to manage Outlook Express accounts programmatically? I'm working on setup utility and so far i have tried to use automation (i'm still a visual newbie ) and to edit registry.Now you can guess - the problem is crypted password entry . Is there any other way beside hacking Internet Account Manager crypt function? OLE? Automation? Any documentation on the net? Or am I on the worng way? Thanks in advance.
|
|
|
|
|
A series of projects from this site requiere this file. I'm using VC 5.0 and I don't have it. From where can I get it? Pretty pleasssse!
|
|
|
|
|
I don't know why the browser didn't show it. Sorry, big mistake on my part!
|
|
|
|
|
afxdtctl.h contains definitions for MFC classes added in VC 6. Putting that header file in a VC 5 install will do no good since VC 5's MFC doesn't have those classes at all.
--Mike--
http://home.inreach.com/mdunn/
Ford: How would you react if I said that I'm not from Guildford after all, but from a small planet somewhere in the vicinity of Betelguese?
Arthur: I don't know. Why, do you think it's the sort of thing you're likely to say?
|
|
|
|
|
I'm kinda new in VC programing. What does Owner Draw means. If you use the resource editor then it's not an owner drawn? Does it mean that you have to draw it yourself, and it means that you can draw any crazy control you can think of?
Thankz for you time reading this!
|
|
|
|