|
An event is something that happens. You can have functions that respond to those events, however.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"We will be known forever by the tracks we leave." - Native American Proverb
|
|
|
|
|
If you mean "events" as a callback interface in COM, this is no different from other interfaces, i.e. all methods return a HRESULT.
If you mean "events" as an ActiveX source interface, the function can return any type that is compatible with automation and can be represented within a VARIANT.
If you mean "event" as a message, since windows is event-driven, all message handlers return a LRESULT.
Have I missed some interpretation of "event"?
Hope this helps
--
Roger
It's suppose to be hard, otherwise anybody could do it!
|
|
|
|
|
Roger Stoltz wrote: If you mean "events" as a callback interface in COM, this is no different from other interfaces, i.e. all methods return a HRESULT.
Exactly what I mean. Can you tell me what is the VARIANT equivalent of HRESULT and also the VARIANT equivalent of BSTR ?
Thanks...
---
With best regards,
A Manchester United Fan
The Genius of a true fool is that he can mess up a foolproof plan!
|
|
|
|
|
Regarding HRESULT:
You won't need it since HRESULT is usually only needed as a return type for methods defined in interfaces that are not dispatch interfaces, i.e. doesn't inherit from IDispatch.
HRESULT cannot be represented within a VARIANT, there's no need.
Regarding VARIANT:
This is a union used to represent different data types such as short, BSTR and many more. Look it up in MSDN.
To be able to know which data type it represents, there is a member in the VARAINT struct called "vt" which is a bitfield.
Regarding BSTR in VARIANTs:
The easiest way to do this is to use the MFC implementation of the VARIANT structure/union, COleVariant. One its constructors takes an LPCTSTR as argument which will make the internal VARIANT hold a BSTR.
If you like to use the raw VARIANT type, you set the "vt" member equal to VT_BSTR and set the pbstr member equal to the return value of CString::AllocSysString().
Hope this helps
--
Roger
It's suppose to be hard, otherwise anybody could do it!
|
|
|
|
|
Hi,
I want know how to add contents to Help Document .
Can anyone please tell me how to add pictures and documentation notes to project Help File [F1] under different topics.
Regards,
Parichay B.P
|
|
|
|
|
hi,
i want to display a message when i doubleclick the RichEditBox control.there is a message called NM_DBLCLK but iam unable to use that.please help me.
sathish
|
|
|
|
|
|
Hi........
it show error login failure.
CrystalDecisions.CrystalReports.Engine.LogOnException: Logon failed.
i didnt yet use crystal report.
i download the demo code and run.
where i fill this , how i know which table field r used for filling report?
i change only
crReportDocument.SetDatabaseLogon("sa", "sa", "user","analysis")
help me plz
with regards
sumi
reply soon
|
|
|
|
|
COleDateTime is an MFC class so you can not use it in an IDL file. Use a DATE* instead.
Steve
|
|
|
|
|
Hello
Recently I have been disturbed by the window message "WM_GETTEXT" and the function GetWindowText(). By sending message "WM_GETTEXT" I can get the content of the edit control in the other process while failed by using "GetWindowText".
I can not find any difference between sending "WM_GETTEXT" and using "GetWindowText()".
Can you tell me why
wanglei
|
|
|
|
|
MFC objects (at least CWnd objects) cannot be used across separate threads, that's why it doesn't work.
|
|
|
|
|
While GetWindowText() does send a WM_GETTEXT message, it does so only if the window belongs to the current process. If the window belongs to a different process and has a caption, GetWindowText() retrieves the window caption text. If the window does not have a caption, the return value is a null string. This is all spelled out in the documentation.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"We will be known forever by the tracks we leave." - Native American Proverb
|
|
|
|
|
Consider a MFC MDI prog,
when you maximize a childframe,you will see three icons(minimize,maximize and close) on the right side of the menu.I Want to know,how to draw icon on the right side of menu except menu bar?
besides,how can I make the three icon not visiable?
|
|
|
|
|
WillTian wrote: how can I make the three icon not visiable?
Change the style in
BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
or
BOOL CChildFrame::PreCreateWindow(CREATESTRUCT& cs)
Es:
BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)<br />
{<br />
if( !CMDIFrameWnd::PreCreateWindow(cs) )<br />
return FALSE;<br />
cs.style = WS_OVERLAPPED | WS_CAPTION | FWS_ADDTOTITLE<br />
| WS_THICKFRAME | WS_SYSMENU;<br />
<br />
return TRUE;<br />
}
cuts minimize and maximize buttons.
Sorry but I don't know how to add more buttons or how cut the close button.
|
|
|
|
|
thanks,reset cs.style WS_CAPTION cut the close button
drawing a button is also an easy job,use CWnd::Create() to do so,but I don't know how to draw on the right side of menu,I can't retrive the RECT position.
Neither MainFrame nor ChildFrame contains the menu area.
CMenu is derived from CObject but CWnd.
|
|
|
|
|
how to know the app's name which is sending or receiving data packages in the network.
i know using the DDK can work,but i do not know how to use it
who can give me some idea.
Thanks
hi
|
|
|
|
|
Hi,
With the available video(avi) i want to display text at the bottom(like subtitles). Can some one gimme a good start up by suggesting the interfaces to be used or if any sample code available.
JK
|
|
|
|
|
Look at the DirectShow samples from the latest Platform SDK (The project files are missing though - so if you want them get the DirectX Feb 2005 SDK Extras). There are a few ways to go about doing this depending on what sort of flexibility that you need. You could create your own subtitle filter and connect it to a VMR7/9 filter (with another connection to your video), you could connect to the overlay filter with the old video renderer. Your subtitle filter could perform the mixing itself (VSFilter does this) but that means you'd have to support a variety of input/output colorspaces.
|
|
|
|
|
Hi,
Hope someone can help me with this.
I want to identify a specific OLE DB error and display an error message that my users can understand.
The way it is displayed right now is like this:
Source:"Microsoft OLE DB Provider for SQL Server"
Description:"Maximum stored procedure, function, trigger, or view nesting level exceeded (limit 32)."
hr = 0x80040e14
The hr should be equal to DB_E_ERRORSINCOMMAND, but this error code is used for other errors as well.
How can I identify that it is the "Maximum stored procedure, function, trigger, or view nesting level exceeded (limit 32)" message that is displyed? I'd really like to change it to something that my users can understand. But I can't find anything to go on, please help me.
I've included my error messaging function.
void DisplayOLEDBErrorRecords(HRESULT hrErr) {
CDBErrorInfo ErrorInfo;
ULONG cRecords;
HRESULT hr;
ULONG i;
CComBSTR bstrDesc, bstrHelpFile, bstrSource;
GUID guid;
DWORD dwHelpContext;
WCHAR wszGuid[40];
USES_CONVERSION;
LCID lcLocale = GetSystemDefaultLCID();
hr = ErrorInfo.GetErrorRecords(&cRecords);
if (FAILED(hr) && ErrorInfo.m_spErrorInfo == NULL) {
OLEDBErrorMessageBox( "No OLE DB Error Information found: hr = 0x%x\n", hr);
return;
}
for (i = 0; i < cRecords; i++) {
hr = ErrorInfo.GetAllErrorInfo(i, lcLocale, &bstrDesc, &bstrSource, &guid, &dwHelpContext, &bstrHelpFile);
if (FAILED(hr)) {
OLEDBErrorMessageBox("OLE DB Error Record dump retrieval failed: hr = 0x%x\n", hr);
return;
}
StringFromGUID2(guid, wszGuid, sizeof(wszGuid) / sizeof(WCHAR));
OLEDBErrorMessageBox( "Source:\"%s\"\nDescription:\"%s\"\nhr = 0x%x\n\n", OLE2T(bstrSource), OLE2T(bstrDesc), hrErr);
bstrSource.Empty();
bstrDesc.Empty();
bstrHelpFile.Empty();
}
}
|
|
|
|
|
Hi again and thank you all for the great help that you are giving me
Do you know if there is any built in function to convert a hexadecimal number to decimal. I store the hex number into a string
string hex="EE1000" and i want to convert it to decimal
Thanks again
|
|
|
|
|
C++ faqs[^]
Nibu thomas
Software Developer
|
|
|
|
|
sscanf( str, "%x" , &num ) is enough.
- NS -
|
|
|
|
|
Hey NS17 thanks a lot thats all i need
appresiate the help
|
|
|
|
|
Welcome...
- NS -
|
|
|
|
|
But what if the hex value with me is in string format?
|
|
|
|