|
I've tested this with a combination of english Windows + english office, but I need it work in both, spanish and english systems.
|
|
|
|
|
I have a problem with the macro IMPLEMENT_SERIAL in VC7.
What I have is a BaseDLL containing BaseClass which at compile time is exported from the dll.
class __declspec(dllexport) BaseClass : public CObject
{
DECLARE_SERIAL(BaseClass)
...
}
I also have got a DerivedDLL containing DerivedClass and AnotherClass. At compile time it would look like this
#include <basedll baseclass.h="">
class __declspec(dllexport) DerivedClass : public BaseClass
{
DECLARE_SERIAL(DerivedClass)
...
}
class __declspec(dllexport) AnotherClass : public BaseClass
{
DECLARE_SERIAL(AnotherClass)
...
}
When compiling DerivedDLL, BaseClass has the following look
class __declspec(dllimport) BaseClass : public CObject
{
DECLARE_SERIAL(BaseClass)
...
}
In the implementation file of DerivedClass and AnotherClass I have
IMPLEMENT_SERIAL(DerivedClass, BaseClass, 1)
IMPLEMENT_SERIAL(AnotherClass, BaseClass, 1)
This IMPLEMENT_SERIAL macro doesn't seem to work correctly (although it seems to work in VC6). When adding the classes to the DerivedDLL's list of run-time classes one of the classes is cut off and later on the program can't find the run-time class of AnotherClass.
I've found out that if I exchange BaseClass to CObject it works, but I don't know if it works correctly.
If I move BaseClass from BaseDLL to DerivedDLL it works, but I don't want BaseClass in DerivedDLL.
If I make sure that when compiling DerivedDLL that BaseClass is declared dllexport it works, but it might give me problems later since DerivedDLL doesn't have the implementation code of BaseClass.
Does anyone know why it doesn't work in VC7?
Does anyone have a safe work-around to the problem?
Is there a bug in the VC7 compiler?
|
|
|
|
|
have you put:
IMPLEMENT_SERIAL(BaseClass, CObject, 1)
in the base class?
--
Help me! I'm turning into a grapefruit!
|
|
|
|
|
|
Is your .dll 'MFC extension DLL' or rather 'MFC regular DLL'?
Tomasz Sowinski -- http://www.shooltz.com
*** Si fractum non sit, noli id reficere. ***
|
|
|
|
|
Both DLL-files are built as 'MFC Extension DLL'.
|
|
|
|
|
I want to chage the font that uses CTreeCtrl to draw the text items but I don't know how to do. Can you give help me ?
|
|
|
|
|
|
I write a view from CHtmlView to display a html file. But the file is very large. I should pagedown many times to the end.
My problem is how can the view remember the line I read last time? Next time I open the view it should goto the line I read last time.
|
|
|
|
|
Create an anchor <a name="..."> in your html file.
sometimes it helps to look at the IL generated code
a MS guy on develop.com "answering" .NET issues
|
|
|
|
|
Hi, Is there any way of retrieving the process/module version through the PSAPI?
Thanks in advance
Black ghost
|
|
|
|
|
No, PSAPI is not meant for that.
Once you've got the process name, just use the ::GetFileVersionInfo to get what you're looking for.
Note : you will have to include <winver.h> in your code, and link with version.lib.
sometimes it helps to look at the IL generated code
a MS guy on develop.com "answering" .NET issues
|
|
|
|
|
Hi. I've read that the "MS Shell Dlg" font refers to the system-wide font used in menus, edit boxes, etc. How do I create a CFont object for that font? I'm trying to dynamically create a CEdit control which uses the basic "MS Shell Dlg" font.
Thanks,
Dave
|
|
|
|
|
Daaave wrote:
How do I create a CFont object for that font?
You can't. "MS Shell Dlg" is not a real font; it is a special name recognized only by the OS code that parses dialog templates. To get the font used for dialogs, call GetStockObject(DEFAULT_GUI_FONT)
--Mike--
Just released - 1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
Sweet thanks man
|
|
|
|
|
I have a Web Browser control and want to download external files like images, *.css, *.js and etc.
The SRC attribute of <IMG> <LINK> <SCRIPT> can contains absolute and relative URLs. How to correctly obtain full URL for these files? May be there is a ready system function to download such files? I tried URLDownloadToFile, may be I must try URL monikers?
Thanks!
|
|
|
|
|
window.location.href is the actual URL. Just parse this, and add your resource name.
sometimes it helps to look at the IL generated code
a MS guy on develop.com "answering" .NET issues
|
|
|
|
|
Well, I finally got a hold of Visual Studio .NET and now I'm trying to rebuild my DLLs which contain a bunch of MFC-based classes. I'm getting tons of errors, the first of which I don't have a solution for.
I have a string class which derives from CString and uses the old m_pchData protected member from 6.0. So now since apparently it's no longer in CString, I get a 'm_pchData' : undeclared identifier error.
What should I do? My class needs the equivalent of this member variable.
Thanks,
Alvaro
Insanity: doing the same thing over and over again and expecting different results. - Albert Einstein
|
|
|
|
|
|
Unfortunately the MFC7 CString uses STL : typedef ATL::CStringT< TCHAR, StrTraitMFC< TCHAR > > CString; .
You may just as well extract the CString implementation from the MFC6 classes.
(afx.h + strcore.cpp)
sometimes it helps to look at the IL generated code
a MS guy on develop.com "answering" .NET issues
|
|
|
|
|
why were you trying to use a protected member?
for read, CString has an LPCTSTR operator, and for write you can GetBuffer() to get an LPTSTR pointer. You should use those, because that is the designed interface of CString.
Signature space for rent. Apply by email to....
|
|
|
|
|
Hi,
I've got direct CD installed on an SOE environment, and I would like to automate the formatting of CDRW's using the tool provided, but it looks like it's a shell extension.
Has anyone got any snippets of code which demonstrate the capture of a shell extensions function??
OR .
Is there a better way to format these discs.. I've looks at the UDF article here, but the app just doesn't seem to want to work with these disks/writers.
Please help
|
|
|
|
|
hey all, in my message map i catch and process ON_MESSAGE(WM_SETCURSOR, onSetCursor) and all the onSetCursor does is this:
if (waitCursor)
SetCursor(LoadCursor(NULL, IDC_APPSTARTING));
else
SetCursor(LoadCursor(NULL, IDC_ARROW));
when compiled in debug version everything works fine, but when compiled in release mode whenever the mouse goes over the app, therefor calling WM_SETCURSOR the program just crashes. Anyone got any ideas on how to fix this? thanks
Luke.
|
|
|
|
|
Sorry i forgot to mention that when i comment out ON_MESSAGE(WM_SETCURSOR, onSetCursor) release mode works fine and that why i'm pretty sure that it is that stuffing it up.
Luke.
|
|
|
|
|
Change ON_MESSAGE to ON_WM_SETCURSOR. The OnSetCursor handler must have the prototype BOOL OnSetCursor(CWnd*, UINT, UINT), whereas ON_MESSAGE describes a handler that has a prototype LRESULT MyHandler(WPARAM, LPARAM).
When the function is called, it is expecting a different number of parameters, and so the stack is getting screwed up - because of the different ways that the stack is managed in debug and release modes, this generally only shows up in a release build.
Dave
|
|
|
|