Click here to Skip to main content
16,005,339 members
Home / Discussions / Managed C++/CLI
   

Managed C++/CLI

 
GeneralServer Command Routing Pin
DhCole22-Jul-05 23:16
DhCole22-Jul-05 23:16 
GeneralFile Monitoring Using ReadDirectoryChangeW Pin
Sheela_R22-Jul-05 20:43
Sheela_R22-Jul-05 20:43 
GeneralControlling my Console Pin
jinbabaj22-Jul-05 9:21
jinbabaj22-Jul-05 9:21 
Generalparse Pin
iboett2s22-Jul-05 2:56
iboett2s22-Jul-05 2:56 
GeneralRe: parse Pin
Christian Graus24-Jul-05 19:06
protectorChristian Graus24-Jul-05 19:06 
GeneralRe: parse Pin
gecool10-Aug-05 22:25
gecool10-Aug-05 22:25 
Generalstop another dialog exe Pin
chenggong22-Jul-05 2:48
chenggong22-Jul-05 2:48 
Generalmc++ icons/resources Pin
istrasci21-Jul-05 10:50
istrasci21-Jul-05 10:50 
Hi, I am writing a program in MC++ (using VS .NET -- thus this post is very VS .NET specific) and am having a problem getting my main form's Icon to display properly... My application is crashing, based on the follow process:

1 - I made a custom icon for the form (myIcon.ico)
2 - Right Click on the form (in the [design]), click "Properties", then click the "..." button of the "Window Style"->Icon field...
3 - choose "myIcon.ico" from the file chooser
4 - VS .NET then produces the following relevant code (which executes inside the form's constructor):

void InitializeComponent(void)<br />
{<br />
  System::Resources::ResourceManager *resources = new System::Resources::ResourceManager(__typeof(myNameSpace::Form1));<br />
  ...<br />
  //<br />
  // Form1<br />
  //<br />
  ...<br />
  this->Icon = (__try_cast< System::Drawing::Icon * >(resources->GetObject(S"$this.Icon")));<br />
  ...<br />


If I run the program in debug mode, it will crash when attempting the this->Icon = ... line... If I insert the following code after InitializeComponents() executes, it works fine.

this->set_Icon(new System::Drawing::Icon(new String("app.ico") ) )

However, this now has the side-effect of requiring the myIcon.ico file to be in the same directory as the executable... As I need to release this code to customers, I don't want to trust that they won't accidentally delete the icon file... Thus, I would like icon "compiled into" the executable...

So my questions are:
1) Will it get "compiled into" the executable assuming the generated code ever works correctly...???
2) Why is it crashing...???
3) Does it have anything to do with making the icon into a resource (.rc) file...???
4) Anyone know how I can fix this issue...???

TIA,
istrasci
GeneralRe: mc++ icons/resources Pin
ursus zeta27-Jul-05 9:50
ursus zeta27-Jul-05 9:50 
GeneralRefreshing the iterator Pin
Pazzuzu21-Jul-05 5:31
Pazzuzu21-Jul-05 5:31 
GeneralRe: Refreshing the iterator Pin
Christian Graus21-Jul-05 13:40
protectorChristian Graus21-Jul-05 13:40 
GeneralRe: Refreshing the iterator Pin
Pazzuzu25-Jul-05 2:30
Pazzuzu25-Jul-05 2:30 
QuestionSystem::Drawing::Rectangle problem??? Pin
richiemac20-Jul-05 3:20
richiemac20-Jul-05 3:20 
AnswerRe: System::Drawing::Rectangle problem??? Pin
Christian Graus20-Jul-05 12:44
protectorChristian Graus20-Jul-05 12:44 
GeneralRe: System::Drawing::Rectangle problem??? Pin
richiemac20-Jul-05 21:54
richiemac20-Jul-05 21:54 
GeneralRe: System::Drawing::Rectangle problem??? Pin
Christian Graus21-Jul-05 13:25
protectorChristian Graus21-Jul-05 13:25 
AnswerRe: System::Drawing::Rectangle problem??? Pin
ChewsHumans21-Jul-05 16:59
ChewsHumans21-Jul-05 16:59 
AnswerThanks guys! Pin
richiemac21-Jul-05 22:05
richiemac21-Jul-05 22:05 
Generalediting labels in tree view Pin
AlexR12319-Jul-05 1:10
AlexR12319-Jul-05 1:10 
GeneralAdd .NET Form into MFC application Pin
Gian19-Jul-05 0:50
Gian19-Jul-05 0:50 
GeneralRe: Add .NET Form into MFC application Pin
Sheng Jiang 蒋晟19-Jul-05 7:58
Sheng Jiang 蒋晟19-Jul-05 7:58 
GeneralRe: Add .NET Form into MFC application Pin
Gian20-Jul-05 1:10
Gian20-Jul-05 1:10 
Generalopen a new web page Pin
Blue_Skye18-Jul-05 8:31
Blue_Skye18-Jul-05 8:31 
GeneralRe: open a new web page Pin
Judah Gabriel Himango18-Jul-05 11:08
sponsorJudah Gabriel Himango18-Jul-05 11:08 
GeneralRe: open a new web page Pin
Blue_Skye18-Jul-05 16:42
Blue_Skye18-Jul-05 16:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.