Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / July 2005

Tip: Looking for answers? Try searching our database.

trying to insert my own icon into a Windows Forms application

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
AK - 26 Jul 2005 14:32 GMT
I have a Windows Forms.NET project & am modifying the GUI in Form1.h[Design] .
I click the Form, go to Properties, click the Icon Property, & change it to
the .ico file I want. It accepts the change & shows me a thumbnail of the
image in the Properties tab, but when I compile I get a "C2039: 'GetObjectA'
is not a member of System::Resources:ResourceManager".

I've tried to manipulate ResourceView so it will accept my image, but to no
avail (I'm really not sure if I'm doing the right thing).
Perhaps there's a setting in the project Properties that needs to be changed ?
Can anybody tell me how to setup a user-drawn bitmap as the icon to an
application ?

Thanks,

ak
James Park - 26 Jul 2005 16:39 GMT
http://support.microsoft.com/default.aspx/kb/888267

>I have a Windows Forms.NET project & am modifying the GUI in
>Form1.h[Design] .
[quoted text clipped - 16 lines]
>
> ak
AK - 26 Jul 2005 17:26 GMT
James, thanks for the lnik - the problem compiles but now I get an unhandled
exception :
MCppCodeDomParser Error: Line: 113, Column: 1 --- Unexpected token
for a 'term'

& the Form1 [Design] can no longer be opened - what's going on ?

ak

> http://support.microsoft.com/default.aspx/kb/888267
>
[quoted text clipped - 18 lines]
> >
> > ak
James Park - 26 Jul 2005 23:35 GMT
If you are doing:

void InitializeComponent(void)
{
#ifdef GetObject
#pragma message("Undefine the GetObject function for your managed code.")
#pragma push_macro("GetObject")
#undef GetObject
#endif
...
#ifndef GetObject
#pragma message( "Redefine the GetObject function to the unmanaged code
definition.")
#pragma pop_macro("GetObject")
#endif
}

try:

#ifdef GetObject
#pragma message("Undefine the GetObject function for your managed code.")
#pragma push_macro("GetObject")
#undef GetObject
#endif
void InitializeComponent(void)
{
   ...
}
#ifndef GetObject
#pragma message( "Redefine the GetObject function to the unmanaged code
definition.")
#pragma pop_macro("GetObject")
#endif

> James, thanks for the lnik - the problem compiles but now I get an
> unhandled
[quoted text clipped - 31 lines]
>> >
>> > ak
AK - 27 Jul 2005 19:16 GMT
Thanks for the help - the program runs OK now, but the icon is the default one.
It doesn't seem to use my icon defined in Resource View as IDI_ICON1
& filename app.ico  .

ak

> If you are doing:
>
[quoted text clipped - 65 lines]
> >> >
> >> > ak

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.