|
No, i didn't mean the "options dialog tabs" you mentioned !!!
The correct example is that of "send file or photo" dialog.
Farheen Shah
|
|
|
|
|
Okay, I see the ones you mean know.
This is a pretty simple trick. According to SPY++, these are button controls and not tabs. I'm guessing it's just an ownerdraw bitmap button with maybe use of the RGN GDI stuff to shape the button. I'm sure there must be an article on CodeProject which shows how to do this.
Clicking the buttons must just hide one set of controls and show the others.
Michael
|
|
|
|
|
Hi an need to spy on a text window that is displaying strings. Everytime this window displays new text i need to retrieve the new text and save it to a database in my app. I suppose i need to set up a hook to accomplish this?
I can get a handle to the window and when using Spy+ and when the window is displaying text the only message i can see is WM_PAINT..
How can i get the text beeing displayed in the window? Dont want all text in the window, just the latest string that was displayed.
|
|
|
|
|
This text window is in your process or in some other process?
Tomasz Sowinski -- http://www.shooltz.com ** If you're going to rape, pillage and burn, be sure to do things in that order. **
|
|
|
|
|
It's in a different process, a different application that i don't have the source to...
So im not sure it's possible to do what i want, but maybe i can do it with a hook?
|
|
|
|
|
OK - hook will do.
Tomasz Sowinski -- http://www.shooltz.com ** If you're going to rape, pillage and burn, be sure to do things in that order. **
|
|
|
|
|
Thanks!
I'm not very familiar with hooks tho... do you have some sample code for this?
I do have a sample of a mousehook so i know where to start, but I'm not sure how to set it up so i get the text i want.. what message to spy on...
What type of hook do i need to set with SetwindowsHookEx?
|
|
|
|
|
If you plan to monitor changes in edit box, it's probably best to hook its parent and wait for EN_CHANGE notifications, which are sent through WM_COMMAND.
The hook you need is WH_CALLWNDPROC. Search MSDN for SetWindowsHookEx - there should be some examples.
Tomasz Sowinski -- http://www.shooltz.com ** If you're going to rape, pillage and burn, be sure to do things in that order. **
|
|
|
|
|
How to get the applicatin path of the programm? in MFC and win32
Gaurika Wijerane
|
|
|
|
|
GetCurrentDirectory
or
GetModuleFileName
|
|
|
|
|
CString GetExePath()
{
TCHAR moduleFileName[MAX_PATH+1];
if (0 != GetModuleFileName(NULL, moduleFileName, sizeof(moduleFileName)))
{
PathRemoveFileSpec(moduleFileName);
}
return moduleFileName;
}
passing NULL to GetModuleFileName() retrieves the current module's file name, so call this from the exe rather than a dll linked to the exe. Or pass the exe's HINSTANCE to the call.
|
|
|
|
|
In MFC the easiest way is to use __argv[0]
Tomasz Sowinski -- http://www.shooltz.com ** If you're going to rape, pillage and burn, be sure to do things in that order. **
|
|
|
|
|
//object.h
#ifndef _OBJECT_H
#define _OBJECT_H
template< class A >
class Object
{
public:
Object(){}
virtual ~Object(){}
template< class B >
class Item
{
public:
Item(){}
virtual ~Item(){}
void Item_Func(B& b){}
};
template< class B >
void Func1(Item<B>& item)
{
return;
}
template< class B >
void Func2(Item<B>& item)
{
return;
}
};
#endif
//main.cxx
#include "object.h"
Object<int> object;
void foo()
{
Object<int>::Item<char> item2;
object.Func2( item2 );
}
int main()
{
Object<int>::Item<int> item1;
object.Func1( item1 );
return 0;
}
//Error:
g++ -c -g -o main.o main.cxx
main.cxx: In function `int main()':
main.cxx:16: no matching function for call to `Object<int>::Func1 (Object<int>::Item<int> &)'
make: *** [main.o] Error 1
I'm amumu, and you?
|
|
|
|
|
If I had to guess, I would say that it is because you have declared a class A template parameter in your object class, and class B in the Func1 function. This code compiles fine in VC++ 6.0.
Also, I do not think that there are many people on this forum with experience in g++.
|
|
|
|
|
If I comment the foo(), that's no problem.
I am confused about it, may be it is the bug of g++?
I'm amumu, and you?
|
|
|
|
|
Hi,
I know that if there are several threads share a common array, i need criticalSection to protect to prevent all threads trying to WRITE to this array at the same time.
However, I just wonder if criticalSection is required to prevent all threads trying to just READ the info from this array at the same time.
Thanks!
|
|
|
|
|
It is not required, there is not a problem if everyone is just reading. However if you have some threads reading and other writing then you must protect yourself as well
Best regards,
Alexandru Savescu
|
|
|
|
|
Yes, because if you don't then you run the risk of reading while someone is writing and thus the data might be suspect.
Tim Smith
I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
|
|
|
|
|
#include <iostream.h>
class a
{
public:
a()
{
cout<<"a::a"<<endl;
}
="" ~a()
="" {
="" cout<<"a::~a"<<endl;
="" }
};
class="" b:public="" a
{
private:
="" char*="" ptch;
public:
="" b()
="" cout<<"b::b"<<endl;
="" ptch="new" char[100];
="" ~b()
="" cout<<"b::~b"<<endl;
="" delete="" ptch;
="" }
};
int="" main()
{
="" b*="" ptb="new" b;
="" a*="" pta="ptb;
" pta;
=""
="" return="" 0;
}
and="" how="" about="" this="" one?
#include="" <iostream.h="">
class a
{
public:
a()
{
cout<<"a::a"<
|
|
|
|
|
The first one causes a memory leak because the destructor for class b does not get called. If you make the destructor in class b virtual, then the destructor will get called, and there will be no memory leak.
The second one does not cause a memory leak, because there is no dynamic memory allocation internal to either class.
|
|
|
|
|
I see, Thank you very much!
I'm amumu, and you?
|
|
|
|
|
Yes you need to make the class b destructor virture. The destructor for class b is wrong as well. To avoid memory leak, the class b destructor should be:
virture ~b
{
....
delete []ptch;
}
|
|
|
|
|
'virture'? Is it from Java?
Tomasz Sowinski -- http://www.shooltz.com ** If you're going to rape, pillage and burn, be sure to do things in that order. **
|
|
|
|
|
You have to make a's destructor virtual. Once that is done, B's destructor will also by definition be virtual.
Tim Smith
I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
|
|
|
|
|
Hi
does anyone use the install-shield app which comes with VC 6.0?
Ive been messing about with it today and have a question or two
Bryce
|
|
|
|