|
You might also consider working with a vector and storing the index values. Vectors are not all that bad as their reputation. See this recent article for an interesting comparison to linked lists:
Number-crunching-Why-you-should-never-ever-EVER-us
With an index value you definitely know that it will always fit into the data cell of a list box.
|
|
|
|
|
Thank you for your answer and the interesting article.
However, as I mentioned, I am doing insertions within the middle of the list - so the indices change and it does not make any sense to store them in the data cell.
Additionally: Your article assumes that I would have to find the right insert position and therefore the vector would be faster - but if it would have been possible to store the iterator inside the data cell, I would immediately start at the right position of my linked list.
It would still be nice to have a data structure allowing access by index (not Key!) while beeing able to insert/remove elements in logarithmic time.
Alex
|
|
|
|
|
Hi all!
I am trying to change the resource data in an EXE file for some reasons. Before I do that, I must get the address of it. But I don't know how to get it. I read some documents of PE. Now I can get the address of IMAGE_RESOURCE_DIRECTORY. Then I open a my-own EXE to do so.
In this EXE, I had added a resource specified by myself. Now I try to change it. In resource-directory structure, the value of RVA of that data is 55E18h. But I can't get the correct address from this RVA. The base address of IMAGE_RESOURCE_DIRECTORY is 4E600h in my EXE. If I add the RVA to the base address, the result address is beyond the file. The correct address of data is 4F418h. I don't know how to get it. Is there somebody be kind to tell me the method? Thx!
There is some white cloud floating on the blue sky. That's the landscape I like.
|
|
|
|
|
You should use the Resource Functions[^] provided by the Windows API.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
Thank you very much!
There is some white cloud floating on the blue sky. That's the landscape I like.
|
|
|
|
|
The Boost documentation says the Iterator library (New Iterator Concepts
and Iterator Facade and Adaptor) were proposed and accepted for TR1.
However, I can't see any sign of them in the final TR1 or C++11. Are they there, but somewhere I've missed? Were they kicked out when the concepts were removed? Will they return if/when concepts do? Who was that masked stranger?
(The correct place to ask this question might be the one of the Boost mailing lists or comp.lang.c++ but I'm not really curious enough to go through the subscription when I can ask here, and I think it's a valid question.)
|
|
|
|
|
Did anyone used GZip.exe(3rd party) to do compression/decompression?
Is it possible to compress multiple files into single archive(.gz) using GZip.exe.
C
|
|
|
|
|
Is this a WTL/STL/ATL question?
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
|
Hi,
I am using
IHTMLElement3::fireEvent Method in my display framework to fire my OnChange method to browser. Using script, I'm setting cancelchange status( window.event.ReturnValue = false; ). But "pfCancelled" argument of FireEvent is not returning cancel status "VARIANT_FALSE". Anybody knows the reason?
|
|
|
|
|
VS2010 CLR double to String, String to double methods
to get data in and out of editText Textboxes in MSVC / VCpp?
Are there any good examples for gui on C++ in VS2010 ?
|
|
|
|
|
See here[^] for Double.ToString() , and here[^] for the reverse operation.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
Richard,
Are there good gui examples for VS2010 C++ for CLR and MFC anywhere?
Not even sure if there is a better flavor of gui beyond those...ATL ??
|
|
|
|
|
Follow the links I gave you and read the explanations and sample code. You also need to decide whether you are using CLR or MFC; they are not the same.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
Richard
Yes, trying to use CLR this time.
Would be interested in finding good gui examples for MFC or CLR though.
Not even sure about ATL..... Is there a best way to do gui with C++ VS2010?
|
|
|
|
|
meace1234 wrote: trying to use CLR this time.
OK, I've given you the references to the documentation.
meace1234 wrote: Is there a best way to do gui with C++ VS2010?
I'm not sure what this means.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
Here is the conversion part
CLR isnt too bad... better than MFC yes?
//How to do conversions for CLR C++ GUI
double dblInput1 = 0.0;
double dblInput2 = 0.0;
double dblAnswer = 0.0;
String ^ strInput1;
String ^ strInput2;
strInput1 = this->Input1textBox->Text;
strInput2 = this->Input2textBox->Text;
if (Double::TryParse(strInput1, dblInput1) & Double::TryParse(strInput2, dblInput2))
{
// do something
dblAnswer = dblInput1 + dblInput2;
Answer1textBox->Text = System::Convert::ToString( dblAnswer );
}
else
{
// the text was not a number, show user an error if appropiate
MessageBox::Show("Error");
}
|
|
|
|
|
That looks OK.
meace1234 wrote: CLR isnt too bad... better than MFC yes?
No, just different.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
|
//How to do conversions for CLR C++ GUI
//This worked
double dblInput1 = 0.0;
double dblInput2 = 0.0;
double dblAnswer = 0.0;
String ^ strInput1;
String ^ strInput2;
strInput1 = this->Input1textBox->Text;
strInput2 = this->Input2textBox->Text;
Double::TryParse(strInput1, dblInput1);
Double::TryParse(strInput2, dblInput2);
dblAnswer = dblInput1 + dblInput2;
Answer1textBox->Text = System::Convert::ToString( dblAnswer );
But, How do i add an If then to handle the TryParse exception???
|
|
|
|
|
//Here is the conversion part CLR C++ GUI
//CLR isnt too bad… better than MFC yes?
double dblInput1 = 0.0;
double dblInput2 = 0.0;
double dblAnswer = 0.0;
String ^ strInput1;
String ^ strInput2;
strInput1 = this->Input1textBox->Text;
strInput2 = this->Input2textBox->Text;
if (Double::TryParse(strInput1, dblInput1) & Double::TryParse(strInput2, dblInput2))
{
// do something
dblAnswer = dblInput1 + dblInput2;
Answer1textBox->Text = System::Convert::ToString( dblAnswer );
}
else
{
// the text was not a number
MessageBox::Show(“Error”);
}
|
|
|
|
|
Hi ,
i want to import WTL in an ATL project,if anyone have any idea ,please share !!!!!!!!!
|
|
|
|
|
There is a WTL section in CodeProject, I'd suggest you to look there.
In practice, you have to #include a few WTL headers in your STDAFX.H.
Take a look at Creating a WTL Dialog, Property Sheet or Wizard out of a resource (The Easy Way)[^], the sample project is an ATL DLL with WTL for the UI: the stdafx.h file will give you a hint.
Hope this helps,
Pablo.
"Accident: An inevitable occurrence due to the action of immutable natural laws." (Ambrose Bierce, circa 1899).
|
|
|
|
|
Hi Guys,
i want to list and check the status of each contact of my Office Communicator
for this i have done till
1)i can see number of contact from get_count method
2)GetContact method is also successfully executed.
and done know how to move further..
any help is appriciated..
CoInitialize(NULL);
HRESULT hr = CoCreateInstance(CLSID_Messenger,NULL,CLSCTX_LOCAL_SERVER,
IID_IMessenger, (LPVOID *)&m_pIMessenger);
BSTR myName;
MISTATUS sMyStatus;
hr=m_pIMessenger->get_MySigninName(&myName);
hr = m_pIMessenger->get_MyStatus(&sMyStatus);
BSTR serviceId;
m_pIMessenger->get_MyServiceId(&serviceId);
IDispatch *pContacts;
IMessengerContacts *pCon;
BSTR bstrServiceId;
hr = m_pIMessenger->get_MyServiceId(&bstrServiceId);
if (FAILED(hr))
return NULL;
hr = m_pIMessenger->GetContact(myName, bstrServiceId,
(IDispatch**)&pCon);
</blockquote>
vikas da
|
|
|
|
|
I don't see the items you refer to in your code extract.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|