trying to insert my own icon into a Windows Forms application

G

Guest

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
 
G

Guest

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

James Park said:
http://support.microsoft.com/default.aspx/kb/888267

AK said:
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
 
J

James Park

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

AK said:
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

James Park said:
http://support.microsoft.com/default.aspx/kb/888267

AK said:
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
 
G

Guest

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

James Park said:
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

AK said:
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

James Park said:
http://support.microsoft.com/default.aspx/kb/888267

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top