|
hi everybody
I wanted to work on COM in vc++
But i donot have any resource of com
So anyone can pls give me some document on com so i can learn it
Thanks in Advance
|
|
|
|
|
i am no expert in com but try :
http://www.cs.umd.edu/~pugh/com/
Wamuti: Any man can be an island, but islands to need water around them!
Edmund Burke: No one could make a greater mistake than he who did nothing because he could do only a little.
|
|
|
|
|
Still i am no expert but as you check out the previous also try going to tech tutorials here:
http://www.techtutorials.info/pcom.html
Wamuti: Any man can be an island, but islands to need water around them!
Edmund Burke: No one could make a greater mistake than he who did nothing because he could do only a little.
|
|
|
|
|
tarak Desai wrote: I wanted to work on COM in vc++
Buy Developer workshop to ATL/COM 3.0 book, it will provide beginner to expert level information on com!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You/codeProject$$>
|
|
|
|
|
Hi,
I have noticed two strange when I used the Following Typdef
Typdef struct
{
char a;
int b;
}
looking in memory Using The Visual Studio to Build and Debug
the int "b" takes four bytes
and also seems both a and b start boundry divisible by 4
as there are three slack bytes between a's value and b
IS there maybe a compiler option /Noalign to prevent this
Thankx
|
|
|
|
|
#pragma pack(1)
struct Test {
int a;
char b;
};
#pragma pack()
Maxwell Chen
|
|
|
|
|
The #pargma pack(1) tell the compiler not to align ????
|
|
|
|
|
Have you tried putting #pragma into msdn? then following for pack?
Simple answer is pack(1) tells the compiler to pack on a 1 byte alignment. pop says "go back to what you were doing before".
Iain
Iain Clarke appearing in spite of being begged not to by CPallini.
|
|
|
|
|
|
Hello everyone!
I'm designing a OOP-based system in C++, and I'm having a little problem. Say I have this:
class Class1
{
virtual void Draw(Image *a_pImage);
};
class Class2 : public Class1
{
virtual void Draw(Image *a_pImage);
};
Class1::Draw takes care of ugly low-level stuff, and that's a lot of code. How can Class2::Draw call Class1::Draw so that I don't have to copy-paste all of the code in Class2? In C#, for example, you used base.Draw, but base doesn't exist in C++...
Thanks!
Windows Calculator told me I will die at 28.
|
|
|
|
|
void Class2::Draw(Image *a_pImage)
{
// add extra code for Class2 draw
Class1::Draw(a_pImage);
// add extra code for Class2 draw
}
modified on Friday, February 15, 2008 12:15 AM
|
|
|
|
|
Huh? That easy? I was expecting an extremely long message explaining how to delicately trick C++ into doing what I wanted... Thanks , Rajkumar!
Windows Calculator told me I will die at 28.
|
|
|
|
|
Lord Kixdemp wrote: Huh? That easy?
"One of the difficulties people have with object-oriented design is that it's too simple to get from the beginning to the end. A mind trained to look for complex solutions is often stumped by this simplicity at first" - Bruce Eckel.
|
|
|
|
|
nice quote
|
|
|
|
|
Lord Kixdemp wrote: virtual void Draw(Image *a_pImage);
Class2::Draw() is virtual by default. The virtual keyword is unnecessary.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hello,
I have three applications; A, B and C. A always stays in foreground and has focus. B an C run in background. B receives messages from A via socket. I need B to send Shift/Ctrl/Alt + key to C based on A's messages. I've tried CKeystrokeEngine, and it works some times but not all the time. Is there anything I can do to CKeystrokeEngine and change it's behavior so that it works all the time?
|
|
|
|
|
I just had a look into the CKeystrokeEngine class, it seems it depends on the keybd_event API and depends on the SetForegroundWindow and it is not sure that the window will be the active window to receive the keyboard event as CWindowEngine::FocusWindow() always return true without checking the return value of SetForegroundWindow API. if my assumption is correct B and C no longer be said as background app as it is brought to foreground every time a keystroke is to be send
As the A, B, C all r ur application and ur already communicating using sockets, i would suggest that u use ur own protocol in the same connection and interpret the key strokes, it doesnot require the window to be active foreground window.
|
|
|
|
|
I can't change A or C. B is the only app I am writing and have control over.
|
|
|
|
|
Have you tried PostMessage() with the WM_KEYDOWN message?
|
|
|
|
|
Sh*t/Alt/Ctrl keys can't be sent using postmessage.
|
|
|
|
|
njhy wrote: sh*t/Alt/Ctrl keys can't be sent using postmessage.
Wrong. Those keys can be sent by using PostMessage()
::PostMessage(myHwnd, WM_KEYDOWN, VK_SHIFT, 0);
::PostMessage(myHwnd, WM_KEYUP, VK_SHIFT, 0);
This code will send a shift key press and release event to the window with the handle myHwnd . And similarly you could send just any key press event, even multiple (simultaneous) key press events.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Try it your self. It does not work.
::PosMessage(myWnd, WM_KEYDOWN, VK_F13, 0); // VK_13 is SHIFT + F1
::PosMessage(myWnd, WM_KEYUP, VK_F13, 0);
or
::PosMessage(myWnd, WM_KEYDOWN, VK_SHIFT, 0);
::PosMessage(myWnd, WM_KEYDOWN, VK_F1, 0);
::PosMessage(myWnd, WM_KEYUP, VK_F1, 0);
::PosMessage(myWnd, WM_KEYUP, VK_SHIFT, 0);
|
|
|
|
|
Hmm... I've got it working by executing my code from within a DLL (a hook, to be precise). Neither do I have dev tools on this machine, so I can't test something right now.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
I tried in a hook DLL, but did not work either. Can you post your codes here?
|
|
|
|
|
I'll be happy to share code with you if that would help you. I'll write to you when I am on my Dev machine.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|