c++ event handler issue

This topic is 5244 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

Recommended Posts

Ok, so here is the deal. I want it to use an event handler to fill my combo box. When one item is selected in an combo box, I want it to read the subdirectories in a directory, and fill the second combo box. Now, I know how to do DirectoryInfo in my .cpp file, but how would I go about doing this in my header file? I tried adding in the namespace Microsoft::Win32 but that did not do anything.
private: System::Void cPlayerAccounts_SelectedIndexChanged(System::Object *  sender, System::EventArgs *  e)
{
DirectoryInfo* directory = this->tWoWDir->get_Text();
System::String* dirName = String::Concat(directory, "\\WTF\\Account\\");
System::String* accountName = this->cPlayerAccounts->GetItemText();
DirectoryInfo* accountFolder = String::Concat(dirName, accountName);
if (accountFolder->Exists)
{
DirectoryInfo* playerName[] = accountFolder->GetDirectories();
for (int i = 0; i < playerName->Length; i++)
{
}
}
}

[Edited by - PyroBlizzard on June 6, 2005 10:00:57 PM]

Share on other sites
try changing quote to source or code it looks much better and is actually readable. Im sure someone will attempt to read your code then.

It looks like your trying to use c# code. there is no namespace microsoft or win32. I dont think directoryinfo is a type either. MSDN is your friend

either that or you're using managed c++ if thats the case you should put that in the title because it seems quite different from the win32/c++ code i know.

Share on other sites
ah, no. Im not using C# code at all. Im using managed c++. If you had noticed, for one the topic states C++, and also I said I know how to do DirectoryInfo in my .cpp file. Its just a thing of im doing this as an event handler, through a header file.

Share on other sites
My point was managed c++ ISNT c++ they are very different if you would let people know that in your title you could probably get much more relevant replies.

Share on other sites
Ok, figured it out somewhat. Problem now is, I dont know how to get the newly selected value in combobox a, so that I can make an according change based on combobox b.

• Game Developer Survey

We are looking for qualified game developers to participate in a 10-minute online survey. Qualified participants will be offered a \$15 incentive for your time and insights. Click here to start!

• 16
• 30
• 9
• 16
• 22