|
Hi,
Is it returning the data ??????? or displaying like ???? (Suppose message box/MSDEV Editor)..
If it displays ??????, you must install profer font on your PC. And also while creating fonts, you should mention the charset of the language you are using.. Operating systems also could be issues..
Can you tell me what operating systems you are using, font using and the language of interests...
" Action without vision is only passing time,
Vision without action is merely day dreaming,
But vision with action can change the world "
- Words from Nelson Mandela
Thanks & Regards,
Gopalakrishnan
|
|
|
|
|
Hi,
I have installed all the fonts in which I require, and using the Windows XP. Mainly i am retrieving the data using the IHTMLDocument and other IHTML interfaces and string into the CSting variables.After, I will write this data in the text file.
Thnaks,
e.veera raghavendra
|
|
|
|
|
Who sets the last error? is it the kernel? or the windows subsystem that calls the system calls using Nt* calls?
|
|
|
|
|
Whoever detects the error and then calls SetLastError().
|
|
|
|
|
There's a last error value per thread: GetLastError[^]
As this link explians, the value is set by any who calls SetLastError
Marc Soleda.
... she said you are the perfect stranger she said baby let's keep it like this... Tunnel of Love, Dire Straits.
|
|
|
|
|
In my MFC based dialog Application I display an ActiveX Control.
CString strControlProgid = "Project1.UserControl1"; //ActiveX Control name
::GetClientRect(m_hWnd,&rc);
//CWnd m_PLC_Control; Member defined in .h
bStat= m_PLC_Control.CreateControl ( strControlProgid, "", WS_VISIBLE, rc,
this, 5000, NULL, FALSE, NULL );
::SetWindowText (m_hWnd,strControlProgid);
pPlcControl = m_PLC_Control.GetControlUnknown ();
pPlcControl->QueryInterface(IID_IDispatch, (void **)&pdisp);
So far it works fine. After I get an event from the ActiveX Control I close it. But it does not release it from memory.
m_PLC_Control.DestroyWindow();
::SetWindowText (m_hWnd,"ActiveX Container");
So next time I display the ActiveX Control, the memory increases again. So on until memory is to high and CreateControl failes.
What have I to do to release the memory so I am able to display the ActiveX Control as often as I want?
Thanks for your help in advance
Christian
|
|
|
|
|
From MSDN:
Every interface is derived from IUnknown, so every interface has an implementation of QueryInterface. Regardless of implementation, this method queries an object using the IID of the interface to which the caller wants a pointer. If the object supports that interface, QueryInterface retrieves a pointer to the interface, while also calling AddRef. Otherwise, it returns the E_NOINTERFACE error code.
So ... I would think you should call
m_PLC_Control.DestroyWindow();
pPlcControl->Release();
and your memory woes might disappear
|
|
|
|
|
Thanks for the fast answer Blake,
but unfortunately it does not work. pPlcControl->Release() has no affect to the memory.
|
|
|
|
|
Sorry Blake I did a mistake.
It works !
It does not free all the allocated memory, but next time it does only allocate the before released memory. So there is no longer a continously increasing.
Thanks Blake.
|
|
|
|
|
There are three phases of construction:
1c. CreateControl -> m_PLC_Control.CreateControl
2c. Getting Interface Pointer (QueryInterface, AddRef)
3c. Creation of Window
These each require a destruction phase, in reverse order.
So far, you have:
3d. DestroyWindow() -> removes window
2d. Release() -> release interface pointer
1d. ? You need to look at the member functions for m_PLC_Control and maybe a DeleteControl() or DestroyControl() exists to complement the CreateControl(). Calling it after the Release() should free up your memory.
I suspect your constant calls to m_PLC_Control.CreateControl at this point are the result of your memory leak. I don't remember what, or if you stated, your m_PLC_Control is derived from, but here is an example, if it is an m_PLC_Control, then call this function - COleControlSite::DestroyControl as m_PLC_Control.DestroyControl()
|
|
|
|
|
I want to change cursor icon when cursor is over a button or other control.
But what events have to handle when cursor come in the client area of the control and when it go out of client area?
thanks
|
|
|
|
|
void CMyApp::OnLButtonDown()
{
AfxGetApp()->DoWaitCursor(1); // 1->>display the hourglass cursor
// do some lengthy processing
AfxGetApp()->DoWaitCursor(-1); // -1->>remove the hourglass cursor
}
What you are talking about, you might have to deal with CPoint. Use CPoint to get the location of the cursor in accordance to the location of the window. When the cursor is at a certain location in the window, such as, over a button. . .an action takes place to change the cursor. I know ActiveX controls have this ability. Chech them out.
|
|
|
|
|
void CMyApp::OnLButtonDown()
{
AfxGetApp()->DoWaitCursor(1); // 1->>display the hourglass cursor
// do some lengthy processing
AfxGetApp()->DoWaitCursor(-1); // -1->>remove the hourglass cursor
}
What you are talking about, you might have to deal with CPoint. Use CPoint to get the location of the cursor in accordance to the location of the window. When the cursor is at a certain location in the window, such as, over a button. . .an action takes place to change the cursor. I know ActiveX controls have this ability. Check them out.
|
|
|
|
|
Use the mouse move message to check whether the cursor is in the area of a control. For example, if you are using MFC, trap the ON_WM_MOUSEMOVE message and in the OnMouseMove message-handler, find the CRect area of the control (such as button) using functions such as GetDlgItem , GetWindowRect and ScreenToClient .
And, then use the set cursor message (such as ON_WM_SETCURSOR ) and in its handler, first check whether the cursor point is in the aforesaid CRect area of the specific control and if so, use SetCursor function to change the cursor.
Regards,
Ashok Dhamija
_____________________________
Padam Technologies
|
|
|
|
|
Hi,
i'm looking for a way to initialize a static array of _TCHAR elements.
I've tried the following code in the StdAfx.h file.
//BEGIN OF CODE
static const _TCHAR * enDayOfWeek_DaysStrings[] =
{
"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturady"
};
//END OF CODE
When _UNICODE is not defined, it works great.
But when _UNICODE is defined, i get a compiler error:
"error C2440: 'initializing' : cannot convert from 'const char [7]' to 'const _TCHAR *'. Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast"
Any ideas?
|
|
|
|
|
"" tells the compilter it is a non-unicode string.
You should be using _T("Sunday"), or L"Sunday" if you are sure the application will be using unicode for certain.
|
|
|
|
|
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
|
|
|
|
|