|
Thanks a lot.
|
|
|
|
|
Hanan888 wrote: wchar_t wchar_t text[256] = "thank god";
Why the 256? Use this instead:
wchar_t text[] = "thank god";
Why waste 492 bytes?
Hanan888 wrote: size_t length = wcslen(text);
If the above change is made this runtime call call be changed to a compile time calculation as follows:
size_t length = sizeof(text)/sizeof(text[0]) - 1;
Steve
|
|
|
|
|
|
Hi,
Can anybody tell some information about API hooking on 64-bit. I have tried Detours Express 2.1 for 32-bit. There is Detours Professional 2.1 which supports 64-bit but it is not free. So can anybody know any other library or some references to create it.
Thanks.
|
|
|
|
|
Hello
I would like to draw in a Richedit or other control. I have tried to get a DC for the control and just change the background color to start with using
CDC *dc = m_bargraph_redit.GetDC;
dc->SetBkColor(RGB(0,255,0));
this does not work. Could somebody help me get started.
I am painting directly on to the background on my GUI to draw a bargraph this works OK until the screen resolution is changed. I would like to have the bargraph stay in the same place when the screen resolution changes.
Thank in anticipation
Desmond Mardle
|
|
|
|
|
Why do you wish to draw on top of a rich edit control? When you talk about changing the "background color" do you want to change the background color of the control or the background color of the text within the control? SetBkColor does the latter and if that didn't work that's probably because the richedit's rendering code sets it back to what it wants, which is why directly drawing on to the DC of another window is typically a bad idea.
If you want to do this then you'd have to subclass the richedit control. There are many articles here[^] that talk about customizing rich edit.
As for handling display resolution changes, see WM_DISPLAYCHANGE[^]
--
gleat
http://blogorama.nerdworks.in[ ^]
-- Number Two's eyes narrowed and became what are known in the Shouting and Killing People trade as cold slits, the idea presumably being to give your opponent the impression that you have lost your glasses or are having difficulty keeping awake. Why this is frightening is an, as yet, unresolved problem. -- HHGTG
|
|
|
|
|
hi
What is the difference between static_cast and dynamic_cast ?
When we are using these two function?
*****THANKS N ADVANCE****
Mathen.K
(I WILL TRY MY LEVEL BEST )
|
|
|
|
|
Please read C++ books.
Maxwell Chen
|
|
|
|
|
Here[^] is a very good article about the different C++ cast operators.
|
|
|
|
|
For instance, they have different pages on MSDN Visual C++ Language Reference :
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
You have to admit that it isn't easy to find this information.
Not everyone knows that when you need the help of static_cast you need the c36yw7x9(VS.80).aspx page and for the dynamic_cast yoe need the cby9kycs(VS.80).aspx
codito ergo sum
|
|
|
|
|
It's called cryptographic help.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
hi!
i have this particular code that is running correctly on XP but not in Vista due to elevation error. i'm a newbie on com and i just couldnt figure out how to to apply UAC elevation on calling the below code..
CoInitialize(NULL);
INetConnectionManager *pNetConnectionManager = NULL;
HRESULT hr = CoCreateInstance(CLSID_ConnectionManager,
NULL,
CLSCTX_LOCAL_SERVER | CLSCTX_NO_CODE_DOWNLOAD,
IID_INetConnectionManager,
reinterpret_cast<lpvoid *="">(&pNetConnectionManager)
);
Note: hr always return fail due to elevation error. it'll help me a lot to get some feedbacks on what i missed. thanks
about C++ and MFC
|
|
|
|
|
You don't get the failure code when you run the app under elevation? Also, I am a bit curious about this INetConnectionManager interface. What kind of component interface is this? It may have something to do with what this component does during initialization. Instantiating a component per se should not require elevation.
--
gleat
http://blogorama.nerdworks.in[ ^]
-- Number Two's eyes narrowed and became what are known in the Shouting and Killing People trade as cold slits, the idea presumably being to give your opponent the impression that you have lost your glasses or are having difficulty keeping awake. Why this is frightening is an, as yet, unresolved problem. -- HHGTG
|
|
|
|
|
Hi !
I've to retrieve and change desktop items position in a C++ program.
I can't use MFC/ATL technology, I've to use COM API and simple Win32 API.
For the moment, I use the remote process memory operations to work, but it should not work in some circumstances.
I've heard it could be done by using the Shell API, by querying a IFolderView/IShellView interface from the desktop namespace.
I tried it from SHGetDesktopFolder to get the IShellFolder interface, but I can't go further.
When I try to query the IShellView interface, I get the error "Not Implemented".
Could you tell me how to do or link me some tutorials about Desktop Shell programming.
In brief, I've to use C++ "pure" COM Shell Programming to get and change desktop items position, like if the user was dragging them.
Thanks for answers.
Tom
|
|
|
|
|
Good morning (in this side of the world),
Can a copy constructor be used by a method inside the object that wants to be copied??
class Cobj{
...
Cobj(const Cobj &);
void MyFunc();
};
void Cobj::MyFunc()
{
Cobj NewObj(????) ;
}
|
|
|
|
|
piul wrote: (in this side of the world),
piul wrote: Can a copy constructor be used by a method inside the object that wants to be copied??
Yes.
piul wrote: void Cobj::MyFunc()
{
//Can I use the copy constructor here to make a copy of this object???
Cobj NewObj(????) ;
// What do you put in the parameters?? the pointer 'this' can't be used because it's a pointer
// not a 'const Cobj &'
}
the parameter should be *this (i.e. Cobj NewObj(*this); ) you can use *this whenever a reference to this object is needed.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
Of course!! ... oh man... my brain must be in the other side of the world...
Thanks!!
|
|
|
|
|
Hi I am trying to enable the maximixe item in system menu.
Here is the code what I am trying.
CMenu *pSystemMenu = m_pMainWnd->GetSystemMenu(false);
if( pSystemMenu != NULL )
{
pSystemMenu->EnableMenuItem(SC_MAXIMIZE,MF_ENABLED);
}
But It i not getting enabled.
Should I havwe to do anyting more?
With Reagards
Vikas
|
|
|
|
|
Try this:
CWnd *pWnd = AfxGetApp()->m_pMainWnd;
if( pWnd->GetStyle() & WS_MAXIMIZEBOX )
pWnd->ModifyStyle( WS_MAXIMIZEBOX, 0 );
else
pWnd->ModifyStyle( 0, WS_MAXIMIZEBOX );
pWnd->RedrawWindow(NULL, NULL, RDW_FRAME | RDW_INVALIDATE | RDW_UPDATENOW );
--
gleat
http://blogorama.nerdworks.in[ ^]
-- Number Two's eyes narrowed and became what are known in the Shouting and Killing People trade as cold slits, the idea presumably being to give your opponent the impression that you have lost your glasses or are having difficulty keeping awake. Why this is frightening is an, as yet, unresolved problem. -- HHGTG
|
|
|
|
|
So I how do I Resize all the controls in my mainWindow to be proportionate with the size of the mainWindow?
With Reagards
Vikas
|
|
|
|
|
Here are a few options:
- Write the code yourself
- Google for a solution
- Post what you have already done here and indicate what you are having trouble with
And while you're at it, saying "please" and "thank you" is probably a good idea!
--
gleat
http://blogorama.nerdworks.in[ ^]
-- Number Two's eyes narrowed and became what are known in the Shouting and Killing People trade as cold slits, the idea presumably being to give your opponent the impression that you have lost your glasses or are having difficulty keeping awake. Why this is frightening is an, as yet, unresolved problem. -- HHGTG
|
|
|
|
|
Okies Dude! Thanx!
With Reagards
Vikas
|
|
|
|
|
For real time application (Back End Exe and no GUI) which require interaction with Oracle, mathematical computations and use of multithreading also, which application will give better performance (exe executions time and memory management) VC++ / C#? And why?
xyz
|
|
|
|
|
The one you know better.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|