|
Christian Graus wrote:
Excel is NOT a database.
No, Excel is not a database. However, using ADO, you can access it like it is. As far as the exporting goes, if you're using automation, there are functions for transferring an Access table to Excel, I don't know about the reverse.
My articles
BlackDice
|
|
|
|
|
reverse is not required now. its sufficient if i can access the data of the other database - ms access .
pls tell those functions for importing tables to excel here i am using atomaton only. how to import. actually in my case i am using l is using the Cdatabase object with 'MICROSOFT EXCEL DRIVER'. and creating ,writing an dupdating tables into excel.
-- modified at 10:39 Tuesday 27th September, 2005
|
|
|
|
|
tejaswi_teja wrote:
reverse is not required now. its sufficient if i can access the data of the other database - ms access .
pls tell those functions for importing tables to excel here i am using atomaton only. how to import. actually in my case i am using l is using the Cdatabase object with 'MICROSOFT EXCEL DRIVER'. and creating ,writing an dupdating tables into excel.
If I understand correctly and I'm not sure I do, you want to export rows from an Access database to and Excel Workbook Correct? If so doing that is easy (using ADO).
objDB.Execute _
"SELECT * INTO [Excel 8.0;DATABASE=" & strExcelFileLocation & _
"].[" & strWorksheet & "] FROM " & "[" & strTableName & "]"
Importing rows from an Excel Workbook theoretically shouldn’t be much more difficult (never tried it my self but should work).
Create a valid data connection to the workbook (using ADO)
Open a client side record set.
Close the connection to the Excel file.
Open a connection to the Access database, Attach the above record set to the data connection and update.
Hope that helps...
-------------------------------
DEBUGGING : Removing the needles from the haystack.
|
|
|
|
|
Im trying to implement something like that:
the user should be able to draw some graphical objects to a CWnd, that allready holds a Bitmap.
I tried to realize this by using GDI+ ... storing the Objects as GraphicsPath in a List and draw them by using Graphics::DrawPath(...).
Works fine so far.
Problem: how to implement undo and clear functionallity?
I tried to use Graphics::Clear(...) to 'empty the Window' and repaint all remaining Objects.
But this will also reset the background-image ... but the background should _not_ be manipulated.
So i thought about using some kind of layer, but really dont know how to start.
Any hints / suggestions / keywords?
Thanks in advance
_NielsB
|
|
|
|
|
_NielsB wrote:
Problem: how to implement undo and clear functionallity?
There's a few ways to do this. The easiest, and ugliest is to keep bitmaps in memory for each action. However, seeing as you're saying the background should not be manipulated, I think you should build an action list, and apply it in your paint handler. Then, undo just means taking the top item out of the list.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
think that will work!
thanks
|
|
|
|
|
Hai..
I am extracting the data from various webpages using the IHTMLDocument2, IHTMLEElement and other interfaces in mshtml.dll.
If webpage contains any unicode data it is returning some symbols like ???? ???? instead of the actual data. How to fix this bug and retrieve the actual data.
Thanks,
Raghu
e.veera raghavendra
|
|
|
|
|
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
|
|
|
|
|