|
Unfortunately I don't understand your suggestion.
Please explain more and give me a example.
Thanks.
|
|
|
|
|
|
Exactly I don'n know what I write.
I barely know about windows form because I just start it.
if you know equivalent of that code in c++,please help me.
|
|
|
|
|
|
Tank you but still there is a problem!
I don't access label name because it made dynamically and before that i cant access to this label.
Even I know label name the compiler don't allow me to remove in that way.
|
|
|
|
|
Sorry, but I do not understand what you mean. If you are iterating through a collection of controls then you do not need their name. As you look at each control in the collection you get its type to check if it is a label. Then you read its content to see if it is one of the candidates for deletion.
|
|
|
|
|
Well,how can I get the controls type?
is there any function to return this?
And how I check it is label or not?
|
|
|
|
|
Go back to the link I gave you previously and study the documentation.
|
|
|
|
|
I read them but they code are in c# and I don't know equivalent of this part in c++ :
" C.GetType() == typeof(System.Windows.Forms.TextBox) "
c.GetType exist in c++ but "typeof(System.Windows.Forms.TextBox)" no,do you know what is it in c++?
(I'm sorry that I ask a lot question.)
|
|
|
|
|
I have not tried this but you should be able to use the GetType method[^] and compare it against the same result from a known object of that class, something like:
Label ll = new Label();
if (control.GetType() == ll.GetType())
|
|
|
|
|
Hi I want delete or remove or clear all label from my form how can I do this?
is there any way that I can remove specific controls without it name?
|
|
|
|
|
You can iterate through all the controls on the form and check their type, thus identifying the labels. You can then decide whether to remove them or not.
|
|
|
|
|
Help me!
I want convert file .mp3 to file .sty (play with Organ player).
Thank you so much!
modified 29-Jun-15 3:14am.
|
|
|
|
|
What have you tried and where are you stuck?
|
|
|
|
|
I'm looking into perf tuning in our application and one area we've identified when converting many strings between String^ and a native array of UTF-8 chars. Currently, I use code similar to this:
array<Byte>^ byteArray = System::Text::Encoding::UTF8->GetBytes(str);
pin_ptr<Byte> p = &byteArray[0];
I then proceed to memcpy from p to my own storage block.
Has anyone compared Encoding::UTF8->GetBytes() to pinning a string^ and using WideCharToMultiByte(CP_UTF8, ...)?
I suspect it will be faster to use WideCharToMultiByte even if I call twice (once to get byte count, once to convert) and will investigate today but I thought there may be a war story or two out there.
Any lessons learned?
John
|
|
|
|
|
Update:
Well, my initial experiment proved to me that YES, it's much faster to use WideCharToMultiByte().
The speedup varies by language of text I'm converting of course.
The time to run my tests were reduced by: English: 13%, German: 18%, Japanese: 16%, Chinese: 12%
The gist of my code is now:
String^ str = "...the string to convert...";
pin_ptr<const wchar_t> unicode16 = PtrToStringChars(str);
int const cbNeeded = WideCharToMultiByte(CP_UTF8, 0, unicode16, -1, nullptr, 0, nullptr, nullptr);
auto converted = make_unique<MyBuffer>(cbNeeded);
int const cbConverted = WideCharToMultiByte(CP_UTF8, 0, unicode16, -1, converted.get(), cbNeeded, nullptr, nullptr);
It was a surprise that passing -1 for the length parameter to WCtoMB resulted in an even faster conversion!
I hope this helps someone out there and I'm still interested in any responses from any devs doing similar work.
John
|
|
|
|
|
Thanks for posting the result. This is valuable information.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Hi Iam using the below codes to save the report as PDF in c#...Is it possible to convert it in C++/Cli
Thanks:thumbsup:
My Codes
byte[] Bytes = Reportviewer1.LocalReport.Render(format:"PDF",deviceInfo:"");
using (FileStream stream = new FileStream("C:\MyFolder", FileMode.Create))
{
stream.Write(Bytes, 0, Bytes.Length);
}
|
|
|
|
|
Paramu1973 wrote: Is it possible to convert it in C++/Cli No conversion is necessary, as C++/CLI is essentially the same.
|
|
|
|
|
Yep, conversion should be straightforward. 'using' is unnecessary. 'gcnew' instead of 'new'. :: to scope namespaces and clases instead of '.', etc..
|
|
|
|
|
THANKS
|
|
|
|
|
I got below exception while reading data from .dat file using c++ code eof.
Unhandled exception at 0x0FD2CCC8 (msvcp110d.dll) in ConsoleApplication1.exe: 0xC0000005: Access violation reading location 0x004DF174.
My Code:
teacher t1;
ifstream file1;
file1.open("Teacher.dat",ios::binary|ios::app);
file1.seekg(0);
while(!file1.eof())
{
file1.read((char*)&t1,sizeof(t1));
t1.Display();
}
file1.close();
Last record prints multiple time and throwing exception.
Please have a look into.
Thanks in advance.
|
|
|
|
|
1. This does not look like managed code.
2. Please use <pre> tags round your code to make it more readable.
3. What is the structure of the teacher type?
4. How is the data file created?
5. What does the Display method do?
|
|
|
|
|
i have created a simple window using MFC application wizard but i can see only navigation pane(which is in left side of window). Can anyone tell how to view those contents on List view pane.
|
|
|
|
|
That sounds like a bit more that a 'simple' window. What type of control is in each pane?
|
|
|
|