|
I want to disable the SAVE toolbutton on the toolbar.
For this I tried the foll in the MainFrame's OnCreate Event.
TBBUTTONINFO buttonInfo;
buttonInfo.cbSize = sizeof( TBBUTTONINFO );
buttonInfo.dwMask = TBIF_COMMAND || TBIF_STATE ;
buttonInfo.idCommand = ID2_FILE_SAVE;
buttonInfo.fsState = TBSTATE_INDETERMINATE ;
int xxx = m_wndToolBar.GetToolBarCtrl().SetButtonInfo(ID2_FILE_SAVE, &buttonInfo);
I wonder I initially got the SAVE toolbutton to grey out .But it wont happen anymore I dont understand why .Now its hidden but clicking it brings the Save Dialog box which means its still not disabled.
In another function I tried to enable it with the foll.code.
TBBUTTONINFO buttonInfo;
buttonInfo.cbSize = sizeof( TBBUTTONINFO );
buttonInfo.dwMask = TBIF_COMMAND || TBIF_STATE ;
buttonInfo.idCommand = ID2_FILE_SAVE;
buttonInfo.fsState = TBSTATE_ENABLED ;
int xxx = m_wndToolBar.GetToolBarCtrl().SetButtonInfo(ID2_FILE_SAVE, &buttonInfo);
But it wont enable .It wont become visible either.I dont understand.Please let me know the mistake.
Thank u .
laiju
|
|
|
|
|
See here[^]
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it! Honoured as one of The Most Helpful Members of 2004
|
|
|
|
|
thanx for ur help .but the documentation tells to update through update handler. I havent clearly understood how the handler can be associated to a toolbutton.
laiju
|
|
|
|
|
I don't feel like repeating here what the article says, so read the article I linked to and be sure to follow the links in the article, they link to more detail.
Basicly you link the command handler, the command update handle, the command's menu item, the command's toolbar button, the command's toolbar bar button's tooltip text, and the command's status bar text through a common ID number.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it! Honoured as one of The Most Helpful Members of 2004
|
|
|
|
|
Hi
i want to learn windows graphics programming with mfc or pure api. plz. suggest some good and easy to understand books.
|
|
|
|
|
I wanna know what class and function of that class can help me to get the output of the DOS commands in VC.I wanna get the output(not just see it but to store it in file).Do help.
Thanks.
Be FaithFull To Your Work.
|
|
|
|
|
|
hi
the "Go To Reference" menu item is grayed out in my editor and i cant figure out how to enable it .
Any suggestion?
|
|
|
|
|
Try this[^]
<bold>- Nilesh
<italics>
"Reading made Don Quixote a gentleman. Believing what he read made him mad" -George Bernard Shaw
|
|
|
|
|
Recently I ran across a client using MFC and serializing all thier objects to disk. They have a very large customer base and a huge number of serialized files for the system. This started me thinking about the transition to a 64 bit system. Is anything written to the files when serialized relative to the environement(32 bits, etc), or is it stictly just a binary memory dump( of sorts ) to disk??? If indeed it is just a memory dump, isn't that going to case alot of grief when trying to unserialize(read) the data on a 64 bit system, when the data was written on a 32 bit system and the size of int, float, doubles, etc has changed, or has Longhorn made provisions for this already and allows programs to maintain the 32 bit variable sizes?????
TIA
|
|
|
|
|
Hello,
I am currently writing a wrapper DLL in VC++ 6 so that I can use specific SDK functions from VB .Net. (VB .Net can access the function through "Private Declare Function GetDuration Lib "Path\Wrapper.dll" (parameters)")
In my C++ DLL I need to pass an "HWND" value to an SDK function; however, when I use "AfxGetApp()->m_pMainWnd" the compiler returns two errors:
'AfxGetApp' undeclared identifier<br />
left of '->m_pMainWnd' must point to struct/class/union
Am I trying to retrieve my DLL's "HWND" correctly or is there a better function than "AfxGetApp()" to use in a DLL?
[Edit]
If I use "AfxGetMainWnd()" instead, I only get one error:
'AfxGetMainWnd' undeclared identifier
I am unsure why it says that "AfxGetMainWnd" is an undeclared identifier. [/Edit]
Any help would be greatly appreciated,
Mitch
My sig:
"And it is a professional faux pas to pay someone else to destroy your computer when you are perfectly capable of destroying it yourself." - Roger Wright
Get Perpendicular! (Hitachi Storage)
My CodeProject Blog
Most recent blog post: April 11
|
|
|
|
|
Afx... functions are MFC functions. Add MFC support to your dll and they should work.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it! Honoured as one of The Most Helpful Members of 2004
|
|
|
|
|
Mitch (Programmer2k4) wrote:
In my C++ DLL I need to pass an "HWND" value to an SDK function; however, when I use "AfxGetApp()->m_pMainWnd" the compiler returns two errors:
In Continuation With Mr Arend, you need a window in DLL too, as there by default no window present in DLL, So AfxGetApp() function is of no use!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
In a bit of assembly code I have seen this code:
JB *+3.
Does it mean a scale of 1 and a displacement of 3. Am I correct? What is the Index register and the Base register? How do I find out what they are. According to documentation there can be a number of registers.
I am the handsome one in the crowd.
|
|
|
|
|
Franz Klein wrote:
I am the handsome one in the crowd.
but not the smartest
C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg
|
|
|
|
|
mailMonty wrote:
but not the smartest
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
I am sorry I am not a genius like you are.
But then again seeing that you cannot answer a simple answer I wonder how smart you are?
I am the handsome one in the crowd.
|
|
|
|
|
Franz Klein wrote:
I am sorry I am not a genius like you are
Hain Franz, I am sorry, I am not laughing at you i am just smiling comment written by Mr. Monty!
It's seems it's hurt you, I am sorry for that
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
Help!
I have tried everything and checked anything that could cause this insidious message from appearing in the debugger output window.
"First-chance exception in MyTestApp.exe (KERNEL32.DLL): 0xC0000005: Access Violation."
This application is a appwizard generated from VC 6.0 "new" etc. no code modified.(freshly reinstalled by the way)The first clue that there is something wrong is that when I try to add the OS symbols for debugging, I get a message like "the files don't match"
I have Visual Studio 6.0 Professional with SP-5, recently updated to SP-6 to no avail. The workstation is a Windows2000 system with SP4 and 512 M Ram 80 GB HD and 1.7 GHz CPU. This seems to have started recently after many system updates, but don't know if any of these change the operating system RT libraries ?? IE 5.5-->IE 6.0 ??, MS Platform SDK ??
Do I need the DDK as well for Windows 2000 ??
Note that these projects appear to run fine in both release and debug form.
Has anyone experienced this before?
How did you get rid of this problem?
|
|
|
|
|
First chance exceptions are always shown in the output window when ever an exception is generated. If it occurs within a try block, and is caught by a catch block then there is no problem and your program will run fine. If it is not caught your program will crash.
If you want your program to always stop whenever the exception is generated then goto menu "Debug->Exceptions" and set "Access Violation" to "Stop always".
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it! Honoured as one of The Most Helpful Members of 2004
|
|
|
|
|
I don't have the kernel32 or NTDLL debugging symbols installed so tracing is quite difficult and really can't learn much from it anyway. The point is that this code is MS code that is producing the access violations. To clarify where and when it happens, any time a resource is accessed from the GUI, be it a menubutton, dialog box, combo control any thing. The projects I have created show no problems on my system at work with identical OS's and IDE configurations etc.. Further-more these problems are even seen on simple "Hello World" applications created from the app-wizard which is what I was saying earlier. I have normally never seen these apps fail because they have minimal controls and virtually no resource allocation of complex data structures what so ever. Most of MSVC example code works normally as advertised and on working systems do function correctly, but not on my system, they all produce the error messages. I'm still confused!
I don't know what else to try.
thanx
|
|
|
|
|
If this helps:
The debugger always seems to catch the exception inside the kernel32 DLL and call trace points to location 7C597EFB. Not having the symbols installed is a real handicap to debugging. Does anyone recognize this function call? Backing further out of the call stack I see that this MFC function call was made:
BOOL AFXAPI AfxIsValidString(LPCSTR lpsz, int nLength /* = -1 */)
{
if (lpsz == NULL)
return FALSE;
return ::IsBadStringPtrA(lpsz, nLength) == 0;
}
Which of course is inside ValidAdd.cpp
Could there be prepocessor macro that has been changed somewhere in my MFC headers?
I find it highly unlikely that the system library itself has changed, if anything some definitions could have gotten changed within my development environment- but where?
|
|
|
|
|
I created a Chat Application in SDI and now i want that application to run on WEb Browser so that anyone on net can open it and start chatting without downloading the application. Is there any possible way?
|
|
|
|
|
Adeel688 wrote:
Is there any possible way?
Nope
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
There was a MIND article out many years ago that illustrated how to write an MFC SDI/MDI application and encapsulate it as an ActiveX control such that it could be run from a browser.
You should be able to find it by poking around on the MSDN Magazine Web site. If you can't, let me know and I'll see if I can find it.
|
|
|
|