473,503 Members | 1,696 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

managed C++ and the Application class

Hello!

I have a problem with managed C++ and the Application class

I want to use Application::CommonAppDataPath but the only answer I get
is "D:\Documents and Settings\All Users\Application Data\\\1.0.0.0"

I have tried changed the items (alredy present) in assemblyinfo.cpp
but that doesn't have any effect.

I can't figure out what I am doing wrong.
Are there other propeties that need to be changed/added to make this
work?

Any help would be appreciated...

Greetings: Mårten
Nov 17 '05 #1
4 1209
> I have a problem with managed C++ and the Application class

I want to use Application::CommonAppDataPath but the only answer I get
is "D:\Documents and Settings\All Users\Application Data\\\1.0.0.0"

I have tried changed the items (alredy present) in assemblyinfo.cpp
but that doesn't have any effect.

I can't figure out what I am doing wrong.
Are there other propeties that need to be changed/added to make this
work?

Any help would be appreciated...


I'm assuming you're worried because it always pops up "1.0.0.0" even if you
change the assembly version, right? If so, it might be useful to know that
this path is not based on the assembly version but on the "Product Version",
which is changed through the not-very-intuitively-named
AssemblyInformationalVersionAttribute attribute.

--
Tomas Restrepo
to****@mvps.org
Nov 17 '05 #2
Tomas Restrepo (MVP) wrote:
I'm assuming you're worried because it always pops up "1.0.0.0" even
if you change the assembly version, right? If so, it might be useful
to know that this path is not based on the assembly version but on
the "Product Version", which is changed through the
not-very-intuitively-named AssemblyInformationalVersionAttribute
attribute.


Ah, thats good to know but I'm wooried about the whole string becuase
there should be other stuff there too between "D:\Documents and
Settings\All Users\Application Data\" and "\1.0.0.0" like "D:\Documents
and Settings\All Users\Application Data\stuff\morestuff\1.0.0.0" and I
can't get that to work either.
Are there more attributes that need to be added for this?

Mårten
Nov 17 '05 #3
Marten,
Ah, thats good to know but I'm wooried about the whole string becuase
there should be other stuff there too between "D:\Documents and
Settings\All Users\Application Data\" and "\1.0.0.0" like "D:\Documents
and Settings\All Users\Application Data\stuff\morestuff\1.0.0.0" and I
can't get that to work either.
Are there more attributes that need to be added for this?


Humm... that just doesn't work in MC++ from what I've seen.

The problem is that for MC++ assemblies (unless you do some really weird
things) there's not an "Entry Type" in the sense there is for C# or VB.NET.
By Entry Type I mean a class where the Main() method is defined, but rather
the entry point is a global function.

The problem is that the rest of the stuff that's missing in there is
acquired in the Application class from the attributes in the assembly.
However, it goes around it in an ugly way:

Instead of simply finding out what assembly started the process and looking
at the custom attributes defined in it, it does something like this:
- Find the assembly that started the process
- Ask the assembly for the entry type
- Ask the entry type for the assembly it is defined in
- Ask that latter reference for the attributes.
Of course, in MC++ everything goes down the drain in the second step,
because that entry type will be null, so no way to ask for the rest of the
attributes.

A huge bug in the System::Windows::Forms assembly, if you ask me.

For the curious, this can be seen in the code for the get_ProductName method
of the System::Windows::Forms::Application class.

Ronald, or anyone... can this be at least reported? It sounds like however
wrote the class made a bad assumption as to how a .NET process get started
:(

--
Tomas Restrepo
to****@mvps.org
Nov 17 '05 #4
Ok Thanks so much for the help, now I at least know what's happening.
I was started to feel really stupid for not getting this to work (and I
couldn't find any info about it anywhere) :-)

///Mårten

Nov 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
3609
by: Chris Kiechel | last post by:
I am writing a .NET Windows application and it needs to perform DDE calls to a legacy system. I created a C++ unmanaged class that performs the actual DDE connection and communication. However,...
3
3483
by: zhphust | last post by:
I want to convert a object of a managed class to a unmanaged structure that has the same member with that managed class. Can anybody tell me how i can do it? Thanks in advance. -- zhphust...
4
4507
by: Peter Oliphant | last post by:
There doesn't seem to be any documentation on how to create and/or use an instance of System::Drawing::Graphics. On-line MSDN talks about this class, and says: " The Graphics class provides...
5
3404
by: Maxwell | last post by:
Hello, Newbie question here. I have a VS.NET 2003 MC++ (not C++/cli) project where I have a managed class reference in a unmanaged class...simple enough. To keep things short I am for the most...
9
3100
by: Amit Dedhia | last post by:
Hi All I have a VC++ 2005 MFC application with all classes defined as unmanaged classes. I want to write my application data in xml format. Since ADO.NET has buit in functions available for...
3
2172
by: frank | last post by:
Hi I've got aplication, which one is written in unmanaged c++ with stl, i've made for it gui in managed c++. Problem becomes when I'm starting to filling up for example datagrids, when I'm...
3
4679
by: frank | last post by:
Hi I've got aplication, which one is written in unmanaged c++ with stl, i've made for it gui in managed c++. Problem becomes when I'm starting to filling up for example datagrids, when I'm...
12
12498
by: DaTurk | last post by:
Hi, I have a rather interesting problem. I have a unmanged c++ class which needs to communicate information to managed c++ via callbacks, with a layer of c# on top of the managed c++ ultimatley...
3
4683
by: Klaus | last post by:
Hi, I have an existing VC 6 MFC application which communicates asynchronly with a VC 2005 managed code dll. I use an unmanaged base class with virtual functions to access methods in the MFC...
2
3186
by: chandramohanp | last post by:
I am having problem to delete a Managed C++ DLL that was used in a pure C# DLL even in the following scenario. 1. Launch the application. This applicatio has its own default applicaiton...
0
7201
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
1
6988
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7456
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5011
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4672
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3153
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1510
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
734
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
379
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.