Hi, how can i place around 500 controls simultaneously on a single Dialog? Any idea? Thanks in advance. Anish.
AnsGe
Posts
-
Around 500 controls in a Dialog -
Can not marshal parameter #4: The type definition of this type has no layout information.Hai In my applcation i want to list all machines in the network. So i used the WNetOpenEnum API . My code looks like, [DllImport("Mpr.dll", EntryPoint="WNetOpenEnumA", CallingConvention=CallingConvention::Winapi)] static ErrorCodes WNetOpenEnum(ResourceScope dwScope, ResourceType dwType, ResourceUsage dwUsage, NETRESOURCE* p, IntPtr &lphEnum); NETRESOURCE* pRsrc = new NETRESOURCE(); //A managed class IntPtr handle = IntPtr::Zero; result = WNetOpenEnum(RESOURCE_GLOBALNET, RESOURCETYPE_DISK, RESOURCEUSAGE_ALL, pRsrc, handle); But when i run the application got an error " Can not marshal parameter #4: The type definition of this type has no layout information. " Whats is the problem. Plz help
-
Listing all machines in the networkHai, How can i list all machines in the network. If u have any idea plz help me Thanks in Advance:) Anish
-
StatusBar problemWhat is the rigth method to add a Statusbar to a Dialog? I had done this way. CStatusBar m_StatusBar //Memeber variable m_StatusBar->Create(this); But whenever i call 'Invalidate' method the status bar also flickering:(. Is the GetClientRect retrieves the StatusBar area also? Thanks in Advance:) Ann
-
DoModal returns -1hai, Thanks for ur reply. i know the exact reason why it retuns -1. bcoz one my ocx is not installed in the machine. But i want to capture the situation and want to display error message. I have done all hte initialisations in the InitInstance Thanks Ans
-
DoModal returns -1Hai, I tried with ur help. But my problem still remains. If main window is successfully loaded then it is possible to show any mesagebox. But the main window Domodal() failed then it is not possible to show a MessageBox. The code snip running, but windows are not visible Thanks Anish
-
Checking an ocx is installed or notHai, Actually i don't know the internal structure about the used COM component. Its a 3rd party control and i have only know some functions in it. I dont know any classid and interface id's. So how can i call CoCreateInstance() Byy Anish
-
DoModal returns -1Hai All, In my application InitInstance method the DoModal() calling of main application dialog return -1(bcoz of some loading problem). but i want to capture it and show some error mesage. But i cann't show any error message or any other dialog when it returns -1. How i can i solve this problem. ANyone can have any idea? regards Ans
-
Checking an ocx is installed or notHai All, How can i check an ocx which is droped in my main application dialog is installed or not. I not used the CoCreateInstane function , but i directly placed the control in my dialog. The application crashes when the control is not installed. How can i avoid it? Thanks in Advance Ans
-
Rotating Polygons in fixed AngleHai, In my application i want to rotate the Polygons i have drawn in a specifeid angle without using the RotateTrasnfom(bcoz a lot of other object are in my drawings). Nanyone have any idea about it? Thnaks in Advance
-
Cant intercommunicate between managed classesHai, i dont know the what i am saying is correct. but ur probelm can be solved in this way. But this is not recommended if u have heavy updation in ur Form1 class. One more reason for my qucik response is that next four days will not here. simply pass a reference of ur textbox to the Form2 class ie Create a TExtbox object in ur Form2 class; TextBox* t1; Passes the reference of original one to this value in Constructor frm2->t1=this->textBox1; Now u can update the text in Button click as this->tt->Text="Updated Text"; By Anish If u find a good solution plz post it here
-
Cant intercommunicate between managed classesHai U can done it very simply. Don't include or declare Form1 in Form2 . It will produce circular referencing. change ur code like this **Form1.h** #pragma once #include "Form2.h" namespace datapassing { public __gc class Form1 : public System::Windows::Forms::Form { public: Form2 *pFrm2; public: Form1(void) { InitializeComponent(); pFrm2 = new Form2; pFrm2->Owner=this; } private: System::Void button1_Click(System::Object * sender, System::EventArgs * e) { pFrm2->Visible = true; this->Visible = false; } }; } **Form2.h** #pragma once namespace datapassing { public __gc class Form2 : public System::Windows::Forms::Form { public: public: Form2(void) { InitializeComponent(); } private: System::Void button1_Click(System::Object * sender, System::EventArgs * e) { this->Owner->Visible = true; this->Visible = false; } }; } By Anish
-
String conversionsHai u can convert it using the InteropServices const char* str=(const char*)(System::Runtime::InteropServices::Marshal::StringToHGlobalAnsi("ManagedString")).ToPointer(); By Anish
-
KeyDown problemhai, Sorry i dont know how it solve!!! Some where i found to override the ProcessmdKey method but i didn't get too much ideas If u solve the problem plz post it by ANish
-
StringsHai, You can comapre the Strings using the static Compare method in the String class ie String* str=S"HELLO"; if(String::Compare(str,"HELLO")==0) //ie Same { TextBox1 -> Text = "Same"; } else { TextBox1 -> Text = "Not The Same""; } SubString function done all the left, right and mid functionalities by Anish
-
KeyDown problemHai, I just copied your code and its works!!!! Sometimes the focus is not on your Form .
-
Listbox: How to ensure that last item added is visible?Hai, u can simply solve the problem by selecting the last item. ie this->listBox1->SelectedIndex=this->listBox1->Items->Count-1;; ANish
-
Newbie: Undeclared IdentifierHai Nothing wrong in ur code. i also don't know why it happened. But placing your second class before the Form1 calss will solve the problem. ie define all your classes before it uses by Anisg
-
LOGFONT structureHai, I couldn't get it. Also runtime exception occures even i type caste the LOGFONT structure. Can you show a simple piece of code using LOGFONT structure and Font::FromLogFont method thank u
-
Reading file from OpenFileDialog.Hai Alex, you can solve the problem with this help of FileStram class FileStream* fs; StreamReader* InputStream; OpenFileDialog* openFileDialog1 = new OpenFileDialog(); if(openFileDialog1->ShowDialog() == DialogResult::OK) { fs=new FileStream(openFileDialog->FileName,FileMode::Open); InputStream=new StreamReder(fs); //Then done your reading using InputStream } NB: please include using namespace System::IO;