EldoS | Feel safer!

Software components for data protection, secure storage and transfer

StorageSearch Problem

Posted: 09/07/2006 06:55:39
by Amit Shrivastava (Basic support level)
Joined: 09/07/2006
Posts: 3

I need code examples regarding making instance pointer of StorageSearch structure in VC.Net. when i take the pointer of StorageSearch stuctuire with new operatore it genearte compiler error : cannot dynamically allocate a value type object with managed members on C++ (nogc) heap. i am trying it all in VC++.Net . the coding line is
SolFS::StorageSearch *SearchStruct = new SolFS::StorageSearch();
I need help. i want to know is this coding problem or other else.
Posted: 09/08/2006 02:29:16
by Alexander Plas (Team)


.NET version of SolFS compiled as managed C++ classes. If you like to use it in managed C++ code you should use little different syntax:
SolFS::StorageSearch ^SearchStruct = gcnew SolFS::StorageSearch();

If you like to use SolFS in unmanaged C++ code you have to use SolFS classes for plain C++.
Posted: 09/11/2006 04:08:39
by Amit Shrivastava (Basic support level)
Joined: 09/07/2006
Posts: 3

Thanks for your reply,
But it is still creating errors, i used that code
SolFS::StorageSearch ^SearchStruct = gcnew SolFS::StorageSearch();

errors are missing ';' before '^'

errors are looking irrelavent but when delete that code ,program compile sucscessfully,

what should i do for successfully compilation of tath code.
Posted: 09/11/2006 08:41:28
by Alexander Plas (Team)

Can you specify Compiler or IDE used to compile your sources. I'm using VS2005 and this code complies without any errors. Also check CLR options - clr:oldSyntax produce lot of errors on this code.
Posted: 09/12/2006 05:18:11
by Amit Shrivastava (Basic support level)
Joined: 09/07/2006
Posts: 3

Hi plas,
Thanks for your great responce.
I am useing Visual C++ .NET 2003(VC++ 7.1). In this IDE there is one option (property page->general tab) Use manaed extension. I kept it yes. but there is no any compiler option regarding /clr in Visual C++ .NET 2003 (7.1).

I think this is not problem with eldos because when i use code line
String ^str = gcnew String("Amit"); in my program ,i get same result
Errors : missing ';' before '^'.

So i want to know am i able to run that code on same compiler successfully or not ,and if yes than what changes will i have to made for that.
Amit Shrivastava
Posted: 09/23/2006 05:45:24
by Eugene Mayevski (Team)

From the documentation:

Instances of a value type (see Classes and Structs (Managed)) that contain managed members can be created on the stack but not on the heap.

We will try to remove this "value" modifier from the code in future builds.

Sincerely yours
Eugene Mayevski



Topic viewed 8975 times

Number of guests: 1, registered members: 0, in total hidden: 0


Back to top

As of July 15, 2016 EldoS business operates as a division of /n software, inc. For more information, please read the announcement.

Got it!