|
==================
The original message was:
Hi all,
is it possible in c/c++ to call a function that is created from variables. ..
ex/ CString myFunction
myFunction = "SomeFunction()";
i would like to call the contents of myFunction. don't know if its possible, any insight appreciated
Brain
Brian:
Yes, this is possible.
The function GetGreater will get the greater of the two values passed in...
int GetGreater ( int, int ) ;
typedef int (*GetGreater) (int, int) ; // this declares a ptr to this function.
Then in the code...
{
PGetGreater pgg;
int maxvalue;
pgg = GetGreater;
if ( pgg )
{
maxvalue = pgg ( 5, 3 ) ;
}
}
Or something like that
Peter.
|
|
|
|
|
Hi, I use contiguous range of command IDs and ON_COMMAND_RANGE() in my app. However, the IDs always be renumbered when I add other resource. This phenomenon drives my crazy. I¡¯d appreciate if someone could tell me how to prevent the renumbering. TIA.
|
|
|
|
|
I have a mapi session (logged on using and existing session), and as such, I have not specified the profile name.
Now that I am logged on, I need to know the name of the profile currently in use.
Any help out there?
|
|
|
|
|
Does anyone have any sample code (or know where some is) to put a tab control on a toolbar. Like the ones in 3D Studio Max, or C++ Builder?
Or, does the article here about adding controls to toolbars work?
Thanks,
Frank
|
|
|
|
|
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
|
|
|
|