I was using gmtime() on WinCE with Dinkumware libraries. It returned local time instead of UTC. Although I can convert it to UTC by calling GetTimeZoneInformation, still wondering why that is, and if there's any other function can be called?
The compiler outputs an error when i try to allocate a String object as an automatic variable : "C3149: 'System::String' : cannot use this type here without a top-level '^'."
As the problem doesn't appear with my home-made ref class, my actual question is : is there a way to prevent a class from being instantiated as an automatic variable ?
I have an application whose shortcut is placed on the desktop. Now whenever i double-click that icon, I want to get the information for that icon like Icon name, Icon target path, Icon working directory. The reason behind this is from one of the functionality the working directory changes for the application. So through Windows API or in C#/C++ I want to change the working directory for the icon which is double-clicked.
Plz guide me soon and at the earliest, if possible.
you can resolve an icon information using the IShellLink interface methods: Resolve(), GetPath(), GetDescription() etc. For this u need to pass the sortcut path. But for resolving it on icon click, u may need to write a mouse hook dll or a shell extension.
I face a strange problem with GroupBox Controls in .Net 2
This is a story:
I made a custom control inherited from GroubBox Control. I've put some other ocntrols in this new control and I've added them by this statement in my new control: this->Controls->Add(some .NET Control).
This is a problem:
When I set Anchors or Docks to my controls it dosn't work. BTW It seems that the anchored to left and top and I can't change them noway. (The parent control i.e. Custom GroupBox works perfect and change it's size correctly but it's childrens no!)
I have VS2005
Experimenting with header file is quite difficult because most of the time I do so VS2005 eat up 100% CPU and, slowly, all the memory as well (1GB, 2GB, 3GB, ... piou...... (reboot button))
Now I have been told that header file should speed up my compilation (which is rather slow even though the Managed C++ project is small)
Because I include <windows.h> in many headers (needed to define some enum from Windows constants) I though: OK: let's #include <windows.h> in stdafx.h.
But I have a doubt.. does it makes any sense to include a precompiled header in other headers?
Hi, I have a native abstract base class from which a number of child classes inherit from. The abstract base class has a pure virtual function that is overridden in each of the child classes.
My problem is this, how can i write managed wrapper classes for the base class and child classes whilst maintaining the ability to declare a base class pointer and to later instantiate a child class with it?
I cannot instantiate the base class because it a pure base class (I would not want to anyway) and if I wrap each child class individually then I will no longer have runtime polmorphism.
Am I being thick or is it not possible? Any advice greatly appreciated. Thanks
Initial Clarification: I need different memory stack (where addresses are stored), Not a stack container as in similar to a linked list container.
I need to create a new memory stack when different command line parametrers are used. It is to simulate a buffer overflow problem and our assignment specs say when a different user is specified, a different stack is created so a different attack is needed(a different amount of overflowing data).
Quote from ass specs
"It is required that each of usernames (Alice, Bob, or Chris) is associated with a different memory stack. You need to provide an attack for each of them. As a result, three buffer overrun instances and their associated attacks should be provided in your report. It is up to you for the coding approach."
I can call my program :
What I have done is implement each user into a different function. This doesnt force me to use a different attack for each user (same attack works for each user.)
I then put some initialised local variables inside bob() function, to make it different to the Alice() function. This didnt change what I wanted either.
I also created a few dummy functions which just passed the control to then next function to eventually start the Bob function. but this didnt make it any different from just calling bob straight out. (if that makes any sense)
I read this (and many other) websites to try and understand how variables and functions are alocated to the stack
But I obviously still dont understand how addresses are allocated to the stack to make it different for different command line parameters.
Ive spent a day and a half trying to solve this problem, the rest of my code does what I want
Can someone please clarify this or give me an example of how to create a different stack for different parameters.
Is this question from a managed perspective? Or do you want to know how to do this in native C++? If the latter this is the wrong forum. If the former, it may be better to ask this in the C# or .NET forum, since your question is not C++/CLI specific, and there are more people answering such questions on those forums.
I have created a program for calculating the Mandelbrot set and other fractals. I have two versions of the program, one where the fractal class is native and another where it is managed. This class contains the main iterative loop for determining whether a point is in the fractal or not; for example, Z = Z^2 + C for the Mandelbrot set. The front end of both versions is managed. The iterative loop is written in straight C++ with no assembler.
I created a test scenario and used a stopwatch to time how long each version of the code took to complete. I found that the native version took consistantly 17.5 seconds +- 0.5 seconds. However, the managed version is inconsistant in the amount of time it takes. It can take 21, 28, 45, or 47 seconds to complete. Why is this? The only thing I can think of is that it is executing the loop in main memory or level 2 cache instead of level 1 cache.
In a second, more intensive, scenario the native version takes 1min 38.5secs and the managed version takes 5mins 11.5sec - this is horrendous!
Does anybody have an ideas? Is it possible to 'fix' the managed version so that it has performance equal to the native version? Any help would be greatly appreciated! Thanks.
Last Visit: 31-Mar-20 23:29 Last Update: 31-Mar-20 23:29