|
I have used the class wizard to generate a wrapper class from the type library
of an in process server.
I can access the methods and properties by creating a dispatch like this one for both.
if(((*(COleDispatchDriver*)(&m_IMCSClientEvents))).m_lpDispatch==NULL){ //UCS_MCSSERVER.EXE
if (!(m_IMCSClientEvents.CreateDispatch("MCSObject.MCSObject.1", &oe))) {
But how do I capture the events. Do you create a dispatch for events? If so how do you capture them? I'm confused.
I suspect the answer is use the EVENTSINK_MAP. But that would require an IDC value. Since I am late binding
I do not have an IDC value I am not sure how to use the EVENTSINK_MAP.
Thanks in advance.
|
|
|
|
|
Hi!
As you've already mentioned you can't use the event map in the late binding. You have to implement the event sink and then use one of the functions below to create a connection between an object's connection point and a client's sink:
CComPtr::Advise(...) - using smart pointers
AtlAdvise(...) - using ATL
IConnectionPoint::Advise(...) - generic interface method
And of course you have to Unadvise when you are done with the object.
Regards,
Alex Gorev,
Dundas Software.
==================
The original message was:
I have used the class wizard to generate a wrapper class from the type library of an in process server.
I can access the methods and properties by creating a dispatch like this one for both.
if(((*(COleDispatchDriver*)(&m_IMCSClientEvents))).m_lpDispatch==NULL){ //UCS_MCSSERVER.EXE if (!(m_IMCSClientEvents.CreateDispatch("MCSObject.MCSObject.1", &oe))) {
But how do I capture the events. Do you create a dispatch for events? If so how do you capture them? I'm confused.
I suspect the answer is use the EVENTSINK_MAP. But that would require an IDC value. Since I am late binding I do not have an IDC value I am not sure how to use the EVENTSINK_MAP.
Thanks in advance.
|
|
|
|
|
Thanks Alex. I appreciate it.
==================
The original message was:
Hi!
As you've already mentioned you can't use the event map in the late binding. You have to implement the event sink and then use one of the functions below to create a connection between an object's connection point and a client's sink:
CComPtr::Advise(...) - using smart pointers
AtlAdvise(...) - using ATL
IConnectionPoint::Advise(...) - generic interface method
And of course you have to Unadvise when you are done with the object.
Regards, Alex Gorev, Dundas Software.
================== The original message was:
I have used the class wizard to generate a wrapper class from the type library of an in process server.
I can access the methods and properties by creating a dispatch like this one for both.
if(((*(COleDispatchDriver*)(&m_IMCSClientEvents))).m_lpDispatch==NULL){ //UCS_MCSSERVER.EXE if (!(m_IMCSClientEvents.CreateDispatch("MCSObject.MCSObject.1", &oe))) {
But how do I capture the events. Do you create a dispatch for events? If so how do you capture them? I'm confused.
I suspect the answer is use the EVENTSINK_MAP. But that would require an IDC value. Since I am late binding I do not have an IDC value I am not sure how to use the EVENTSINK_MAP.
Thanks in advance.
|
|
|
|
|
It's me again...
You also can have a look on the very nice article in MSDN:
"HOWTO: Create a Sink Interface in MFC-Based COM Client"
Article ID: Q181845
Alex Gorev,
Dundas Software.
==================
The original message was:
I have used the class wizard to generate a wrapper class from the type library of an in process server.
I can access the methods and properties by creating a dispatch like this one for both.
if(((*(COleDispatchDriver*)(&m_IMCSClientEvents))).m_lpDispatch==NULL){ //UCS_MCSSERVER.EXE if (!(m_IMCSClientEvents.CreateDispatch("MCSObject.MCSObject.1", &oe))) {
But how do I capture the events. Do you create a dispatch for events? If so how do you capture them? I'm confused.
I suspect the answer is use the EVENTSINK_MAP. But that would require an IDC value. Since I am late binding I do not have an IDC value I am not sure how to use the EVENTSINK_MAP.
Thanks in advance.
|
|
|
|
|
How should I properly close down a child window in an MDI application in OnInitialUpdate()? I've tried using GetParent()->SendMessage( WM_CLOSE ), and WM_DESTROY to no avail. WM_CLOSE doesn't seem to do anything to the window, and WM_DESTROY generates an exception in the MFC framework somewhere. Are there any other suggestions that I might try to get this to work?
|
|
|
|
|
Hi,
I'm just guessing. Have you tried WM_MDIDESTROY instead of WM_DESTROY?
Martin
|
|
|
|
|
Hi,
I have one application that every time that needs to draw calls a thread to do it ( it has a very sllow drawing proccess some graphical sh*ts...).
The problem that I have is..., How can I know what is the invalidated portion ? ( now when I call the thread it repaints all and it's very slow, I would like to know if it is only a portion of a window to redraw...), Is anyway to know this ?
Thanks, Bye !
Braulio
|
|
|
|
|
check out CDC::GetClipBox
Chris
==================
The original message was:
Hi,
I have one application that every time that needs to draw calls a thread to do it ( it has a very sllow drawing proccess some graphical sh*ts...).
The problem that I have is..., How can I know what is the invalidated portion ? ( now when I call the thread it repaints all and it's very slow, I would like to know if it is only a portion of a window to redraw...), Is anyway to know this ?
Thanks, Bye ! Braulio
|
|
|
|
|
Hi, where I can find a GUI toolkit to build graphical GUI like Winamp (non-rectangular dialog, bitmap)
Thanks
|
|
|
|
|
Hi,
It is pretty easy to display a non-rectangular window by using SetWindowRgn() function. The painting of the background of any window using a bitmap is a bit more difficult as long as you would probably need to work with DIBs (Device Independent Bimap) but shouldn't be that big of a deal. As for the GUI toolkit you might take look at the Dundas (www.dundas.com) Ultimate Toolbox (it has classes that handle irregular shaped windows and background painting). or you might try to find some free classes on this site that will help you to solve your problem
Regards,
Andrei Zenkovitch
==================
The original message was:
Hi, where I can find a GUI toolkit to build graphical GUI like Winamp (non-rectangular dialog, bitmap)
Thanks
|
|
|
|
|
There are a couple a shareware programs designed just for this. I believe nullsoft, the makers of winamp, used one of them for their product. One product is called ActiveSkin and it looks like the one of choice. The second product, and the one I believe nullsoft used escapes me right now. I remember doing a search for skins and coming across a site that claimed to make the product of choice for nullsoft. I will look into it and get back to you. However once again, the ActiveSkin product was newer, more impressive, and less expensive. The product of choice.
==================
The original message was:
Hi, where I can find a GUI toolkit to build graphical GUI like Winamp (non-rectangular dialog, bitmap)
Thanks
|
|
|
|
|
Check out www.freeamp.org for the source to a winamp clone has exactly what you want.
==================
The original message was:
Hi, where I can find a GUI toolkit to build graphical GUI like Winamp (non-rectangular dialog, bitmap)
Thanks
|
|
|
|
|
How to kill a running Screensaver under Windows 2000? And how to kill a third party screensaver under Win9x?
Thanks for your tips
|
|
|
|
|
hello,
Can any has code that tells how to use ADO without #import directive?? I am trying to use because you have to hard code path or ado15.dll in ado. here is my code but CoCreateInstance failed. I am initializinf COM, importing ADO header files, and liniking ado lib file.
*************************
ADOConnection* pAdoConnection;
HRESULT hr;
// Create instances of ADOConnection
hr = CoCreateInstance(CLSID_CADOConnection, NULL, CLSCTX_INPROC_SERVER, IID_IADOConnection, reinterpret_cast<void**>(&pAdoConnection) );
if ( FAILED(hr) )
{
AfxMessageBox("CreateInstance failed!");
return;
}
// Call ADOConnection's Open method to connect to a database
hr = pAdoConnection->Open((BSTR)"Kruse", (BSTR)"", (BSTR)"", -1);
if ( ! FAILED(hr) )
{
AfxMessageBox("open failed");
return;
}
***************************
thanks in advance
mahesh
|
|
|
|
|
Hello,
I have written a dll in VB and I would like to use it in my C++ App. I would like to know how to generate from the dll a matching headerfile.
TIA
Matthias
|
|
|
|
|
Q: how to keep my application from being listed in the task manager and/or the task bar?
I think this is a relatively common need, but I can't find where it's documented.
Secondly, how can I force a child process of mine (with its own top level window) to be hidden from the task manager? I am not able to alter source-code for this process. Am I up a creek here?
Thanks in advance!
Nick Hodapp
|
|
|
|
|
http://www.codeproject.com/docview/notaskbaricon.asp
==================
The original message was:
Q: how to keep my application from being listed in the task manager and/or the task bar?
I think this is a relatively common need, but I can't find where it's documented.
Secondly, how can I force a child process of mine (with its own top level window) to be hidden from the task manager? I am not able to alter source-code for this process. Am I up a creek here?
Thanks in advance!
Nick Hodapp
|
|
|
|
|
I have a tab control that contains child dialogs. I have been able to add the dialogs OK, and they show up, but when I press Enter or Escape (both mapped to default buttons on the dialog), all of my controls disappear. I have heard that I may have to override EndDialog, since this is probably being called, but I was wondering if anyone else has a better solution. I don't want to use Property Sheets, and I know this can be done with dialogs. Any help would be greatly appreciated.
|
|
|
|
|
look this code:
BOOL CYouChildDlg::PreTranslateMessage(MSG* pMsg)
{
// TODO: Add your specialized code here and/or call the base class
BOOL bHandledMsg = FALSE;
switch (pMsg->message)
{
case WM_KEYDOWN:
{
switch (pMsg->wParam)
{
// hitting escape while searching for password edits
// should only stop the search for password edits and
// not kill app
case VK_ESCAPE:
bHandledMsg = TRUE;
break;
case VK_RETURN :
bHandledMsg = TRUE;
break;
default: break;
} // switch (pMsg->wParam)
}
break;
default: break;
} // switch (pMsg->message)
return (bHandledMsg ? TRUE : CDialog::PreTranslateMessage(pMsg));
}
|
|
|
|
|
I have implemented gradient filled text by using the CDC functions BeginPath(), EndPath() and SelectClipPath(). This works, but the characters are jagged. Any ideas on how to achieve antialised characters?
|
|
|
|
|
hi, gang
Does anybody know how to drag an item from a combobox and drop it in a CChildFrame derived class (CView)?
thanks in advance
Michael Ang
|
|
|
|
|
I Need help..
I am development a program that you can use to view big log-files, in size about 10MB.
I have to use MFC, but I prefer Win32 API.
In Win32, I already solved the problem.
I use memory-mapped files to store the file in virtual memory, but I want to read directly from the file..?? Now I read the file to a String and then mapping it. Then a use Pointer to show the text in a window and that is my second problem. I get the String in one single line (no return). In Win32, I used to send the String with a SendMessage to the hWnd window. The third problem is with scrolling windows. In Win32 I only create a child window with WS_VSCROLL | WS_HSCROLL and then no problem..........
I get mad about MFC you do not have it under control....
I think that more people have same problem as me.
I really need some code-examples how to manage memory-mapping, scrolling and text.
Thank you..
|
|
|
|
|
Hello all,
I have a strange problem relating to ISupportErrorInfo. I have a component implemented as a collection class. This class is created as an MTS component and I added the _NewEnum, Item and Count properties to it, so I can use it as a collection. This all goes well. But now I added the ISupportErrorInfo interface. When something doesn't go as I want I do
[ccode]
return Error( L"My Message", IID_IMyInterface, E_FAIL);
[/ccode]
so I can see the error in a VB client with the Err object. But strange thing is that this only works with late binding, not with early binding. So if I declare a variable with
[ccode]
Dim obj as OBject
[/ccode]
I can see the error with err.description, but when I declare it with
[ccode]
Dim Obj as MyInterface
[/ccode]
it doesn't work that way and the Err.description simply tells me that "method 'SomeMethod' of component 'MyInterface' fails"!!!!!
Anybody has a clue what I could have done wrong? I use NT ws4 sp6 and VS6 sp3
TIA
Henk
|
|
|
|
|
Hi!
I've tried to create a simple ATL object using VC6 wizard, which supports ISupportErrorInfo. Then I added the method, which returns an error the same way as you, and then I tried both ways of using the object in VB - no any problems!
You can follow my steps and try to create a simple object and then test it...
Regards,
Alex Gorev,
Dundas Software.
==================
The original message was:
Hello all,
I have a strange problem relating to ISupportErrorInfo. I have a component implemented as a collection class. This class is created as an MTS component and I added the _NewEnum, Item and Count properties to it, so I can use it as a collection. This all goes well. But now I added the ISupportErrorInfo interface. When something doesn't go as I want I do [ccode] return Error( L"My Message", IID_IMyInterface, E_FAIL); [/ccode] so I can see the error in a VB client with the Err object. But strange thing is that this only works with late binding, not with early binding. So if I declare a variable with [ccode] Dim obj as OBject [/ccode] I can see the error with err.description, but when I declare it with [ccode] Dim Obj as MyInterface [/ccode] it doesn't work that way and the Err.description simply tells me that "method 'SomeMethod' of component 'MyInterface' fails"!!!!!
Anybody has a clue what I could have done wrong? I use NT ws4 sp6 and VS6 sp3
TIA Henk
|
|
|
|
|
Merry Christmas,
Hi, a I have a Dialog Based application. The default window class is #32770 (Dialog).
I have tried to handle the PreCreateWindow and CreateWindow virtual functions, but they are never called.
Do anybody know what is the problem?
Thank You
Alejandro Calvo
|
|
|
|