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

Managed C++/CLI

 
GeneralRe: User Controls Pin
Christian Graus15-Dec-07 0:24
protectorChristian Graus15-Dec-07 0:24 
Question[Message Deleted] Pin
(Steven Hicks)n+114-Dec-07 12:39
(Steven Hicks)n+114-Dec-07 12:39 
GeneralRe: Question about redeclaring header files Pin
Christian Graus14-Dec-07 14:48
protectorChristian Graus14-Dec-07 14:48 
QuestionRe: [Message Deleted] Pin
Hamid_RT20-Dec-07 2:23
Hamid_RT20-Dec-07 2:23 
QuestionClass intantiation renders app unresponsive Pin
Dewm Solo14-Dec-07 9:42
Dewm Solo14-Dec-07 9:42 
GeneralRe: Class intantiation renders app unresponsive [modified] Pin
Luc Pattyn14-Dec-07 10:24
sitebuilderLuc Pattyn14-Dec-07 10:24 
GeneralRe: Class intantiation renders app unresponsive Pin
Dewm Solo14-Dec-07 10:36
Dewm Solo14-Dec-07 10:36 
GeneralRe: Class intantiation renders app unresponsive Pin
Dewm Solo14-Dec-07 10:50
Dewm Solo14-Dec-07 10:50 
Well I'm almost beat....I changed the way it works like I said I would. So now the ctor does nothing but save that path until the read method is called.

Yet instantiating this class still makes the application stop responding. Just as a reminder....only on client stations. On a dev station no problem.

Class Declaration:
<br />
typedef cli::array< cli::array<string^>^ > TemplateArray;<br />
<br />
	public ref class CFileTemplate{<br />
		//ctor and dtor<br />
	public:<br />
		CFileTemplate(String^ sPath);<br />
		~CFileTemplate();<br />
<br />
		//members<br />
	private:<br />
		String^ m_FilePath;<br />
		TemplateArray^ arrCurrentTemplate;<br />
	public:<br />
<br />
		//methods<br />
	public: //private: ->Changed for test purposes...<br />
		void Process();<br />
	public:<br />
		void SwitchTemplate(String^ sPath);<br />
		TemplateArray^ ReturnFormat();<br />
<br />
<br />
	};<br />
</string^>


The class' ctor:
<br />
CFileTemplate::CFileTemplate(String^ sPath) : m_FilePath(sPath)<br />
{<br />
	MessageBox::Show("ctor");<br />
}<br />



In the main application, here is the call:
<br />
private: System::Void button1_Click(System::Object^  sender, System::EventArgs^  e) {<br />
        String^ myStream;<br />
<br />
	MessageBox::Show("Opening dialog");<br />
	if ( this->openFileDialog1->ShowDialog() == System::Windows::Forms::DialogResult::OK )<br />
	{<br />
		MessageBox::Show("Making sure the stream is not empty");<br />
		if ( (myStream = this->openFileDialog1->FileName) != nullptr )<br />
		{<br />
			MessageBox::Show("Instiating the file template object");<br />
			this->aTemplate = gcnew MFG::CFileTemplate(myStream->ToString()); //THIS IS THE CULPRIT.<br />
			MessageBox::Show("instance created");<br />
		}<br />
	}<br />
}<br />



Ok....to complete the explanation.....like this I never get to see the file dialog....nothing gets executed in the click event.

BUT!!!!!!!!!!

If I comment the line that instantiates the class.....everything goes fine. Except I cannot call the read method of course...the thing isn't instantiated.
Dewm Solo - Managed C++ Developer

GeneralRe: Class intantiation renders app unresponsive Pin
Luc Pattyn14-Dec-07 11:14
sitebuilderLuc Pattyn14-Dec-07 11:14 
GeneralRe: Class intantiation renders app unresponsive Pin
Dewm Solo14-Dec-07 11:20
Dewm Solo14-Dec-07 11:20 
GeneralRe: Class intantiation renders app unresponsive Pin
Luc Pattyn14-Dec-07 11:34
sitebuilderLuc Pattyn14-Dec-07 11:34 
GeneralRe: Class intantiation renders app unresponsive Pin
Mark Salsbery14-Dec-07 11:41
Mark Salsbery14-Dec-07 11:41 
GeneralRe: Class intantiation renders app unresponsive Pin
Luc Pattyn14-Dec-07 12:05
sitebuilderLuc Pattyn14-Dec-07 12:05 
GeneralRe: Class intantiation renders app unresponsive Pin
Mark Salsbery14-Dec-07 12:10
Mark Salsbery14-Dec-07 12:10 
GeneralRe: Class intantiation renders app unresponsive Pin
Luc Pattyn14-Dec-07 12:26
sitebuilderLuc Pattyn14-Dec-07 12:26 
GeneralRe: Class intantiation renders app unresponsive Pin
Mark Salsbery14-Dec-07 11:45
Mark Salsbery14-Dec-07 11:45 
GeneralRe: Class intantiation renders app unresponsive Pin
Dewm Solo14-Dec-07 17:54
Dewm Solo14-Dec-07 17:54 
GeneralRe: Class intantiation renders app unresponsive Pin
Jeffrey Walton16-Dec-07 2:28
Jeffrey Walton16-Dec-07 2:28 
GeneralRe: Class intantiation renders app unresponsive Pin
Dewm Solo17-Dec-07 7:41
Dewm Solo17-Dec-07 7:41 
GeneralConfusion Pin
Dewm Solo17-Dec-07 8:25
Dewm Solo17-Dec-07 8:25 
GeneralRe: Confusion Pin
Dewm Solo17-Dec-07 9:21
Dewm Solo17-Dec-07 9:21 
GeneralRe: Confusion Pin
Dewm Solo18-Dec-07 5:26
Dewm Solo18-Dec-07 5:26 
QuestionI'm lost [modified] Pin
Dewm Solo18-Dec-07 5:41
Dewm Solo18-Dec-07 5:41 
GeneralOnPaint paints over objects Pin
BuckBrown14-Dec-07 9:27
BuckBrown14-Dec-07 9:27 
GeneralRe: OnPaint paints over objects Pin
Christian Graus14-Dec-07 11:21
protectorChristian Graus14-Dec-07 11:21 

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.