|
Thanks.
It was the correct way to do it (using the _T macro).
anyhow, now i have another problem.
i have double variables which i want to turn to strings. but the _GVCT function gets only 'char*' buffer.
is there any _UNICODE replacement?
|
|
|
|
|
Greetings,
I have the "joy" of trying to make my ActiveX controls act as Accessibility servers, so that they provide information about the value, role, and desrciption (how to be used) to potential screen readers. The "joy" comes from the lack of information on accessibility, and the bit that there is out there is not clear. I am hoping that somebody on this list has some experience with this area and can help me out with the following.
I have a custom slider in the form of an ActiveX Control. Everytime the value of the slider changes, I want the new value to be read by the screen reader. At the moment I am call the following code everytime the slider value has changed.
<doe>
CComPtr<iaccpropservices> pAccPropSrv;
HRESULT hr;
hr = pAccPropSrv.CoCreateInstance(CLSID_AccPropServices);
if(hr == S_OK)
{
COleVariant varValue(m_sPositionText);
COleVariant varRole((long)ROLE_SYSTEM_SLIDER, VT_I4);
COleVariant varDescr("Some description");
pAccPropSrv->SetHwndProp(m_hWnd, OBJID_CLIENT, 0, PROPID_ACC_VALUE, varValue);
pAccPropSrv->SetHwndProp(m_hWnd,
OBJID_CLIENT, 0, PROPID_ACC_ROLE, varRole);
pAccPropSrv->SetHwndProp(m_hWnd, OBJID_CLIENT, 0, PROPID_ACC_DESCRIPTION, varDescr);
}
This actually results in the screen reader reading the Role and Value, and not the Description. More importantly it only reads it the first time that the slider gets focus. No matter how many times I click on the slider and move it arround after that, the screen reader does not read the new value. If I then click on another control, and then back on the slider again, then it reads the value once more.
I thought this was a problem with my ActiveX slider control but it is also how default controls such as radio buttons of Windows, work, they will onyl read out their value once until they regain focus again.
However, the standard windows slider control, has the exception that it will read out the value everytime the slider changes due to the user pressing the arrow keys. In my ActiveX control slider, the same code as above is called whenever the slider position changes, regardless of whether it changed my the mouse or keys.
I guess in summary, what I need help with is:
1) Why does the screen reader not read out my ActiveX control's description.
2) Why does the value of my ActiveX control only get read once until it regains focus.
3) How does the standard windows slider manage to read its new value when the value has changed due to the user pressing the arrow keys?
Thanks in advance,
Aristotel
Edit/Delete Message
|
|
|
|
|
Hi, everybody!
I need help... I'm still trying to develop a kind of a firewall for WinNT/2K/XP, in C++. I'm using a program that hooks Windows API functions and it works reasonably good. The way it hooks Windows API functions is injecting the dll to every process using CreateRemoteThread().
My problem is with two functions: accept() and listen() aren't hooked (I've tried to hook them from WS2_32.DLL and WSOCK32.DLL), altough the code I've written should be hooking them (I've hooked lots of API functions the same way without a problem -CreateProcess, ExitProcess, send, recv, etc..-), but I don't seem to be able to hook those two functions.
Do you have any idea of what can be the reason for this?
Thanks a lot to all in advance.
Regards:
Javi.
|
|
|
|
|
Not familiar with the terminology you use: what do you mean by hook? R u talking about linking (either dynamically or statically) dll?
|
|
|
|
|
Laffis wrote:
what do you mean by hook? R u talking about linking (either dynamically or statically) dll?
what is HOOK? good question here is answer :-
http://www.codeproject.com/system/hooksys.asp[^]
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Hi All
I want to save some files, & folders to specified location given by user and again restore that saved files & Folders to given specified location.
Please suggest me that how can I do it
Thanks.
|
|
|
|
|
You can use your CWinApp derived class in either a Dialog based application, or Multi/Single based app. What you do is create a CString variable in that derived class and load it by GetProfileString( LPCTSTR lpszSection,
LPCTSTR lpszEntry,
LPCTSTR lpszDefault = 0 );
Such as:
class header:
class CWhateverClass
{
. . .
private:
CString FileName;
}
class source:
BOOL CWhateverClass::InitInstance()
{
. . .
FileName = GetProfileString( "Saved", SavedFileName, FileName );
. . .
}
int CWhateverClass::ExitInstance()
{
. . .
WriteProfileString( "Saved", SavedFileName, FileName );
. . .
return CWinApp::ExitInstance();
}
You are able to manipulate the CString FileName from other parts of your app by using theApp.
Hope I hit what you were getting at. Aaron
|
|
|
|
|
Hi All
I am using Outlook object model in order to access MS outlook folders and other informations.
Here I have imported "mso.dll & msoutl.olb" files.
Then I am using code as below
<br />
<br />
void CMSOutlookDlg::AddFolders( )<br />
{<br />
<br />
_ApplicationPtr pApp;<br />
_ItemsPtr pItems;<br />
MAPIFolder pFolder;<br />
_ContactItemPtr pContact;<br />
<br />
hr = pApp.CreateInstance(__uuidof(Application));<br />
<br />
}<br />
<br />
then it gives error
<br />
f:\msoutlook\debug\mso.tlh(1036) : warning C4146: unary minus operator applied to unsigned type, result still unsigned<br />
F:\MSOutlook\MSOutlookDlg.cpp(131) : error C2065: '_ApplicationPtr' : undeclared identifier<br />
F:\MSOutlook\MSOutlookDlg.cpp(131) : error C2146: syntax error : missing ';' before identifier 'pApp'<br />
F:\MSOutlook\MSOutlookDlg.cpp(131) : error C2065: 'pApp' : undeclared identifier<br />
F:\MSOutlook\MSOutlookDlg.cpp(132) : error C2065: '_ItemsPtr' : undeclared identifier<br />
F:\MSOutlook\MSOutlookDlg.cpp(132) : error C2146: syntax error : missing ';' before identifier 'pItems'<br />
F:\MSOutlook\MSOutlookDlg.cpp(132) : error C2065: 'pItems' : undeclared identifier<br />
F:\MSOutlook\MSOutlookDlg.cpp(133) : error C2065: 'MAPIFolder' : undeclared identifier<br />
F:\MSOutlook\MSOutlookDlg.cpp(133) : error C2146: syntax error : missing ';' before identifier 'pFolder'<br />
F:\MSOutlook\MSOutlookDlg.cpp(133) : error C2065: 'pFolder' : undeclared identifier<br />
F:\MSOutlook\MSOutlookDlg.cpp(135) : error C2065: '_ContactItemPtr' : undeclared identifier<br />
F:\MSOutlook\MSOutlookDlg.cpp(135) : error C2146: syntax error : missing ';' before identifier 'pContact'<br />
F:\MSOutlook\MSOutlookDlg.cpp(135) : error C2065: 'pContact' : undeclared identifier<br />
Generating Code...<br />
Error executing cl.exe.<br />
Creating browse info file...<br />
<br />
MSOutlook.exe - 12 error(s), 1 warning(s)<br />
Please help me that why is this happening?
Also if u have some sample to retrieve folders & message of MS outlook then pls provide it
Thanks
|
|
|
|
|
Aren't the imported types declared in another namespace?
Have a look in the generated header files.
--
Roger
|
|
|
|
|
did you correctly #include d the header which defines the _ApplicationPtr type ?
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
have you used #import statement. If not you need to add one
like
#import "C:\\Program Files\\MicrosoftOffice\\Office\\msoutl85.olb"\
no_namespace exclude("_IRecipientControl", "_DRecipientControl")
For more info search MSDN for "HOWTO: Use Microsoft Outlook Object Model From Visual C++ Through an #IMPORT Statement"
|
|
|
|
|
Hi
How to register a file type in Windows Registry and assign a default program to that file type.
Eg: *.Txt files are Text Files and Default program is notepad
Regard
KK
|
|
|
|
|
|
Hello everyone,
I have a little problem with a struct that i would like to create the way you will see below. i am using Visual C++ 6 :
VCalcParserTypes.h
<font color=blue>#include</font> <STRING> <font color=green>
<font color=green>
<font color=blue>typedef long double</font> <font color=purple>VALUES_TYPE</font>;
<font color=green>
<font color=blue>typedef struct</font> {
<font color=blue>const</font> std::string m_strFormula;
<font color=blue>const</font> <font color=purple>VALUES_TYPE</font> m_valResult;
} <font color=purple>AnswerItem</font>;
<hr>
VCalcParser.h
<font color=blue>#include</font> <STRING> <font color=green>
<font color=blue>#include</font> <DEQUE> <font color=green>
<font color=blue>#include</font> <font color=gray>"VCalcParserTypes.h"</font>
<font color=green>
<font color=blue>class</font> CVCalcParser {
<font color=blue>private</font>:
<font color=green>
std::string m_Source; <font color=green>
std::deque<<font color=purple>AnswerItem</font>> m_dqeAnswersHistory; <font color=green>
<font color=blue>public</font>:
<font color=green>
<font color=purple>VALUES_TYPE</font> Evaluate(<font color=blue>const</font> std::string& Source);
<font color=green>
};
<hr>
VCalcParser.cpp
<font color=green>
<font color=purple>VALUES_TYPE</font> CVCalcParser::Evaluate(<font color=blue>const</font> std::string& Source) {
<font color=blue>this</font>->ResetParserMembers(Source);
<font color=blue>try</font> {
<font color=purple>VALUES_TYPE</font> valResult = <font color=blue>this</font>->Level_1();
<font color=purple>AnswerItem</font> AnsItem = { <font color=blue>this</font>->m_Source, valResult };
<font color=blue>this</font>->m_dqeAnswersHistory.push_front(AnsItem);
<font color=blue>return</font> valResult;
}
<font color=blue>catch</font> (...) {
<font color=blue>throw</font>;
}
}
At the line quoted on the previous code, the compiler gives me a :
error C2552: 'AnsItem' : non-aggregates cannot be initialized with initializer list
Seing the MSDN, my AnswerItem type IS an aggregate :
- no constructor,
- no private/protected members,
- no base class,
- no virtual functions...
any suggestion ?
TOXCCT >>> GEII power [toxcct][VisualCalc]
-- modified at 4:22 Tuesday 27th September, 2005
|
|
|
|
|
|
yeah, i saw this, but did not pay attention to it that much (shame on me)...
thank you
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
toxcct wrote:
Seing the MSDN, my AnswerItem type IS an aggregate :
Well, how about the std::string member?
Also remove the const directive.
--
Roger
|
|
|
|
|
wow, damn, yep, you might be right
i wanted to avoid assigning each member one by one, but i realize that i'll have to...
thanks anyway
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
without source file. i have the library file.
but the lib is in vc6 version. how can i use it in my vc7 projects?
|
|
|
|
|
Dear sir:
I obtained a warrning dialog message, saying "Unable open the files(C:\VC60\SKetcher16\ScaleDialog.h, C:\VC60\SKetcher16\ScaleDialog.cpp) for class "CScalDialog" when I am trying to obtain the new class of the CScalDialog by using Class Wizard. I uninstalled the Visual C++ 6.0 and installed it for many times. Still I can't resolve the problem. I am using Windows XP as the OS. Anyone know how to fix it. Notify me please.
Scincerely Yours.
wen hou
|
|
|
|
|
Hi wen,
Delete the .clw file(better to take a backup ). Open the project and goto classwizard and create new .clw file by including all the files.
Hope this solves ur problem.
Adios,
Cool Ju
|
|
|
|
|
hi,
how to check radio button in another dialog to the corresponding radio button in one dialog
|
|
|
|
|
You can do this by ON_COMMAND messaging. ON_COMMAND messaging sends or pumps a message to your entire program. It gets very tricky when sending messages from one Dialog class to another. The best programming with respect to Dialog based programs, is to keep your Views ( Dialog ) loosely coupled from the inner workings ( Control ). Some go on the idea of MVC ( model, View, Control ) idea. Try to read up on this. Another way is to implement a GoF concept, by using the "Observer pattern" ( plenty of example here in codeproject ). This pattern does the job of keeping the Dialog class loosly coupled, and is continually updated when information is changed, or an action has taken place ( hint: such as a radio button clicked ). All in all, messaging from one dialog to another has its pitfalls.
|
|
|
|
|
tamsel wrote:
how to check radio button in another dialog to the corresponding radio button in one dialo
I am confuse between these two api... one of then certainly goign to help :-
CheckDlgButton or SetDlgItemInt
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
I have created a view which need to be printed
by a printer , The base class for the view is
the CScrollView.
How can i print all the data, i also want to
ensure that if data is long enought not to
fit on one page then there should be some
blank space left at the starting and ending
of every page.
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|