|
Go to the properties of the Edit control, select the styles tab and check the Number check box. This should work.
The only problem: you can only enter unsigned integer. If you need floats or signed numbers, you have to override the control. If you need that, I already done this, so, if you want I can send you the source files.
|
|
|
|
|
if you send me,I'll be happy
emroz
|
|
|
|
|
Ok, no problem. Just give me your email adress !
|
|
|
|
|
emroz2003@hotmail.com
emroz
|
|
|
|
|
I' ve build some applications with VC++ .NET 2003 Enterprise Architect, and somebody told me he thought the compiler isn't really compiling, because you still need to install your .NET framework. He also thinks it's the reason of the slowness of my application.
Can somebody tell me how this all works?
PS: I've used the debug mode in my compiler and not release. the release mode gives a lot of errors!
|
|
|
|
|
BoudewijnEctor wrote:
I've used the debug mode in my compiler and not release
That's probably why it is slow.
BoudewijnEctor wrote:
the release mode gives a lot of errors!
That's the second reason why it is slow. This shows that your code needs to be corrected to get it work well.
~RaGE();
|
|
|
|
|
Thanks,
I've rebuild some parts of my program, now it works
|
|
|
|
|
Assuming you haven't enabled the /clr switch (Use Managed Extensions in the General category of your project's Properties), the compiler should be producing native code. If you're not sure, run dumpbin /clrheader exe-name from the VS.NET Command Prompt. If it's a native executable, you'll get output like:
Microsoft (R) COFF/PE Dumper Version 7.10.3077
Copyright (C) Microsoft Corporation. All rights reserved.
Dump of file Work\Assorted Tests\RunTimeChecks\Debug\RunTimeChecks.exe
File Type: EXECUTABLE IMAGE
Summary
4000 .data
1000 .idata
3000 .rdata
13000 .text
10000 .textbss whereas if it does require the Framework, it will output something like:
Microsoft (R) COFF/PE Dumper Version 7.10.3077
Copyright (C) Microsoft Corporation. All rights reserved.
Dump of file c:\winnt\Microsoft.NET\Framework\v1.1.4322\CasPol.exe
File Type: EXECUTABLE IMAGE
clr Header:
48 cb
2.00 runtime version
EB60 [ 6ED4] RVA [size] of MetaData Directory
9 flags
6000010 entry point token
96A4 [ 5464] RVA [size] of Resources Directory
2050 [ 80] RVA [size] of StrongNameSignature Directory
0 [ 0] RVA [size] of CodeManagerTable Directory
0 [ 0] RVA [size] of VTableFixups Directory
0 [ 0] RVA [size] of ExportAddressTableJumps Directory
Summary
2000 .reloc
2000 .rsrc
14000 .text Typically, release build optimisations can now allow a release build to perform up to around 4x faster than your debug build. Add in the fact that you have extra code in your debug build (you are using assert , aren't you?) and this can be 6 or 8 times faster.
However, if your program is really slow, compiler optimisations aren't going to cut it. You need to look at your algorithms: how you're storing and manipulating data. Perhaps you should swap a linked list for an array, or vice versa - if you're using a lot of data, and inserting into the middle of a structure frequently, maybe you should be using a linked list. Conversely, if you don't have a lot of data - perhaps a small lookup table - you should use an array and search linearly rather than use a map.
--
Mike Dimmick
|
|
|
|
|
When I try your idea, the command window gives the next error:
The expression cannot be evaluated while in design mode.
What can I do about this?
Thank you in advance
|
|
|
|
|
Sorry this was unclear.
I meant, select 'Visual Studio .NET 2003 Command Prompt' from the start menu - it's normally found in Microsoft Visual Studio .NET 2003 > Visual Studio .NET Tools. This is simply a standard command prompt window which runs the vsvars32.bat file, which sets up your path variable to point to the NET Framework and Platform SDK tools.
The reason I suggested this is that VS 6.0's tools, if installed, are normally in your path, but 7.x's aren't. The /CLRHEADER switch is only in VS.NET's version of dumpbin.exe .
--
Mike Dimmick
|
|
|
|
|
Okay,
But what do I have to do when I want my code to run without the .NET framework, and the command line indicates it won't run without.
Is there a way to do this?
|
|
|
|
|
The simple answer is ensure you're not using any managed extensions[^] and ensure you're not compiling with the /clr switch.
The default, unless you selected any of the .NET project types when you created your project, i.e. ASP.NET Web Service, Class Library (.NET), Console Application (.NET), Empty Project (.NET), Windows Control Library (.NET), Windows Forms Application (.NET) or Windows Service (.NET), is that /clr is disabled, that is, the compiler will produce native code.
The setting in the Properties dialog is under Configuration Properties > General > Use Managed Extensions and should be set to No to build native code.
--
Mike Dimmick
|
|
|
|
|
Yeah okay,
This might work, but if I press the build solution button, VS says Iit can't find all those namespaces (System ,System::IO etc.), is there some kind of header file from wich I can use these namespaces, or is there a workaround for thsi problem.
There are some more errors reported by the compiler, I'll show them below. I think there caused by the fact that the classes they're referencing are in the missing namespaces!
Errors (form output screen):
------ Build started: Project: eerste versie, Configuration: Debug Win32 ------
Compiling...
stdafx.cpp
Compiling...
Form1.cpp
c:\boudewijn\eerste versie\eerste versie\eerste versie\Form1.h(26) : error C2871: 'System' : a namespace with this name does not exist
c:\boudewijn\eerste versie\eerste versie\eerste versie\Form1.h(27) : error C2653: 'System' : is not a class or namespace name
c:\boudewijn\eerste versie\eerste versie\eerste versie\Form1.h(27) : error C2871: 'ComponentModel' : a namespace with this name does not exist
c:\boudewijn\eerste versie\eerste versie\eerste versie\Form1.h(28) : error C2653: 'System' : is not a class or namespace name
c:\boudewijn\eerste versie\eerste versie\eerste versie\Form1.h(28) : error C2871: 'Collections' : a namespace with this name does not exist
c:\boudewijn\eerste versie\eerste versie\eerste versie\Form1.h(29) : error C2653: 'System' : is not a class or namespace name
c:\boudewijn\eerste versie\eerste versie\eerste versie\Form1.h(29) : error C2871: 'Forms' : a namespace with this name does not exist
c:\boudewijn\eerste versie\eerste versie\eerste versie\Form1.h(30) : error C2653: 'System' : is not a class or namespace name
c:\boudewijn\eerste versie\eerste versie\eerste versie\Form1.h(30) : error C2871: 'Data' : a namespace with this name does not exist
c:\boudewijn\eerste versie\eerste versie\eerste versie\Form1.h(31) : error C2653: 'System' : is not a class or namespace name
c:\boudewijn\eerste versie\eerste versie\eerste versie\Form1.h(31) : error C2871: 'Drawing' : a namespace with this name does not exist
c:\boudewijn\eerste versie\eerste versie\eerste versie\Form1.h(32) : error C2653: 'System' : is not a class or namespace name
c:\boudewijn\eerste versie\eerste versie\eerste versie\Form1.h(32) : error C2871: 'IO' : a namespace with this name does not exist
c:\boudewijn\eerste versie\eerste versie\eerste versie\Form1.h(33) : error C2653: 'System' : is not a class or namespace name
c:\boudewijn\eerste versie\eerste versie\eerste versie\Form1.h(33) : error C2871: 'Text' : a namespace with this name does not exist
c:\boudewijn\eerste versie\eerste versie\eerste versie\Form1.h(44) : error C2059: syntax error : 'public'
c:\boudewijn\eerste versie\eerste versie\eerste versie\Form1.h(44) : error C2059: syntax error : 'public'
c:\boudewijn\eerste versie\eerste versie\eerste versie\Form1.h(44) : error C2653: 'System' : is not a class or namespace name
c:\boudewijn\eerste versie\eerste versie\eerste versie\Form1.h(45) : error C2143: syntax error : missing ';' before '{'
c:\boudewijn\eerste versie\eerste versie\eerste versie\Form1.h(45) : error C2447: '{' : missing function header (old-style formal list?)
c:\boudewijn\eerste versie\eerste versie\eerste versie\Form1.h(164) : fatal error C1190: managed targeted code requires '#using <mscorlib.dll>' and '/clr' option
AssemblyInfo.cpp
AssemblyInfo.cpp(3) : error C2653: 'System' : is not a class or namespace name
AssemblyInfo.cpp(3) : error C2871: 'Reflection' : a namespace with this name does not exist
AssemblyInfo.cpp(4) : error C2653: 'System' : is not a class or namespace name
AssemblyInfo.cpp(4) : error C2871: 'CompilerServices' : a namespace with this name does not exist
AssemblyInfo.cpp(11) : error C3746: 'AssemblyTitleAttribute': only custom attributes can be used on assemblies or modules
AssemblyInfo.cpp(11) : error C2337: 'AssemblyTitleAttribute' : attribute not found; it is neither a built-in nor a custom attribute that is accessible in the current namespace
AssemblyInfo.cpp(12) : error C3746: 'AssemblyDescriptionAttribute': only custom attributes can be used on assemblies or modules
AssemblyInfo.cpp(12) : error C2337: 'AssemblyDescriptionAttribute' : attribute not found; it is neither a built-in nor a custom attribute that is accessible in the current namespace
AssemblyInfo.cpp(13) : error C3746: 'AssemblyConfigurationAttribute': only custom attributes can be used on assemblies or modules
AssemblyInfo.cpp(13) : error C2337: 'AssemblyConfigurationAttribute' : attribute not found; it is neither a built-in nor a custom attribute that is accessible in the current namespace
AssemblyInfo.cpp(14) : error C3746: 'AssemblyCompanyAttribute': only custom attributes can be used on assemblies or modules
AssemblyInfo.cpp(14) : error C2337: 'AssemblyCompanyAttribute' : attribute not found; it is neither a built-in nor a custom attribute that is accessible in the current namespace
AssemblyInfo.cpp(15) : error C3746: 'AssemblyProductAttribute': only custom attributes can be used on assemblies or modules
AssemblyInfo.cpp(15) : error C2337: 'AssemblyProductAttribute' : attribute not found; it is neither a built-in nor a custom attribute that is accessible in the current namespace
AssemblyInfo.cpp(16) : error C3746: 'AssemblyCopyrightAttribute': only custom attributes can be used on assemblies or modules
AssemblyInfo.cpp(16) : error C2337: 'AssemblyCopyrightAttribute' : attribute not found; it is neither a built-in nor a custom attribute that is accessible in the current namespace
AssemblyInfo.cpp(17) : error C3746: 'AssemblyTrademarkAttribute': only custom attributes can be used on assemblies or modules
AssemblyInfo.cpp(17) : error C2337: 'AssemblyTrademarkAttribute' : attribute not found; it is neither a built-in nor a custom attribute that is accessible in the current namespace
AssemblyInfo.cpp(18) : error C3746: 'AssemblyCultureAttribute': only custom attributes can be used on assemblies or modules
AssemblyInfo.cpp(18) : error C2337: 'AssemblyCultureAttribute' : attribute not found; it is neither a built-in nor a custom attribute that is accessible in the current namespace
AssemblyInfo.cpp(31) : error C3746: 'AssemblyVersionAttribute': only custom attributes can be used on assemblies or modules
AssemblyInfo.cpp(31) : error C2337: 'AssemblyVersionAttribute' : attribute not found; it is neither a built-in nor a custom attribute that is accessible in the current namespace
AssemblyInfo.cpp(55) : error C3746: 'AssemblyDelaySignAttribute': only custom attributes can be used on assemblies or modules
AssemblyInfo.cpp(55) : error C2337: 'AssemblyDelaySignAttribute' : attribute not found; it is neither a built-in nor a custom attribute that is accessible in the current namespace
AssemblyInfo.cpp(56) : error C3746: 'AssemblyKeyFileAttribute': only custom attributes can be used on assemblies or modules
AssemblyInfo.cpp(56) : error C2337: 'AssemblyKeyFileAttribute' : attribute not found; it is neither a built-in nor a custom attribute that is accessible in the current namespace
AssemblyInfo.cpp(57) : error C3746: 'AssemblyKeyNameAttribute': only custom attributes can be used on assemblies or modules
AssemblyInfo.cpp(57) : error C2337: 'AssemblyKeyNameAttribute' : attribute not found; it is neither a built-in nor a custom attribute that is accessible in the current namespace
Generating Code...
Build log was saved at "file://c:\boudewijn\eerste versie\eerste versie\eerste versie\Debug\BuildLog.htm"
eerste versie - 49 error(s), 0 warning(s)
---------------------- Done ----------------------
Build: 0 succeeded, 1 failed, 0 skipped
|
|
|
|
|
Ah, so this is a Managed C++ project (requiring the .NET framework).
If you're targeting native code, you can't use the Windows Forms model. You'll have to either write directly to the Win32 programming API, or use one of the many C++ wrappers (e.g. MFC, ATL, WTL).
For information on programming Windows apps using the Win32 API, read the classic Programming Windows, Fifth Edition [^] by Charles Petzold.
If you want to use MFC, read Jeff Prosise's Programming Windows with MFC [^].
If you want to use ATL or WTL, look in the appropriate sections on CodeProject. I wouldn't recommend this unless you're experienced in C++, especially with templates.
Your existing codebase requires the /clr switch.
You will get a slight performance hit with the Managed Extensions, especially as the code is first JIT-compiled, but it shouldn't be much more than a few percent. If you decide to go this route, see the Performance area on the MSDN .NET Framework Developer Center[^] for information on using the framework efficiently.
--
Mike Dimmick
|
|
|
|
|
Hi All,
I have MFC appliaction on which I am opening IE by pressing a button..I want to disable Right Click Context menu there..can I do that..I have absolutely no ideas..I have searched MSDN, google etc..no help..Please any help or pointers are thoroughly appreciated..
Thanks a lot in advance..
Himanshu
|
|
|
|
|
To OvwerRide the function "OnRButtonDown" maybe can work
|
|
|
|
|
Hi,
Thanks for your suggestion.I tried it but it didnt worked..as It can trap right click on the application..not on IE..opened afterwards..IE still has its own context menu..Please help and show any pointers..Thanks a lot in advance..
Himanshu
|
|
|
|
|
xxhimanshu wrote:
..I want to disable Right Click Context menu there..
I do not think this is possible. You would have to change the way IE is responding to a right click ! Maybe you can try to set a global hook, trap the right click if it is made in IE, and destroy the menu as soon as it appear, but I am not sure this would work, and this would not be very easy.
~RaGE();
|
|
|
|
|
Hi,
I knew it is not easy..but I need to do that..can you show me some piece of code as how to create a global hook which traps the mouse events and then find a click in IE window...I shall be highly grateful..
Thanks a lot in advance..
Himanshu
|
|
|
|
|
Subclass the IE window and prevent the default behaviour of the WM_RBUTTONDOWN/WM_RBUTTONUP messages.
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"
|
|
|
|
|
Hi,
I knew it is not easy..but I need to do that..can you show me some piece of code as how to disable the mouse events ...I shall be highly grateful..
Thanks a lot in advance..
Himanshu
|
|
|
|
|
1. Create a new window class derived from CWnd (eg. CMyIEWnd ), and override OnRButtonDown() and OnRButtonUp() . Leave the two functions empty, ie. They should do nothing.
2. Create an instance of your window class, eg. CMyIEWnd window; or CMyIEWnd *pWnd = new CMyIEWnd;
3. Get a handle to the IE window. I assume you can do this, because I don't know the way your application is structured.
4. Call SubclassWindow on your CMyIEWnd class, passing the handle to the IE window to the SubclassWindow function, eg. window.SubclassWindow(hIEWindowHandle); or pWnd->SubclassWindow(hIEWindowHandle);
5. Override OnDestroy() in your window class (CMyIEWnd ) and call UnsubclassWindow() , to unhook your window from the IE window.
Hope this helps,
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"
|
|
|
|
|
Hey ! I try to do my best to discourage another user to block right-clicking in IE, and you give the solution. That's not fair !!
~RaGE();
|
|
|
|
|
Rage wrote:
Hey ! I try to do my best to discourage another user to block right-clicking in IE, and you give the solution. That's not fair !!
Well, be contented by this: If he's trying to run IE as a separate process, it won't work . My solution will work if he's using the web browser control inside his app, IMO that's a good place to block the context menu, so I gave a solution.
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"
|
|
|
|
|
Its a *lot* of work changing the behaviour of another application.
But if you are hosting the WebBrowser ActiveX control in (e.g.) a dialog box in your application, there
are things you can do. You may be able to subclass the window (as suggested by Ryan Binns), or you may
be able to follow the instructions given in: WebBrowser Customization[^] in the MSDN library.
You would implement the IDocHostUIHandler yourself, and handle the IDocHostUIHandler::ShowContextMenu
interface method to disable the right click menu.
Of course, this wouldn't be trivial either!
Would it be that terrible if the user could see the html source of your about box?
Iain.
|
|
|
|