locked
CLI Forms cant find icon visual studio 2017 c++ (reposted at the request of the moderator) RRS feed

  • Question

  • Hi

    I have a program in c++ forms using cli.

    The program works so well that I want to put an icon on the top left of of the form.  The program has one form it has a default icon on the top left.

    So far so good.

    I have tried various ways to achieve the none of them work.

    The last attempt I went file>new>file>icon file

    I saved the default icon

    using the form I went to the control and set the icon value to point to the icon file above.

    I ran the code - I could see the replaced icon but then the system crashed error messages were "Symbol loading for mscoreei.dll was skipped because it is not specified in the included modules list"

    Additional information was supplied as follows:

    System.Resources.MissingManifestResourceException
      HResult=0x80131532
      Message=Could not find any resources appropriate for the specified culture or the neutral culture.  Make sure "availability.MyForm.resources" was correctly embedded or linked into assembly "LogImpact" at compile time, or that all the satellite assemblies required are loadable and fully signed.
      Source=mscorlib
      StackTrace:
       at System.Resources.ManifestBasedResourceGroveler.HandleResourceStreamMissing(String fileName)
       at System.Resources.ManifestBasedResourceGroveler.GrovelForResourceSet(CultureInfo culture, Dictionary`2 localResourceSets, Boolean tryParents, Boolean createIfNotExists, StackCrawlMark& stackMark)
       at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo requestedCulture, Boolean createIfNotExists, Boolean tryParents, StackCrawlMark& stackMark)
       at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents)
       at System.Resources.ResourceManager.GetObject(String name, CultureInfo culture, Boolean wrapUnmanagedMemStream)
       at availability.MyForm.InitializeComponent()
       at availability.MyForm..ctor()
       at main(String[] args)

    I have found C:\Windows\Microsoft.NET\Framework64\v4.0.30319\mscoreei.dll  --- I have tried include it as a new module

    properties>configuration properties>c/c++>general>additional include directories   C:\Windows\Microsoft.NET\Framework64\v4.0.30319\mscoreei.dll

    At this point I am stuck and any hints would be very appreciated.

    Thanks

    Boffin2


    Thursday, March 15, 2018 5:04 AM

Answers

  • I was unable to find a solution that used the VS c++ gui on a form.  The app kept crashing.

    Instead I used the following code as part of a cli form.

    I was not quote c++ but it worked

    regards

    Boffin2

    protected:
            virtual Void Splash::OnPaint(PaintEventArgs^ pe) override
            {


                Graphics^ g = pe->Graphics;
                Image^ image = Image::FromFile("logo.jpg");
                //Icon^ iconx = Image::FromFile("bco-logo2mm.jpg");

                Form::ClientSize = image->Size;
                g->DrawImage(image, 0, 0, image->Size.Width, image->Size.Height);
                //this->buttonSplashCancel->Location = System::Drawing::Point(image->Size.Width- this->buttonSplashCancel->Size.Width, image->Size.Height - this->buttonSplashCancel->Size.Height);
                //g->DrawIcon(image,0,0);
            }

                
    • Marked as answer by stargorg Monday, April 30, 2018 4:40 AM
    Monday, April 30, 2018 4:40 AM