|
|
Hi,
I'm using DrawText(...) fn to draw multiline text.
Can I increase the default line spacing with out changing the text size?
I can't replace the DrawText to TextOut because I need DT_WORDBREAK and DT_CALCRECT.
- NS -
|
|
|
|
|
I would calculate where each line of text will break, create a new string for the new length and draw each line of text independently - then adjust the lpRect to move down the desired spacing.
|
|
|
|
|
Hi,
How can I get the colors set by CWinApp::SetDialogBkColor?
- NS -
|
|
|
|
|
Will this work:
_AFX_WIN_STATE* pWinState = _afxWinState;
COLORREF clrCtlBk = pWinState->m_hDlgBkBrush;
COLORREF clrCtlText = pWinState->m_crDlgTextClr
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
Thank you.
But when I use it I get a link error:
error LNK2001: unresolved external symbol "class CProcessLocal<class _afx_win_state=""> _afxWinState" (?_afxWinState@@3V?$CProcessLocal@V_AFX_WIN_STATE@@@@A)
What should I do?
- NS -
|
|
|
|
|
|
Well, it was years back... Thank you...
|
|
|
|
|
I got a different way to get these colors!
I sent WM_CTLCOLORDLG to parent and used the brush returned.
HBRUSH hBrush = (HBRUSH) pWndParent->SendMessage(
WM_CTLCOLORDLG,
WPARAM( dcMem.GetSafeHdc()),
LPARAM( m_hWnd ));
::FillRect( dcMem, &rt, hBrush );
For static texts
HBRUSH hBrush = (HBRUSH) pWndParent->SendMessage(
WM_CTLCOLORSTATIC,
WPARAM( dcMem.GetSafeHdc()),
LPARAM( m_hWnd ));
::FillRect( dcMem, &rt, hBrush );
I have a little fear about bugs!
Could you please tell me that it is bug free?
Thank you.
|
|
|
|
|
hi .problem here .
canu please tell how to establisth a connection between two databases.
my problem is like this. there are two databases ( 2 objecs of Cdatabase class)
one is an ms access database and other is excel database.
i want to use tables of msaccess in excel database. both are in two different locations ( on the pc).
is there any way of importing tables from msaccess database to other one.
or any opther kind of a solution please .
waiting for ur replyy. tejaswi.
|
|
|
|
|
Import how ?
Excel is NOT a database.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
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
|
|
|
|