|
Okay, I figured it out in the meantime.
Thanks again for pointing me the way.
|
|
|
|
|
I don't know by heart what (if any) notification you get from a rich edit control when the user right-clicks smething, but if you give different IDs to your dynamically-created edit controls then this should pose no problem.
Ok, i did a little digging, here[^] it says that if you give your rich edit control the NM_MOUSEEVENTS notification flag then it will send you EN_MSGFILTER[^] notifications for mouse events. The wParam of this notification is the handle to the control so you can use this to find out which control sending the event. Does this help?
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
After deriving my own class from CRichEditCtrl I was able to use the Wizard again and add the event handler WM_RBUTTONDOWN to it.
Now I "only" have to figure out how I can get the word where I click the mouse from the control.
|
|
|
|
|
Check out ChatFromPos[^], once you have the character position you can use FindWordBreak [^] to get the word it is in. I never used these so i am not sure it will work.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
Hi,
it was a good hint, I solved it now. First I used 'CharFromPos' and then 'LineFromChar' so I knew which line was clicked. I read out this one by using 'GetLine' (all three functions from class CRichEditCtrl). Because all the lines are formatted dependant on their content I can figure out where the name is I'm looking for. Then I only have to go through an array to compare the names and I get the information I want.
Thanks code-o-mat, but also thanks to the people from code project for providing such a great site!
|
|
|
|
|
I pass the full path of the file to the save function. returns "Unspecified error". What might be the problem?
|
|
|
|
|
Has the path string the right object type? Use the correct string type!!!
What is the return code? (Access rights of the writing process to target location?)
Greetings from Germany
|
|
|
|
|
What about dopcumentation?
You should check the returned HRESULT value.
This page [^] contains the following nice C++ example:
BOOL DOMDocSaveLocation()
{
BOOL bResult = FALSE;
IXMLDOMDocument *pIXMLDOMDocument = NULL;
HRESULT hr;
try
{
_variant_t varString = _T("D:\\sample.xml");
hr = pIXMLDOMDocument->save(varString);
if(SUCCEEDED(hr))
bResult = TRUE;
}
catch(...)
{
DisplayErrorToUser();
}
return bResult;
}
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Its working. now I change the directory permissions just before calling save.
|
|
|
|
|
I am currently working on recording the phone voice from a digital ISDN telephone ....I am writing an MFC application. I have some doubts on digital format of telephonic data.
Could anyone please show me the correct forum...
Thx
|
|
|
|
|
ISDN -> www.capi.org
AFAIK in Linux is some open source code for ISDN.
Greetings from Germany
|
|
|
|
|
I need to access a DLL's functions. When I view the DLL, using DLL Export Viewer - option, Scan COM type libraries, I can see the function that I'm looking after, but it is displayed as
_PastelPartnerSDK::ImportCustomer 1610809394 (0x60030032) PasSDK.dll F:\PastelDLL\PasSDK.dl COM Method
Now I can't seem to find examples for GetProcAddress and COM Methods...
Do I call GetProcAddress as follows?
GetProcAddress(hm, _T("ImportCustomer"));
or
GetProcAddress(hm, _T("_PastelPartnerSDK::ImportCustomer"));
(Where "hm" is the handle returned by LoadLibrary)
The same goes for the typedef void * (__stdcall *ImportCustomer)(); (Can I use any name (ImportCustomer used here) or does it need to be the same as in the DLL?)
Thank you.
|
|
|
|
|
You call GetProcAddress with the exported name. Use the depends.exe to get the right names. There are depending on the call directives.
And check every call of GetProcAddress for success!!!
Greetings from Germany
|
|
|
|
|
Hi
depends.exe doesn't give me all the COM methods
|
|
|
|
|
If you are using COM dlls you should access it via the COM-interfaces.
For sake and sanity
Greetings from Germany
|
|
|
|
|
How? (please point in the direction of a tutorial)
------------
Come to the Dark Side, we have cookies
|
|
|
|
|
At a glance: COM is easy if it works
At first create the object and than call the interfaces and functions.
Check EVERY call for the result and really think what to code on an error. That is important!!!
My favourite COM author is Jeff Glatt:
http://www.codeproject.com/script/Articles/MemberArticles.aspx?amid=88625[^]
www.codeproject.com/KB/COM/CCOMThread.aspx
www.codeproject.com/KB/COM/TEventHandler.aspx
Greetings from Germany
|
|
|
|
|
Thank you. I'll go and read up
------------
Come to the Dark Side, we have cookies
|
|
|
|
|
|
I looked shortly at the source code and think it should work. Download the source and debug it.
It is a good beginners sample.
Greetings from Germany
|
|
|
|
|
Yes, it will.
Anyway have a look at FAQ (at the bottom of the article's page). There are suggestions on using the #import directive and smart pointers (making your client-side life easier), see, for instance [^].
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
I had a look at the article and the FAQ section.
The problem I'm sitting with now is that I only have the DLL, thus no .tbl file, namespace or any address information.
------------
Come to the Dark Side, we have cookies
|
|
|
|
|
You don't need a .tlb file in order to use the #import directive.
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
|
You may verify if the component is actually registered using, for instance, the OleView tool.
You may also try to register the DLL using the regsvr32 command line tool.
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|