But QString::fromAscii is a Static Public Members from Qt : QString Class Reference I thought I just had to replace CMember by QString and Target by fromAscii from the MS sample...
jeff6
Posts
-
error C2059: syntax error: '<tag>::*' -
error C2059: syntax error: '<tag>::*'Hello, I'm trying to adapt some Microsoft code (member.cpp in Detours) for my case ( I just want to replace void CMember::Target(void) by QString QString::fromAscii(const char *str, int size): MS Code :
class CMember
{
public:
void Target(void);
};void CMember::Target(void)
{
printf(" CMember::Target! (this:%p)\n", this);
}//////////////////////////////////////////////////////////////// Detour Class.
//
class CDetour /* add ": public CMember" to enable access to member variables... */
{
public:
void Mine_Target(void);
static void (CDetour::* Real_Target)(void);// Class shouldn't have any member variables or virtual functions.
};
void CDetour::Mine_Target(void)
{
printf(" CDetour::Mine_Target! (this:%p)\n", this);
(this->*Real_Target)();
}void (CDetour::* CDetour::Real_Target)(void) = (void (CDetour::*)(void))&CMember::Target;
My code :
class CDetour /* add ": public CMember" to enable access to member variables... */
{
public:
QString Mine_Target(const char *str, int size);
static QString (CDetour::* Real_Target)(const char *str, int size);// Class shouldn't have any member variables or virtual functions.
};
QString CDetour::Mine_Target(const char *str, int size)
{
printf(" CDetour::Mine_Target! (this:%p)\n", this);
(this->*Real_Target)(str, size);
}QString (CDetour::* CDetour::Real_Target)(const char *str, int size) = (CDetour::*)(const char *str, int size)&QString::fromAscii;
But I get : error C2059: syntax error: '< tag >::*' for the last line Why ?! Thanks. Edit : If I do :
QString (CDetour::* CDetour::Real_Target)(const char *str, int size) = (QString(CDetour::*)(const char *str, int size))&QString::fromAscii;
I get : error C2440: 'type cast' : impossible to convert from 'QString (__cdecl *)(const char *,int)' into 'QString (__thiscall CDetour::* )(const char *,int)'
-
""Object reference not set to an instance of an object" when creating new project with VSBut it appeared just recently, it had worked for years before
-
""Object reference not set to an instance of an object" when creating new project with VSHello, I get this error when I try to create a new project wi h Visual Studio 2010 (XP), Win32, MFC or Forms (only VB works) "Object reference not set to an instance of an object" I found nothing with Google for this case (just creating a new project) and tried to uninstall/install, repair, n times, impossible to fix :-( Thanks in advance for any idea, I'm desperate, unable to create even an empty Win32 project !
-
Detours : how to hook QT applications ?Finally, I was wrong : I found an easier way. I just create a Qt DLL that I inject in the destination process, then I get the QWidget* from the main hWnd and I can enumerate all children from there and do what I want on any Qt pseudo-control Thanks for answers.
-
Detours : how to hook QT applications ?The functions are correctly exported from QtGui4.dll : bool QPushButton::event(class QEvent *) Tools like "Auto Debug Pro" can hook them. So it is certainly possible to hook them with Detours. (there is no other way to do what I'm trying to do (interact with Qt pseudo-buttons, drawn by Qt with memory instructions, from its source code))
-
Detours : how to hook QT applications ?Hello, with Detours, one can hook any api call. In the sample "wrotei.cpp", COM interfaces can be hooked : " CreateStreamOnHGlobal(NULL, TRUE, &pStream); //... RealIStreamWrite = pStream->lpVtbl->Write; //... " But is it possible to hook QT ? Because in QT source code, there is no interfaces, just classes for example, could it be possible to hook QPushButton::event() ? : bool QPushButton::event(QEvent *e) { // code return QAbstractButton::event(e); } Thanks.
-
Where is IACLCustomMRU declared ?Find what ?! There is nothing in MSDN doc about declarations, include files, IID_IACLCustomMRU constant, etc ...
-
Where is IACLCustomMRU declared ?Hello, I cannot find IACLCustomMRU in any header. Same thing for associated constant : IID_IACLCustomMRU Thanks in advance.
-
Simple chat across internet without serverHello, I would want to write a small chat program allowing to communicate across the Net. But I only found classic Winsock samples with 1 server/clients, where clients need an ip address to connect with the server. Isn't it possible to have only clients (which would probably be also servers for others clients) ? (if I just have 2 executables on 2 different PCs, I cannot know the ip of the other client exe) Thanks.
-
Find sub-urlHi, I have an URL like http://my.lotro.com/home[^] Is it possible to find sub-urls like http://my.lotro.com/home/character/4368675/150026162587528896[^] ? (similar to FindFirstFile(), ...) (web spiders find them for example) Thanks.
-
Prevent Windows From Entering Hibernate ModeJuts disable it by schemes code had been posted many times on pro win32 group
news://nntp.aioe.org/comp.os.ms-windows.programmer.win32
or http://tinyurl.com/cmhb5g by Google -
Is there any way to SendMessage to a Button controlNO. Just send BM_CLICK (!)
-
how to convert images through C++You don't need any library Just use Shell apis (1 line of code to convert any format into any other format)