|
i believe no... you must rewrite all the VC++ Code into C#...
in fact you must redesign the code to get the best performance in C#...
|
|
|
|
|
What is the best was to get the modified date/time of a file ?
I'm using VC++6.0.
Thanks.
Elaine
The tigress is here
|
|
|
|
|
How about GetFileAttributesEx() ?
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
or CFile::GetStatus() or _stat() or GetFileTime() .
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Thanks Ravi,
I'd seen GetFileTime on VC6 but it only talked about WinCE !
I checked again at home where I have .NET2002 after your reply and it listed NT/2000/XP too. Odd
Elaine
The tigress is here
|
|
|
|
|
Trollslayer wrote:
I'd seen GetFileTime on VC6 but it only talked about WinCE
That was me messin' with yer PC.
See this[^] link.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
|
I have the following problem :
I have written a MDI Application opening and reading files of type *.myapp
I have made a file association with my application and when a user clicks a file with the extension *.myapp my application starts but does not load the file.
I know I have to read the parameters the shell passes to my program, but I do not know how. And I do not know for which event I should write a handler.
modified 9-Mar-17 17:23pm.
|
|
|
|
|
Daniel Kanev wrote:
I have written a MDI Application opening and reading files of type *.myapp
Did you use AppWizard for this?
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
In visual studio .net ver 2003 in reguards to c++ my multiplication is messed up. I get a result of 0 when I try and multiply the following. What's wrong?
#include "stdafx.h"
#using <mscorlib.dll>
#include "math.h"
using namespace System;
int _tmain()
{
__int64 p;
p= 16 * 268435456;
Console::WriteLine(p);
return 0;
}
|
|
|
|
|
I assume that the WriteLine() method supports a __int64 type. What is the largest value (e.g., 231) that you can successfully send to WriteLine() ?
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
The number I am multipling with 16 is the highest number for the output.
|
|
|
|
|
If 228 is the highest number for the output, what does outputting 228 + 1 produce? If that does not work, I would expect 232 to fail as well. Yes?
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
The highest number I can multiply it to is 7 after that I get the error message:
warning C4307: '*' : integral constant overflow
|
|
|
|
|
That indicates that you are running into a signed/unsigned problem. What does this yield:
p = 8U * 268435456U;
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
|
What about:
unsigned __int64 p;
p = 16U * 268435456U;
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
|
The compiler is telling you exactly what's wrong "integral constant overflow". That expression overflows the capacity of an int . You need to specify that the constants are 64-bit int s:
p = 16I64 * 268435456I64;
--Mike--
Visual C++ MVP
LINKS~! Ericahist | 1ClickPicGrabber | CP SearchBar v2.0.2 | C++ Forum FAQ
Strange things are afoot at the U+004B U+20DD
|
|
|
|
|
Thanks Mike. I was aware of L and U but did not know about the I64 modifier.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
That worked great. However is there a way I can use exponents with the 64-bit int's?
|
|
|
|
|
I'm sure there is something simple and obvious that I am missing here, maybe somebody can help me?
I have a toolbar that gets initialized from a toolbar resource (one big bitmap with all images in it).
The toolbar is customizable (using standard dialog), so that when the dialog is displayed, you get a list of all the buttons available on the left, and a list of all the buttons currently on the toolbar on the right.
The buttons on the left and right together are all of the buttons available in the toolbar resource bitmap.
In some cases, I would like to exclude some buttons in the toolbar resource bitmap from being displayed as available (i.e. remove them from the left list).
When the list is populated, you get messages that let you say whether the button is available, but the first time you say no, it stops asking about the remaining buttons.
Like I said, there must be something simple I am missing.
Thanks for you help!
- Sean
|
|
|
|
|
Sean McKinnon wrote:
In some cases, I would like to exclude some buttons in the toolbar resource bitmap from being displayed as available (i.e. remove them from the left list).
Wouldn't it be easier to just enable/diasble the buttons? If not, then you'll probably need to create multiple toolbars (one for each situation).
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
DavidCrow wrote:
Wouldn't it be easier to just enable/diasble the buttons? If not, then you'll probably need to create multiple toolbars (one for each situation).
Yes, it would be easier, and I do that in other circumstances.
My problem is that I have a single application that talks (serial or ethernet) to several different versions/types of hardware. The application automatically configures itself to the capabilities and resources of the attached hardware. (It is a user-interface for status monitoring and configuation of the hardware).
The application has always removed menu items for features that the attached hardware cannot support, and disabled menu items for features that the hardware could support, but that are not currently enabled. This works fine for menu items.
The toolbar used to be fixed (and only included items that were supported on all hardware platforms). Now, we've added customizable toolbars, so I now have buttons for features that may not be supported on various hardware platforms. I can (and do) still disable toolbar buttons for features that are supported but not enabled (and I also do this for toolbar buttons for features that are not supported at all, but would really prefer to hide/remove these buttons like I do for menu items).
Creating multiple toolbars for all the possible configurations would be a nightmare for sure.
I guess this isn't as easy as I had hoped for?
Thanks - Sean
|
|
|
|
|
If you are using MFC:
CToolBar tb;
tb.GetToolBarCtrl().HideButton(ID_CONNECT, TRUE);
tb.GetToolBarCtrl().HideButton(ID_DISCONNECT, FALSE);
also (from MSDN):
Customizing a Toolbar
A toolbar has built-in customization features that you can make available to the user by giving the toolbar the CCS_ADJUSTABLE common control style. The customization features allow the user to drag a button to a new position or to remove a button by dragging it off the toolbar. In addition, the user can double-click the toolbar to display the Customize Toolbar dialog box, which allows the user to add, delete, and rearrange toolbar buttons. To display the dialog box, use the TB_CUSTOMIZE message. An application determines whether the customization features are available to the user and controls the extent to which the user can customize the toolbar.
As part of the customization process, applications often need to save and restore a toolbar's state. For instance, many applications store the toolbar state before the user begins customizing the toolbar in case the user later wants to restore the toolbar to its original state. The toolbar control does not automatically keep a record of its precustomization state. Your application must save the toolbar state in order to restore it. For more information, see Customizing Toolbars and Using Hot-tracking with Toolbars.
...cmk
Save the whales - collect the whole set
|
|
|
|