Discussion:
Embedded resources
(too old to reply)
Jonas
2009-08-13 10:19:02 UTC
Permalink
If I want to use an *.ico file as Image in a Menu. Is it posible to add this
file as a resource and reference it in the NormalResource property of a Menu?

I found some info on MSDN, but did not succeed in locating the resource id
of the file that I added from file. Does it get an id?

What is the correct way to do this? I guess the best thing would be not to
have to distribute the file manually...

/Jonas
Jonas
2009-08-13 11:10:01 UTC
Permalink
Well, now I have looked further into this by searching in the newsgroup
(should of course have done that earlier on). As far as I understand, it is
not possible to embed resources in Ax and reference them to a menu without
actually storing the file physically on disk.

How strange...

/Jonas
Post by Jonas
If I want to use an *.ico file as Image in a Menu. Is it posible to add this
file as a resource and reference it in the NormalResource property of a Menu?
I found some info on MSDN, but did not succeed in locating the resource id
of the file that I added from file. Does it get an id?
What is the correct way to do this? I guess the best thing would be not to
have to distribute the file manually...
/Jonas
unknown
2009-08-16 20:25:15 UTC
Permalink
Yes. That is correct. You will need to physically store the file on HD.
You can, however, import it as a Resource into AX (AOT\Resources), and then
export it to a temp.file before use.
This way, you will save the trouble of handling a separate set of image
files together with the installation files.
--
Kashperuk Ivan (Vanya), SDET, Inventory management, Microsoft Dynamics AX
My blog - http://kashperuk.blogspot.com
Download MorphX IT in Russian - http://www.lulu.com/content/723888
Post by Jonas
Well, now I have looked further into this by searching in the newsgroup
(should of course have done that earlier on). As far as I understand, it is
not possible to embed resources in Ax and reference them to a menu without
actually storing the file physically on disk.
How strange...
/Jonas
Post by Jonas
If I want to use an *.ico file as Image in a Menu. Is it posible to add this
file as a resource and reference it in the NormalResource property of a Menu?
I found some info on MSDN, but did not succeed in locating the resource id
of the file that I added from file. Does it get an id?
What is the correct way to do this? I guess the best thing would be not to
have to distribute the file manually...
/Jonas
Jonas
2009-08-17 14:44:02 UTC
Permalink
Ok, thank you.

What is the "correct" way to handle this? Is there a recommended place where
menu icons should be stored. I haven't found anything online, but I am rather
new to Ax, so I am not very confident yet when it comes to finding the
correct answers.

/Jonas
Post by unknown
Yes. That is correct. You will need to physically store the file on HD.
You can, however, import it as a Resource into AX (AOT\Resources), and then
export it to a temp.file before use.
This way, you will save the trouble of handling a separate set of image
files together with the installation files.
--
Kashperuk Ivan (Vanya), SDET, Inventory management, Microsoft Dynamics AX
My blog - http://kashperuk.blogspot.com
Download MorphX IT in Russian - http://www.lulu.com/content/723888
Post by Jonas
Well, now I have looked further into this by searching in the newsgroup
(should of course have done that earlier on). As far as I understand, it is
not possible to embed resources in Ax and reference them to a menu without
actually storing the file physically on disk.
How strange...
/Jonas
Post by Jonas
If I want to use an *.ico file as Image in a Menu. Is it posible to add this
file as a resource and reference it in the NormalResource property of a Menu?
I found some info on MSDN, but did not succeed in locating the resource id
of the file that I added from file. Does it get an id?
What is the correct way to do this? I guess the best thing would be not to
have to distribute the file manually...
/Jonas
Jonas
2009-08-19 06:41:01 UTC
Permalink
I solved this by copying the resources to the include folder (if not already
present)on the client during startup (since it seems that Ax tries to locate
the file name in the include folder). Works fine. Thanks!
/Jonas
Post by unknown
Yes. That is correct. You will need to physically store the file on HD.
You can, however, import it as a Resource into AX (AOT\Resources), and then
export it to a temp.file before use.
This way, you will save the trouble of handling a separate set of image
files together with the installation files.
--
Kashperuk Ivan (Vanya), SDET, Inventory management, Microsoft Dynamics AX
My blog - http://kashperuk.blogspot.com
Download MorphX IT in Russian - http://www.lulu.com/content/723888
Post by Jonas
Well, now I have looked further into this by searching in the newsgroup
(should of course have done that earlier on). As far as I understand, it is
not possible to embed resources in Ax and reference them to a menu without
actually storing the file physically on disk.
How strange...
/Jonas
Post by Jonas
If I want to use an *.ico file as Image in a Menu. Is it posible to add this
file as a resource and reference it in the NormalResource property of a Menu?
I found some info on MSDN, but did not succeed in locating the resource id
of the file that I added from file. Does it get an id?
What is the correct way to do this? I guess the best thing would be not to
have to distribute the file manually...
/Jonas
ashlesh patel
2010-08-17 08:58:31 UTC
Permalink
hi,
I need some more detail regarding this issue from you.
I have added my *.ico file to Include folder of Ax Client. But now from the AOT in "Menus" in a particular menu property where to set it. I am trying to set its "NormalImage" property. It is asking me for its path on HD.

Should i add my image to "Resources" under AOT or not?

Please help me out.

Thanks,
Ashlesh
Post by Jonas
If I want to use an *.ico file as Image in a Menu. Is it posible to add this
file as a resource and reference it in the NormalResource property of a Menu?
I found some info on MSDN, but did not succeed in locating the resource id
of the file that I added from file. Does it get an id?
What is the correct way to do this? I guess the best thing would be not to
have to distribute the file manually...
/Jonas
Post by Jonas
Well, now I have looked further into this by searching in the newsgroup
(should of course have done that earlier on). As far as I understand, it is
not possible to embed resources in Ax and reference them to a menu without
actually storing the file physically on disk.
How strange...
/Jonas
Post by unknown
Yes. That is correct. You will need to physically store the file on HD.
You can, however, import it as a Resource into AX (AOT\Resources), and then
export it to a temp.file before use.
This way, you will save the trouble of handling a separate set of image
files together with the installation files.
--
Kashperuk Ivan (Vanya), SDET, Inventory management, Microsoft Dynamics AX
My blog - http://kashperuk.blogspot.com
Download MorphX IT in Russian - http://www.lulu.com/content/723888
Post by Jonas
Ok, thank you.
What is the "correct" way to handle this? Is there a recommended place where
menu icons should be stored. I have not found anything online, but I am rather
new to Ax, so I am not very confident yet when it comes to finding the
correct answers.
/Jonas
Post by Jonas
I solved this by copying the resources to the include folder (if not already
present)on the client during startup (since it seems that Ax tries to locate
the file name in the include folder). Works fine. Thanks!
/Jonas
Submitted via EggHeadCafe - Software Developer Portal of Choice
Excel Identifying which formulas are slowing down workbook recalaculation
http://www.eggheadcafe.com/tutorials/aspnet/917072d4-8194-4f18-8455-75b2ebe359f0/excel-identifying-which-formulas-are-slowing-down-workbook-recalaculation.aspx
Jonas
2010-08-17 09:52:12 UTC
Permalink
Hi

If the image is placed in the include folder of the client no path is
needed.
e.g. "C:\Program Files\Microsoft Dynamics AX\50\Client\share\include\"

But, I added the images as a resource, for example I added MyImage.png as a
resource called MyImage.

After that I set the property NormalImage=MyImage.png (no path needed).

During client startup I copy the resource (if necessary) and save it to the
include folder.


call
loadMenuResource ("MyImage", "MyImage.png");


void loadMenuResource(str resourceName, str fileName)
{
BinData binData;
str includeFolder;
str resourceFileName;
str newFileName;
;

try
{
includeFolder = xInfo::directory(DirectoryType::Include);
newFileName = System.IO.Path::Combine(includeFolder, fileName);
if (!System.IO.File::Exists(newFileName))
{
resourceFileName = SysResource::getImagePath(resourceName);

if (System.IO.File::Exists(resourceFileName))
{
binData = new BinData();
binData.loadFile(resourceFileName);
binData.saveFile(newFileName);
}
}
}
catch
{
}
}
Post by ashlesh patel
hi,
I need some more detail regarding this issue from you.
I have added my *.ico file to Include folder of Ax Client. But now from
the AOT in "Menus" in a particular menu property where to set it. I am
trying to set its "NormalImage" property. It is asking me for its path on
HD.
Should i add my image to "Resources" under AOT or not?
Please help me out.
Thanks,
Ashlesh
Post by Jonas
If I want to use an *.ico file as Image in a Menu. Is it posible to add this
file as a resource and reference it in the NormalResource property of a Menu?
I found some info on MSDN, but did not succeed in locating the resource id
of the file that I added from file. Does it get an id?
What is the correct way to do this? I guess the best thing would be not to
have to distribute the file manually...
/Jonas
Post by Jonas
Well, now I have looked further into this by searching in the newsgroup
(should of course have done that earlier on). As far as I understand, it is
not possible to embed resources in Ax and reference them to a menu without
actually storing the file physically on disk.
How strange...
/Jonas
Post by unknown
Yes. That is correct. You will need to physically store the file on HD.
You can, however, import it as a Resource into AX (AOT\Resources), and then
export it to a temp.file before use.
This way, you will save the trouble of handling a separate set of image
files together with the installation files.
--
Kashperuk Ivan (Vanya), SDET, Inventory management, Microsoft Dynamics AX
My blog - http://kashperuk.blogspot.com
Download MorphX IT in Russian - http://www.lulu.com/content/723888
Post by Jonas
Ok, thank you.
What is the "correct" way to handle this? Is there a recommended place where
menu icons should be stored. I have not found anything online, but I am rather
new to Ax, so I am not very confident yet when it comes to finding the
correct answers.
/Jonas
Post by Jonas
I solved this by copying the resources to the include folder (if not already
present)on the client during startup (since it seems that Ax tries to locate
the file name in the include folder). Works fine. Thanks!
/Jonas
Submitted via EggHeadCafe - Software Developer Portal of Choice
Excel Identifying which formulas are slowing down workbook recalaculation
http://www.eggheadcafe.com/tutorials/aspnet/917072d4-8194-4f18-8455-75b2ebe359f0/excel-identifying-which-formulas-are-slowing-down-workbook-recalaculation.aspx
Loading...