• Advertisement

Archived

This topic is now archived and is closed to further replies.

C++ Blues...

This topic is 5041 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites
and what about the redim question??

[edit: 1st question solved...]

[edited by - Axiverse on May 8, 2004 3:32:46 PM]

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

  • Advertisement