C++ Blues...

Started by
5 comments, last by Axiverse 19 years, 11 months ago
Well... I have a few questions in vb: Shared Function ConvertToPointF(Point as Point) as PointF Return New PointF(Point.x, Point.Y) End Function how would you do the same thin in C++... this is the only thing it will let me do, but i don''t want to return a pointer, and it won''t let me return __box(value)... using namespace System::Drawing; static PointF* ConvertToPointF(Size Size) { return __nogc new PointF(Size.Width, Size.Height); } See... I don''t want to return a PointF*, but a PointF Also... in vb, there''s the keyword redim and redim preserve... are those basically just create a new array and create a new array and copy values?
Advertisement
Just do,

static PointF ConvertToPointF(Size Size)
{
return PointF(Size.Width, Size.Height);
}


Your causing a memory leak the other way.

[edited by - Leviathan3328 on May 8, 2004 3:24:23 PM]
and what about the redim question??

[edit: 1st question solved...]

[edited by - Axiverse on May 8, 2004 3:32:46 PM]
Why are you making the function static?
why not static? it''s like a vb module, free for use by everyone...
quote:Original post by Axiverse
why not static? it''s like a vb module, free for use by everyone...

In C++ to make a function public you put it or its prototype in a header and include that header into the files that need the function.

Thanks Salsa!Colin Jeanne | Invader''s Realm
"I forgot I had the Scroll Lock key until a few weeks ago when some asshole program used it. It even used it right" - Conner McCloud
Well, this is a managed dll...

This topic is closed to new replies.

Advertisement