|
We have four operators static_cast ,dynamic_cast,const_cast and reinterpret_cast, on the c++ But when you must use of them I suggest see some articles about Type Casting.
|
|
|
|
|
Hi, I'm using Visual Studio 2005 C++/CLI. Can this even be done? I have properties that I need to setup. I have a Form that has a tabControl on it. The tabControl contains ten tabPages (one page for each defined test). Each tabPage has another tabControl placed on it with one tabPage per instrument. Here's the deal. Every test uses an instrument that has 20 definable properties. So if I select the tabPage for Test1 I will see sub-tabPages for Instrument1, Instrument2, etc. Now I can place 20 comboBoxes on tabPageTest1.Instrument1 and then do the same for tabPageTest2.Instrument1, tabPageTest3.Instrument1, etc., but then I end up with 200 comboBoxes, each with a unique name (that I have to take the time to rename) like comboBoxAcqModeTest1, comboBoxAcqModeTest2, comboBoxAcqModeTest3, etc. What I would like to do is use the tabPage for Instrument1 as (for lack of a better term) a template that I can populate with the information for a given test and then display under the correct tab. What I have tried is when I click tabPageTest10, I populate tabPageTest1.Instrument1 and then tried BringToFront() but that didn't work. Is there a way to either bring the tabControl inside tabPageTest1 to the top of the display or copy the tabControl from tabPageTest1 to tabPageTest10?
Thanks
Buck
|
|
|
|
|
BuckBrown wrote: but then I end up with 200 comboBoxes
Sounds like a Bug Splat UI to me. Ever heard of TreeView, ListView and PropertyGrid?
|
|
|
|
|
Hello,
this question may come from a very wrong approach , feel free to suggest a better way to solve this
I want to store a global dynamic list of structs inside a managed code dll.
First I create the array list
gcroot<System::Collections::ArrayList*> parameters;
parameters=new System::Collections::ArrayList();
But i get a very weired exception during runtime:
Handle has not been initialized when creating the ArrayList.
How can I initialize this variable the correct way?
Thx for your time..
|
|
|
|
|
Is that code verbatim?
If so, shoiuldn't you be using gcnew instead of new?
(__gc new in managed extensions)
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Thank you for the answer, I'm fairly new to this topic (gcroot).
This is the new code according to your suggestion.
parameters=__gc new System::Collections::ArrayList();
But still, the same exception is raised when I try to create the ArrayList...
Any idea?
|
|
|
|
|
hmmm it worked for me on VS2005...
Where is this code located?
The gcroot<> line is at global scope - outside of any method/function, right?
What about the parameters= line? Where's that at?
Where does the exception get thrown?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Yes, the gcroot<> line is at global scope.
I wrote an ManagedCode-DLL based on a .NET-Assembly that is dynamically linked by a standard MFC application. The gcroot variable is created during DLL initialization (called via a procedure).
Hopefully this will help you..
Currently I am working on a different approach (linked list class) to solve my problem.
This seems to be the best solution as gcroot more like a "dirty" fix for something that can be solved in a more correct way, i suppose.
Thanks for your time
|
|
|
|
|
hi
I am using an openGL with C
i am unsure on how to write to a console window using this useless programming language
any help would be appreciated
thanks
boyindie
|
|
|
|
|
puts()?
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
boyindie wrote: useless programming language
The useless programming language that's been used to
write many operating systems, countless applications,...
I think it's been pretty useful for quite a long time!
Of course, it's all about C# and VB.NET now.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Mark Salsbery wrote: Of course, it's all about C# and VB.NET now.
Fortunately, not for everything!
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
George L. Jackson wrote: Fortunately, not for everything!
Heh. Why the :sniff:? I smile about that!
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
You're right, I should be happy.
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
ROTFL - it's the language, and not the person who can't even work out where to post his question, that is the problem...
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Any idea how OS know that it has lost power and running from UPS.
|
|
|
|
|
If you read the first thread in this forum you should be able to determine that your question is not appropriate to this forum.
|
|
|
|
|
i have created a windows application but i am facing some problem when its looses power so i need to shutdown computer as soon as it looses power and switch to different power source. just cant figure out how i would get this information.
Thanks
|
|
|
|
|
|
In the hardware (or the OS/SysAdmin) forum my answer would be:
Some UPS provide a serial/USB connection to inform PC about a power outage.
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- use PRE tags to preserve formatting when showing multi-line code snippets
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
hello everybody
I would like to get the sorcecode of the fxcop. i want to customize fxcop.
so please help me to know where can i get the source code of fxcop from.
bhaskarsri
|
|
|
|
|
If you read the first thread in this forum you should be able to determine that your question is not appropriate to this forum.
|
|
|
|
|
what is advantage of "Base class pointer to Derived Class object" ?
class Base
{
public:
Base(){ cout<<"Constructor: Base"<<endl;}
~base(){="" cout<<"destructor="" :="" base"<<endl;}
="" void="" funbase()
="" {
="" cout="" <<"base="" function="" invoked"<<endl;
="" }
};
class="" derived:="" public="" base
{
="" public:
="" derived(){="" cout<<"constructor:="" derived"<<endl;}
="" ~derived(){="" funderived()
="" <<"derived="" }
};
int="" _tmain(int="" argc,="" _tchar*="" argv[])
{
="" cout<<"ashish"<<"\n";
="" base="" *var="new" derived();
="" delete="" var;
}
even="" though="" "var"="" points="" to="" derived="" class="" object="" ,="" it="" cannot="" access="" member="" i.e="" funderived().="" var="" can="" only="" functions.
instead="" of="" why="" dont="" we="" use="" ,
=""
="" *check="new" base();
="" check-="">fun1();
I guess it is having same behaviour. Please let me know wht is advantage of using base class pointer to derived class object?
Thanks\
Ash.
|
|
|
|
|
In this instance, none. However, if you have many different derived classes, you can create a collection of the base class to hold them all, and if the base class defines a generic interface, an instance of the base class can do many things, depending on what derived class the instance is.
This question is in the wrong forum, BTW. This is for .NET questions only.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|