|
If you're targeting AutoCAD 2004, then you'll be forced to use c++. The .NET framework is only supported in AutoCAD 2005 and 2006. Also note, with c++ you'll be forced to use Microsoft Developer Studio 2002, NOT 2003 and AutoCAD itself is based on that version.
If you need more questions answered, please feel free. My company (http://www.cadfx.com) does this all day as we specialize in AutoCAD developement (but not limited to).
--
Joel Lucsy
|
|
|
|
|
I am new in Visual C++. I created MDI application, and I want to disable some menu for certain function. For example, I want to disable menu with ID_MENU00 ID, when doDisableMenu() is invoked
void doDisableMenu() {
CMenu menu;
menu.EnableMenuItem(ID_MENU00, MF_GRAYED);
}
but the result is an error of 'debug assertion failed'
what should I do to disable a menu?
thank you in advance
|
|
|
|
|
It doesn't work that way. When you have a menu item selected in the IDE, there are two messages you can catch. One is the click event, the other is called just before a menu item is shown. You keep a bool in your app to tell you if a menu item is disabled, and in that method, you take the menu item ( which is passed in from memory, as a pointer ), and you set if it's enabled or not using that boolean value. The same goes for check marks, etc. Any change to a menu items state happens in this event handler.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
houari_id wrote:
I want to disable some menu for certain function
The preferred method for this is in the ON_UPDATE_COMMAND_UI() handler.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
WHEN I TRY TO COMPIL, I HAVE THE NEXT MESSAGE
DEBUG WIN32
COMPILING
stdafx.cpp
C:\Program files .....\include\winnt.h(1092) error C2146: Syntax error: missing ';' before identifier 'KSPIN_LOCK'
C:\Program files .....\include\winnt.h(1092) fatal error C1004: unexpected end of file found
im working with winMe and, in some case i try to use direct x (#include <ddraw.h>)
so... help me !!!
|
|
|
|
|
It would help if you gave us the line in question, but the second error usually means that you have precompiled headers turned on, and you've not included stdafx.h
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Christian Graus wrote:
but the second error usually means that you have precompiled headers turned on, and you've not included stdafx.h
Won't that lead to a part of the message like: "... while looking for precompiled header."?
I also got the blogging virus..[^]
|
|
|
|
|
mikelon wrote:
C:\Program files .....\include\winnt.h(1092) fatal error C1004: unexpected end of file found
Check for a missing parenthesis, brace, comment, semicolon, or #endif. The file must also end with a carriage return–linefeed pair.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Could you tell me how can I get system menu by API ?
hmenu = GetSystemMenu(hWnd,1);
hmenu_options_thread1 = GetSubMenu(hmenu,1);
UINT uIDCheckItem;
uIDCheckItem = GetMenuItemID(hmenu_options_thread1,1);
smenu = new TCHAR[21];
GetMenuString(hmenu_options_thread1,uIDCheckItem,smenu,20,MF_BYCOMMAND);
MessageBox(hWnd, smenu,"Menu",MB_OK);
Thank you.
|
|
|
|
|
microsoftcertificate wrote:
Could you tell me how can I get system menu by API ?
hmenu = GetSystemMenu(hWnd,1);
This is how. What's the problem?
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
I want to get menu string but those lines could not give me a menu string.
Thank you.
|
|
|
|
|
This works fine for me:
char szBuffer[64];
HMENU hMenu = GetSystemMenu(hWnd, FALSE);
GetMenuString(hMenu, 0, szBuffer, sizeof(szBuffer), MF_BYPOSITION);
GetMenuString(hMenu, 1, szBuffer, sizeof(szBuffer), MF_BYPOSITION);
GetMenuString(hMenu, 2, szBuffer, sizeof(szBuffer), MF_BYPOSITION);
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Dear all,
How to detect what kind of browser is running and its version? For example, Netscape or IE; IE 5.0 or IE 6.0, ect.
Best regards,
|
|
|
|
|
Your question cannot be answered in its current form (as more than one browser can be installed at any given time). If you want to know the default browser, simply use FindExecutable() .
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
So, can we detect IE version?
BRs,
|
|
|
|
|
|
Yes, just use GetFileVersionInfo() and VerQueryValue() .
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
|
Hiya
I know this may be a VERY stupid question... but I have tried to find a way to toggle on the line numbering in MS Visual C++ 6.0... no success... anyone?
Thanks!
|
|
|
|
|
No such option exists. The only way to know what line the cursor is on is by the Line/Col indicator down in the lower right corner next to the keyboard status indicators.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
well... that sucks...
thanks anyway!
|
|
|
|
|
Hi everybody,
I have created an PopUp Menu in a CDialog...it works OK.
Now I want to create a PopUp Menu inside an ActiveX every time I click Button RIGHT of the mouse...
I have copied the code inside the function WM_RBUTTONDOWN...The problem is that it shows the Menu but it is DISABLED (it is shown but I can not select an option).
How can I do it to solve it...to make it enable?
Thanks
Here the code :
HMENU hMenu = ::CreatePopupMenu();
if (NULL != hMenu)
{
// add a few test items
::AppendMenu(hMenu, MF_ENABLED | MF_STRING & !MF_GRAYED, 1, "Change Color");
::AppendMenu(hMenu, MF_ENABLED | MF_STRING & !MF_GRAYED, 2, "Hide");
::AppendMenu(hMenu, MF_ENABLED | MF_STRING & !MF_GRAYED, 3, "Item 3-");
ClientToScreen(&point);
int sel = ::TrackPopupMenuEx(hMenu,
TPM_CENTERALIGN | TPM_RETURNCMD,
point.x,
point.y,
m_hWnd,
NULL);
CString s;
s.Format("The selected item is %d", sel);
TRACE(s);
:estroyMenu(hMenu);
|
|
|
|
|
javi_jmc wrote:
& !MF_GRAYED
These parts are not necessary, and will actually screw it up and make it not work.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
How do I implement 'delay' in VC++?
I also need to find out a way to get the "time elapsed" between two commands like when the data on the serial port goes high.
Can some one also give me info on the following -
GettickCount
Dword
VERIFY
ASSERT
dwcount
Thanks in advance.
-hithesh
|
|
|
|
|
Sleep is the command to make your app stop for a bit.
hithesh wrote:
Can some one also give me info on the following -
msdn.microsoft.com can.
hithesh wrote:
GettickCount
The GetTickCount function retrieves the number of milliseconds that have elapsed since the system was started. ( first hit on google )
hithesh wrote:
Dword
A DWORD is an unsigned long. It's a really big number.
hithesh wrote:
ASSERT
An ASSERT is a construct that will fail if the condition you pass it fails. This means that in debugging, you can check the assumptions that your code makes about the state of your application at any point. It is not included in release builds, and should be used for debugging only.
hithesh wrote:
dwcount
Is probably a variable called count, that is of type DWORD, and has been created using Hungarian notation ( where the first few letters of a camel case variable name denote the type of the variable )
Christian Graus - Microsoft MVP - C++
|
|
|
|