|
This question should be posted in the Visual C++[^] forum. This is the C++/CLI forum that's dedicated to the new managed and mixed-mode compiler available in VC++ 2005.
Regards,
Nish
|
|
|
|
|
it's very embarrasing to see how many people make the confusion... when one have to ask for a managed C++ question, i think they see the name Visual C++ forum and in their head, the idea goes quickly into, "hummm, managed code is a microsoft thing, so i think that the Visual C++ forum is for me" (as Visual stands in a certain way for microsoft products)...
in the other hand, when one have to ask for pure C++ question, i believe that what come to them is something like "hmm, C++/CLI is the right forum to go as it stands for C++, and CLI, i don't know what it is, but it might me related to the standard... whatever, i ask this here".
i wonder if the CLI forum got back its old name "Managed C++" forum people still got confused...
you post 4 messages out of 5 to say to people they write the wrong forum
TOXCCT >>> GEII power [toxcct][VisualCalc 2.20][VisualCalc 3.0]
-- modified at 9:30 Monday 9th January, 2006
|
|
|
|
|
Yeah, the naming scheme Microsoft chose is probably a little confusing, but I also think people are pretty careless about where they post. Perhaps a stickey thread on top that explains what this forum is for would be useful in reducing the number of mis-postings.
Regards,
Nish
|
|
|
|
|
I need to modify CxImage library function to include CArray as a parameter.
I have no clue how to include reference to afxtempl.h in this libraray.
Using VC 6.0 and MFC.
Thanks for your help.
Vaclav
|
|
|
|
|
Vaclav wrote: I need to modify CxImage library function to include CArray as a parameter.
I have no clue how to include reference to afxtempl.h in this libraray.
Using VC 6.0 and MFC.
Thanks for your help.
Hello Vaclav, there is no CxImage class in MFC. It looks like you are using a 3rd party library - it's best to contact their tech support.
Regards,
Nish
|
|
|
|
|
On the other hand, if you are talking about Davide Pizzolato's class, ask this question in the article forum.
Regards,
Nish
|
|
|
|
|
Since Davide no longer "supports" his article I felt I had a better chance here.
I guess I am looking for a generic advice how to add or put together different libraries.
Vaclav
|
|
|
|
|
Vaclav wrote: Since Davide no longer "supports" his article I felt I had a better chance here.
I guess I am looking for a generic advice how to add or put together different libraries.
Ah okay. In that case, this question should be posted in the Visual C++[^] forum. This is the C++/CLI forum that's dedicated to the new managed and mixed-mode compiler available in VC++ 2005.
Regards,
Nish
|
|
|
|
|
Please help me with this:
int SetArray(array <String ^> ^str)
{
str = gcnew array <String ^> (5);
return 0;
}
int main(array<System::String ^> ^args)
{
array <String ^> ^str;
SetArray(str);
Console::WriteLine(str);
return 0;
}
Thanks in Advance.
|
|
|
|
|
Change your SetArray prototype to :-
int SetArray(array <String ^>^% str) Notice the extra %.
For more information on this, see my blog entry :-
Tracking References[^]
Regards,
Nish
|
|
|
|
|
|
Is there anyway to create True type fonts on runtime...
|
|
|
|
|
Chooran wrote: Is there anyway to create True type fonts on runtime...
Instantiate a new font object? Or create a totally new font object in-memory? The former is possible and easy. The latter would be a pretty complex process, and why would you want to do that?
Regards,
Nish
|
|
|
|
|
what is the windowes services in vb.net
bikshamaiah
|
|
|
|
|
bikshamaiah.g wrote: what is the windowes services in vb.net
This question would be most appropriate for the Visual Basic / VB.NET[^] forum.
Regards,
Nish
|
|
|
|
|
hi,
Can anybody help me as I need a sample code for taking in data in C++ and then writting it into textfile
Regards,
|
|
|
|
|
you can take data in a variable by cin
and print that data to output stream by cout.
or
u can use file opration for it.
Create file,write data to file and finaly read data from file.
|
|
|
|
|
|
Note that the samples are in C# and VB, but it's trivial to convert that to C++/CLI.
Regards,
Nish
|
|
|
|
|
My understanding of Hashtables is this: If I declare a Hashtable like so: Hashtable *hashMyHashtable = new Hashtable; I don't need to have a corresponding DELETE after having used the NEW for the Hashtable. The reason being that the Hashtable is a Managed object and so I don't need to Delete it in my destructor.
My question is this: If I store an object that was declared with a NEW, and store it in the hashtable, do I need to go back through the hashtable and delete those objects, or does the managed code do that as well?
Example:
MyObject *tempObject = new MyObject;
Hashtable *hashObjects = new Hashtable;
hashObjects->Add(key, tempObject);
So if I store several tempObjects in my hashtable, do I need to traverse through the hashtable and DELETE the tempObjects, or does the garbage collector handle this as well as the hashtable itself?
If I do need to delete them, will a call to hashObjects->clear(); delete the objects?
Thanks,
Jody Blau
|
|
|
|
|
The correct way to work with managed objects in C++/CLI is to use managed references, and the gcnew operator.
MyObject^ tempObject = gcnew MyObject();
Hashtable^ hashObjects = gcnew Hashtable();
hashObjects->Add(key, tempObject); Once all references to a managed object are set to null or go out of scope, the object will be garbage collected at whatever point the CLR decides to do so.
|
|
|
|
|
Justin
I believe he's using the now obsolete MC++ syntax.
|
|
|
|
|
jblau wrote: do I need to go back through the hashtable and delete those objects
No, and you can see this by counting the references to the objects.
MyObject* tempObject = new MyObject; The ref count on the object is now 1.
hashObjects->Add(key, tempObject); The hash table now holds another reference on the object, so the ref count is 2.
Once the tempObject object falls out of scope, the ref count drops to 1. When you empty the hash table, it releases the references on the objects that were in the table, so the ref count drops to 0.
--Mike--
Visual C++ MVP
LINKS~! Ericahist | NEW!! PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
Laugh it up, fuzzball.
|
|
|
|
|
To add to what Mike says, the objects that you add to the hash table are also managed objects, and thus garbage collected.
If you add unmanaged pointers to the hashtable, you'd have to manually delete the native objects that are pointed to by those pointers.
|
|
|
|
|
I want to use graphic header in visual c++
but it's not possible.
please help me.
great tanks to you.
Bye.
MK4
-- modified at 16:04 Thursday 5th January, 2006
|
|
|
|