|
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
|
|
|
|
|
Thanks for the reply...
Please find the complete code
<blockquote class="FQ"><div class="FQA">Quote:</div>#include<iostream>
#include <windows.h>
#include <tchar.h>
#include<Iads.h>
#include <ole2.h>
#include "c:\program files\Microsoft Office Communicator\SDK\msgrua.h"
const GUID IID_IMessenger =
{0xD50C3186,0x0F89,0x48f8,{0xB2,0x04,0x36,0x04,0x62,0x9D,0xEE,0x10}};
const GUID CLSID_Messenger =
{0x8885370D,0xB33E,0x44b7,{0x87,0x5D,0x28,0xE4,0x03,0xCF,0x92,0x70}};
const GUID IID_MessengerContacts =
{0xE7479A0F,0xBB19,0x44a5,{0x96,0x8F,0x6F,0x41,0xD9,0x3E,0xE0,0xBC}};
const GUID IID_IEnumVARIANT =
{0x00020404,0x0000,0x0000,{0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x46}};
IMessenger* m_pIMessenger;
IMessengerContact* GetContact(BSTR bstrSigninName);
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
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;
if (FAILED(hr))
return NULL;
hr = m_pIMessenger->GetContact(myName, serviceId,
(IDispatch**)&pCon);
if(FAILED(hr))
{
cout<<"Failed";
}
m_pIMessenger->get_MyContacts(&pContacts);
pContacts->QueryInterface(__uuidof(IMessengerContacts),(void**)&pCon);
long lCount=0;
pCon->get_Count(&lCount);
CoUninitialize();
return 0;
}</blockquote>
Bow here i can see the count..now i want to iterate through each contact ..i am not getting right method to do the same.
vikas da
|
|
|
|
|
tasumisra wrote: now i want to iterate through each contact
Use the Item [^] method.
Note: please use <pre> tags round code not <blockquote>
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
Thanks Rich..
added
IDispatch *ppContacts;
hr=pCon->Item(0,&ppContacts);
after that not getting any clue how to proceed further...any help ..i am just blank...
vikas da
|
|
|
|
|
tasumisra wrote: not getting any clue how to proceed further...any help ..i am just blank.
Well I guess you need to iterate through the list from zero to the maximum value as indicated by the Count property.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
i tried that as above...
hr=pCon->Item(0,&ppContacts);
now ppContacts seems to be another interface with all COM predefined methods like Querry interface ,addref release etc.
vikas da
|
|
|
|
|
You really need to spend a lot more time reading the documentation on this interface before trying to implement it.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
Thank you so much Rich.. yes there is a need of going through the documentation.
vikas da
|
|
|
|