|
matijsmoest wrote: : GetWindowText problem
According to MSDN, GetWindowText can't bring text from remote Window control except it title.. you have to use WM_GETTEXT!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
WM_GETTEXT gives me the same result
|
|
|
|
|
The Firefox UI uses their custom-built XUL stuff, not standard windows controls. Sending it window messages probably won't work (unless they reimplemented all the message handling of the corresponding controls, which is doubtful).
|
|
|
|
|
Hi All..
I am working with TabControl, where I created 3 dialog Boxes, in these three one dialog with TabControl, and remaining two dialogs with edit control.
In first Tab-first dialog, Second Tab-second dialog
I had created two dialogs in the OnInitDialog() function .
m_FirstDialog =new CFirstDialog();<br />
HRSRC hResource = FindResource(g_hModule, MAKEINTRESOURCE(IDD_FIRST_DIALOG),RT_DIALOG );<br />
HGLOBAL hTemplate = LoadResource(g_hModule, hResource);<br />
BOOL bResult = m_FirstDialog->CreateIndirect (hTemplate, this);<br />
FreeResource(hTemplate);<br />
m_FirstDialog->ShowWindow (SW_SHOW);
same code fallows for Second Dialog.
Everything is fine but Problem is when I tried to send data from member variable to Control on First , second dialogs.
I am not able to acces the data in editboxes in First, second dialogs from the TabDialog(tabcontrol).
Can you please help me how to find the cause of this problem.
Thanking You.
Sheshidar
|
|
|
|
|
Please suggest available coverage tools that can be integrated with wxDevC++ IDE.
Cheers
Pavan
|
|
|
|
|
Hi all,
I have this piece of code but I didn't write it, and I'm struggling my butt off to understand it ... can anyone help me...
<br />
typdef struct {<br />
uint8_t status;
uint8_t nrclus;
uint16_t tfmtag;
uint16_t recdid;
uint32_t fladdr;
uint8_t *pdbuff;
} TFM_PARAM3;<br />
<br />
typdef struct {<br />
uint8_t status;
uint8_t nrclus;
uint16_t tfmtag;
uint16_t recdid;
uint32_t fladdr;
uint8_t *pdbuff;
void (*app_cb) (TFM_PARAM3 TfmParameters);
} TFM_PARAM2;<br />
<br />
Many thanx...<br />
<br />
Regards
Programm3r
|
|
|
|
|
Programm3r wrote: void (*app_cb) (TFM_PARAM3 TfmParameters);
this declares a pointer to a function which gets a TFM_PARAM3 as a parameter, and returns nothing. this function pointer is called app_cb in your structure.
to use it, you can do this :
void Foo (TFM_PARAM3);
TFM_PARAM2 myStruct;
myStruct.app_cb = &Foo;
|
|
|
|
|
Thanx alot you guys ....
Regards
Programm3r
|
|
|
|
|
toxcct wrote: void Foo (TFM_PARAM3); TFM_PARAM2 myStruct;myStruct = &Foo;
Shouldn't we write:
myStruct.app_cb = &Foo
----------------------
Mayank Thakore
Learning C++ - since 1998
They didn't print my card right; so I resigned.
|
|
|
|
|
Yes, you're correct.
You can also write:
myStruct.app_cb = Foo;
I think that's also in the standard rather than being a common compiler extension.
Kev
|
|
|
|
|
lemur2 wrote: You can also write:
myStruct.app_cb = Foo;
functions have a unique property that their value is their address
i.e. &Foo == Foo
not sure if this is standard... works in VC++
----------------------
Mayank Thakore
Learning C++ - since 1998
They didn't print my card right; so I resigned.
|
|
|
|
|
MayankT wrote: not sure if this is standard... works in VC++
yes it works under microsoft compilers, but not standard. if i remember correctly, the last standard (or the future one) prevents to use the notation without the address operator...
|
|
|
|
|
toxcct wrote: the last standard (or the future one) prevents to use the notation without the address operator...
this is good to remove the slight confusion...
is there something planned for using function pointers as well?
like:
<br />
voif func () {}<br />
<br />
void (*func_ptr) ();<br />
<br />
func_ptr = &func;<br />
<br />
(*func_ptr)();
func_ptr ();
<br />
----------------------
Mayank Thakore
Learning C++ - since 1998
They didn't print my card right; so I resigned.
|
|
|
|
|
i don't know for this, but i personnaly prefer calling a function (even through a function pointer) with the usual syntax.
if you call a function with func_ptr() (even if the name is not that explicit), you can always browse the sources for the declaration of the func_ptr pointer, and then identify it to being a function pointer...
|
|
|
|
|
yes of course, i typed too fast and forgot to apply the .operator to the field of the structure.
thanks for the notice
|
|
|
|
|
Programm3r wrote: void (*app_cb) (TFM_PARAM3 TfmParameters); // THIS PART I DONT UNDERSTAND
Isn't this pointer to a function returning void and taking parameter to type TFM_PARAM3, which is declared above.
|
|
|
|
|
I have no idea .... what why I posted the question....
Regards
Programm3r
|
|
|
|
|
I have defined a template class in a header file like so:
template <class _T> class TCollection {
public:
TCollection();
~TCollection();
Then try to declare the members in the cpp file like so:
TCollection::TCollection() : pData(0) , pCount(0)
{
}
TCollection::~TCollection()
{
clear();
}
Yet I am getting a compiler error
'TCollection' : use of class template requires template argument list
Obviously it cannot be treated like a normal class, so what is the correct way of declaring the members?
|
|
|
|
|
waldermort wrote: template <class _t=""> class TCollection
BTW, what is pData declared like ?
|
|
|
|
|
TCollection<class _T>::TCollection()
That worked, thankyou.
|
|
|
|
|
I tell a lie, it worked for the c'tor and d'tor but not the other members.
This is the header file:
template <class _T> class TCollection {
public:
TCollection();
~TCollection();
_T at(unsigned int iPos);
void add(_T T);
void clear();
int size();
bool empty();
private:
_T* pData;
int pCount;
};
And the cpp file looks something like this:
TCollection<class _T>::TCollection() : pData(0) , pCount(0)
{
}
TCollection<class _T>::~TCollection()
{
clear();
}
_T TCollection<class _T>::at(unsigned int iPos)
{
if (iPos >= 0 && iPos > pCount)
return pData[iPos];
else
return NULL;
}
void TCollection<class _T>::add(_T T)
{
if (pData) {
_T *tmp = new _T [pCount+1];
for (int i=0;i<pCount;i++)
tmp[i] = pData[i];
tmp[i] = T;
delete [] pData;
pData = tmp;
pCount++;
} else {
pData = new _T [1];
pData[0] = T;
pCount++;
}
}
I'm getting error like
E:\Program\foo\TCollection.cpp(18) : error C2027: use of undefined type '_T'<br />
E:\Program\foo\TCollection.cpp(8) : see declaration of '_T'<br />
E:\Program\foo\TCollection.cpp(20) : error C2036: 'class _T *' : unknown size<br />
E:\Program\foo\TCollection.cpp(28) : error C2512: '_T' : no appropriate default constructor available
This is only after a split it into seperate files, it worked in a single file.
|
|
|
|
|
template<class _T>
_T TCollection::at(unsigned int iPos){...}
template<class _T>
void TCollection::add(_T T){...}
|
|
|
|
|
Thanks for your help with this, but I am still getting errors.
template<class _T> _T TCollection::at(unsigned int iPos)
{
...
}
template<class _T> void TCollection::add(_T T)
Results in the first error:
E:\Program\foo\TCollection.cpp(17) : error C2955: 'TCollection' : use of class template requires template argument list<br />
e:\program\foo\tcollection.h(24) : see declaration of 'TCollection'<br />
E:\Program\foo\TCollection.cpp(25) : error C2955: 'TCollection' : use of class template requires template argument list
|
|
|
|
|
template<class _T>
_T TCollection<_T>::at(unsigned int iPos){...}
template<class _T>
void TCollection<_T>::add(_T T) {...}
|
|
|
|
|
Thankyou that worked, but now having problems with the pData pointer. I thought it would be easy to use seperate files. Rather than messing about I have placed the whole thing in the single header file, it's only a small class.
|
|
|
|