|
I used GdiGetBatchLimit in my program, it returns 20.
Does it mean 20 proper functions (which return BOOL) will be queued?
But test shows that functions like Rectangel, Ellipse, etc are not queued, and take effect immediately. Why?
-- modified at 5:20 Wednesday 31st October, 2007
|
|
|
|
|
How to modify private member variable of any class without using member function???
Is it possible? If Yes, How???
ThankXXXXXXXXXxx
|
|
|
|
|
You mean, from an external class ? What would be the use of private, protected and public keywords then ?
What are you trying to do ?
|
|
|
|
|
Thanks for your kind reply.
Ya then there is no meaning of private access specifier but i heard abt it that though it is violation of object oriented concepts but still it is possible in C++ using pointers.
I am not trying to do anything great but just trying it out and i believe it is possible.
-- modified at 4:59 Wednesday 31st October, 2007
|
|
|
|
|
If that class declares your function or class as a friend, then you can access.
I think you are asking not for that. If so you just cast the class object to BYTE* and you can access the memory. Or, if you are aware the class structure then you can create a dummy class with all the member variables as public and can cast the actual object to that of this dummy class. Thus you can access the members.
- NS -
|
|
|
|
|
Ya i got it, without using friend function,i did it..
i used typecasted it to char*
thanKXXXXXXXXXXx
|
|
|
|
|
Have a nice crack day...
- NS -
|
|
|
|
|
|
It may be compiler dependent, however, you can calculate the memeber address first, and access it directly (not through the object, do something like writing memory).;)
|
|
|
|
|
ThankXXXXXXXXXXx
Yes..i do not know it is compiler dependent or not,but using ur second suggestion it is possible..
ThankXXXXXXXXx a lot.
|
|
|
|
|
Here is a dirty trick to do so:
class ClassProtected
{
private:
int m_One;
UINT m_Two;
int m_Three;
};
class ClassPublic
{
public:
int m_One;
UINT m_Two;
int m_Three;
};
ClassProtected test;<br />
ClassPublic* pTest = (ClassPublic*) &test;<br />
pTest->m_One = 1;<br />
pTest->m_Two = 2;<br />
pTest->m_Three = 3;
|
|
|
|
|
I think it's a better way.
|
|
|
|
|
Usually, you souldn't.
Anyway, you can modify a class private member variable inside a friend function (or friend operator , or a method of a friend class ).
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.
|
|
|
|
|
Hi all,
suppose i have two projects both the projects have their seperate dsw and dsp files now i want to merge both of these projects and to combine their dsw files and make them one and both exe's should be created in one common debug folder. Is this possible in already created two dsw projects and if not how to create a new project like this??
thanks in advance
|
|
|
|
|
In one of your workspace, you can add an existing project. I think this is the best way to do it. I cannot tell you exactly what you need to do (don't have VC6 installed) but try to go to the explorer view and right click on the workspace, you should be able to add an existing project.
Just start from one of the two workspace, and add the other project (dsp) to it. You then need to configure the project properties (of both projects) so that the output folder is the same for both of them.
|
|
|
|
|
Thank you you were correct my problem is solved. Can you please tell me anything about child and parent exe calling.
|
|
|
|
|
neha.agarwal27 wrote: Can you please tell me anything about child and parent exe calling.
Uuh ? What do you mean ?
|
|
|
|
|
??
Do you mean calling one exe in another exe??
|
|
|
|
|
ya i mean that only but my second exe will be compiled with my first exe only by saying this i mean my second exe will not be residing anywhere on my disk.
|
|
|
|
|
can anybody tell me how to capture the enter key event from the keyboard.
Thank in advance
|
|
|
|
|
See PreTranslateMessage also you can use of WM_KEYDOWN/UP.
|
|
|
|
|
See here[^].
Real men drive manual transmission
|
|
|
|
|
Use the WM_KEYDOWN / WM_KEYUP and compare the parameter/variable nChar (contains info about which one was pressed).
Then compare it with an if if you just want to check once, or a switch if you want to differenciate more cases. Some possibilities are: VK_HOME, VK_END, VK_UP, VK_DOWN, ..., VK_PRIOR, ..., VK_ESCAPE, VK_ENTER... and so on, the complete list is in your docu and in MSDN.
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
Of course if you have a control on the form then all focus send to that control.
|
|
|
|
|
i tried like this
if(::GetKeystate(VK_ENTER<0)
{
mESSAGE
}
ELSE
{
MESSAGE
}
it is showing that vk_enter is undeclared where as it was working properly with vk_control,vk_shift etc
|
|
|
|