|
Another problem with linking statically is that every app that uses a statically linked copy of MFC will have its own copy of MFC in memory, whereas if two or more apps both use the dll, only one copy of the dll needs to be loaded into memory
--
Help me! I'm turning into a grapefruit!
|
|
|
|
|
benjymous wrote:
will have its own copy of MFC in memory
well, more accurately, it will have in-memory the parts that it uses, not all of MFC.
-c
"[it was..] one of those evenings when you feel that not only will there definitely be a revolution, but that the Association of Manufacturers will foot the bill."
-- Umberto Eco, Foucault's Pendulum
|
|
|
|
|
Static linking is the safest way to ensure that your executable will work regardless of what happens elsewhere in the system. It also makes for a smaller distributable (since you don't have to include the 1 meg+ MFC DLLs), and does not necessarily have a huge impact on exectuable size (since the linker is pretty good about thoring out unused code).
|
|
|
|
|
its a trade off
if u can control the environment to some extent then dynamic linking will be cool
otherwise i use static linking
i had a client who used another app that used crystal reports but that one used a really old version of the dll's and we had endless problems with both apps running on the same machine ... we ended up running one on terminal server
u cant escape all problems either way i guess
"... and so i said to him ... if it don't dance (or code) and you can't eat it either f**k it or throw it away" biz stuff about me
|
|
|
|
|
Hi! I come across a strange thing: I try to gray a menu
item, the codes as follow:
CMenu *pMenu = GetMenu();
CMenu *pOP = pMenu->GetSubMenu(2);
pOP->EnableMenuItem(ID_OP_START, MF_GRAYED | MF_BYCOMMAND);
******************************************************
The menu item with ID ID_OP_START is supposed to be
grayed and GetMenuState() does return MF_GRAYED; but the
item is actually not grayed and can still function as
it does. Do I need to do something in order for this
method to work?
Thanks a lot!
|
|
|
|
|
Wenrich wrote:
Do I need to do something in order for this
method to work?
What you're doing will work for a menu attached to a dialog in a dialog based app. However, if you're using MFC's doc/view framework (SDI/MDI), you need to put the enable/disable logic in the command's UpdateUI handler.
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Ravi Bhavnani wrote:
What you're doing will work for a menu attached to a dialog in a dialog based app. However, if you're using MFC's doc/view framework (SDI/MDI), you need to put the enable/disable logic in the command's UpdateUI handler.
This may be the case, but what if you need the change the menus from a different location other than in the UpdateUI handler? do you basically have to create a boolean to keep track of the state and then check it in the UpdateUI? Is this the only way?
Thanks!
Dan
|
|
|
|
|
Another method would be to handle the WM_INITMENUPOPUP message and enable/disable the items in that handler.
Roger Allen
Sonork 100.10016
I have a terminal disease. Its called life!
|
|
|
|
|
groover4life wrote:
create a boolean to keep track of the state and then check it in the UpdateUI?
Yes, that follows the standard MVC model and would be the preferred way imho.
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Hi
I am unable to open HELP from my visual studio environment. As soon as I click on any of the menuitems (contents, index etc) under HELP, the cpu shoots to 100% and it just sits like that.. I have also noticed that its allocating more and more memory, but the help window does not open at all.
MSDN was properly installed and it was working just fine before. I don't recall to have changed any of my settings.
I have already tried uninstalling/re-installing MSDN couple of times but no luck.
Any clues. Thanks
|
|
|
|
|
have u done a virus scan?
"... and so i said to him ... if it don't dance (or code) and you can't eat it either f**k it or throw it away" biz stuff about me
|
|
|
|
|
Hi, it happens the same to me, and it is not a virus.
Any help?
|
|
|
|
|
Hi,
I'm trying to find a way for an out-of-process COM server (built w/o MFC support) to control the client application's cursor (shape).
Up to this point, I've tried several different variations of LoadCursor/SetCursor; e.g.:
HCURSOR NewCursor = LoadCursor(0, IDC_WAIT);
HCURSOR OldCursor = SetCursor(NewCursor);
I've also tried to retrieve a handle to the client's window and modify the app window class' properties (for the cursor) ; e.g.:
HCURSOR NewCursor = LoadCursor(0, IDC_WAIT);
HWND hwnd = GetActiveWindow(); // returned a NULL value
DWORD OldCursor = SetClassLong(hwnd, GCL_HCURSOR, (LONG)NewCursor);
In all cases, the application builds but does not modify the cursor. I think the primary problem I'm dealing w/ here is the fact that the COM server is out-of-process.
Any suggestions?
Thanks,
Steve
|
|
|
|
|
Hello,
I have a strange problem with binding using the macro BEGIN_ADO_BINDING(CCustomRS) .
Here is my code:
#define INITGUID
#import "C:\Program Files\Common Files\System\ADO\msado15.dll" rename_namespace("ADOCG") rename ("EOF", "EndOfFile")
using namespace ADOCG;
#include "icrsint.h"
class CSeachCustRS : public CADORecordBinding
{
BEGIN_ADO_BINDING(CSearchCustRS)
ADO_FIXED_LENGTH_ENTRY(1, adInteger, m_lCustomerID, lCustomerIDS, FALSE)
ADO_VARIABLE_LENGTH_ENTRY2(2, adVarChar, m_szCompName, sizeof(m_szCompName), lCompNameS, TRUE)
..
..
END_ADO_BINDING()
public:
LONG m_lCustomerID;
ULONG lCustomerIDS;
CHAR m_szCompName[101];
ULONG lCompNameS;
..
..
};
I am getting these errors:
syntax: missing ';' before identifier 'ADORowClass'
CSearchCustRS::ADORowClass: missing storage-class or type specifiers.
The error line is the BEGIN_ADO_BINDING(CSearchCustRS) .
I have used this method successfully before, but now it will not compile...
If anybody has any experience in this area suggestions would be appriciated!
Thanks
|
|
|
|
|
just a spelling error! 'seach' instead of 'search'
gotta love that!
|
|
|
|
|
Look at the bright side! At least it only took you 2.5 hours to figure it out.
Nitron
_________________________________________--
message sent on 100% recycled electrons.
|
|
|
|
|
Hi
I write a wave file and want to play it with sndPlaySound, but all I get is a a beep from the PC speaker. PlaySound has the same effect. Other applications play my wave file fine, and I can play other sound files with sndPlaySound function. What is wrong?
tx
|
|
|
|
|
Hello,
I want to put a string in a XML document, but
sometimes the string can have character(s) that
are not compliant with XML, for example
put this string "<test>" doen't work because it's a
tag for XML.
What is the best way to convert a string into an XML
compliant format ?
A VC ++ function ?
A MSXML function ?
Thanks for your answers !!!
|
|
|
|
|
if you're using CStrings, you can just use the Replace member function
--
Help me! I'm turning into a grapefruit!
|
|
|
|
|
|
If you use msxml, this will be automatically handled when you write the xml file somewhere (stream, memory, disk). (" are replaced with ", < are replaced with <, and & replaced with & ).
How low can you go ? (enculage MS)
|
|
|
|
|
Hi all,
I have several *.mak files that I have modified to fix various issues in my builds. I need to be able to import these makefile back into the projects from which they came from. I cannot find a way to do this. Is this possible? Or do I have to physically add in the changes to the project file piece by piece? I thought there would be a quick and dirty way to import the makefile back in Visual Studio. Any help is GREATLY appreciated.
Thanks!
Danielson
|
|
|
|
|
Hello,
I want to ask how to store a String in 2-D array foramt?
e.g.
abc[0][0]="A";
abc[0][1]="AA";
abc[0][2]="AAA";
......
....
..
abc[n][n]="AAAAAAAAAAAAAAA";
THX!!!
;)
|
|
|
|
|
MFC or no?
Nitron
_________________________________________--
message sent on 100% recycled electrons.
|
|
|
|
|
Consider a vector of string objects.
Kuphryn
|
|
|
|