|
You'll need to include a header, and link to a library to use this function. Scroll down to the "Requirements" section of the MSDN link I provided you with.
"Real men drive manual transmission" - Rajesh.
|
|
|
|
|
Hi!
It's told that minimum supported client and server as Windows 2000 Professional and Windows 2000 Server. Will it work with Windows XP?
Do I have to download the following to my Solution path?
Wininet.h
Wininet.lib
Wininet.dll
|
|
|
|
|
T.RATHA KRISHNAN wrote: It's told that minimum supported client and server as Windows 2000 Professional and Windows 2000 Server. Will it work with Windows XP?
Windows XP was released after Windows 2000. So, the API will work on XP.
"Real men drive manual transmission" - Rajesh.
|
|
|
|
|
try with
#include <Wininet.h>
#pragma comment(lib,"Wininet.lib")
|
|
|
|
|
Member 3922639 wrote: #include <wininet.h>
#pragma comment(lib,"Wininet.lib")
If I include the above code, I got 283 errors, all in the Wininet.h file(Syntax errors, missing type specifier errors and error C2378: 'HINTERNET' : redefinition; symbol cannot be overloaded with a typedef). Where shall I get the Wininet.h file? Do I have to Download and install Windows SDK to solve all these errors?
|
|
|
|
|
After I included "windows.h", all the errors vanished. Thanks alot.
|
|
|
|
|
|
|
Hi,
I have one dialog base application. It contains list control having some data in report view. After double
clicking on it a new modeless dialog gets opened. It contains edit controls which contains data of list
control's selected row. If i edit data in edit controls and press OK then data in list control should get
updated with newly updated data.
My problem is how I pass updated data to list control of parent dialog.
I am using Microsoft Visual studio 6.0.
Regards
Nikesh
|
|
|
|
|
Implement an appropriate method in the parent dialog (the parent dialog, upon creation of the child one, should pass to the child a pointer to itself).
See this CodeProject's article:"Dialogs Communication"[^].
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]
|
|
|
|
|
When creating the modeless dialog, you have to specify a HWND that owns the new dialog; enter the HWND of the dialog containing the list control here.
You can use the GetParent[^] function to get the parent window HWND when the OK button is clicked on your modeless dialog. Use GetDlgItem[^] to get the HWND of the list view.
Now you can use SendMessage[^] with LVM_INSERTITEM[^] or LVM_SETITEM[^] to add/edit data in your list control.
modified 13-Sep-18 21:01pm.
|
|
|
|
|
Hi all,
i'm attempting to connect to a foxpro dbaseIV via odbc. I was able to connect to it by specifying the physical path of may table (i.e C:\test\f_cheque.dbf). but for some purpose, i have to connect to that base without specifying the path, just by alias (odbc).
did some one know how to do that by C++. Thx
"The Ultimate Limit Is Only Your Imagination."
|
|
|
|
|
You should create a DSN (see, for instance "Creating a new ODBC DSN"[^]), then.
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]
|
|
|
|
|
My mistake is that i missed to include the alias into the connectionstring.
Thx for the reply.
"The Ultimate Limit Is Only Your Imagination."
|
|
|
|
|
I have a ListControl in ICON view .I have many bitmap files . Now I want to show the files in list view .
How it is possible.
Rajesh
|
|
|
|
|
|
Hi!
I've to add Two Text Boxes and one Button to a Windows Forms in VC++. How to do this?
|
|
|
|
|
To Add a button (button1) to a from (Frm1)
this.button1 = new System.Windows.Forms.Button();
this.Frm1.Controls.Add(this.button1 );
"The Ultimate Limit Is Only Your Imagination."
|
|
|
|
|
I am trying to select the text of client area which i had paint by using the textout().how i had display the text see ..............
<pre lang="msil">void GetFormattedData( PVOID pBuf,DWORD dwOffset, CString &szFormatted )
{
BYTE *SETBUFF = ((BYTE*)(pBuf)) + dwOffset ;
szFormatted.Format(_T("%08d: %.2X %.2X %),dwOffset,SETBUFF[0], SETBUFF[1],;
}</pre>
<pre lang="cs">for(int i = Start; i<= End; i++)
{
GetFormattedData(m_lpData, (i + m_nVScrollBarPos )* m_cyChar,szFormatted);
m_pDC.TextOut((1 - m_nHScrollBarPos) * m_cxChar , i * m_cyChar, szFormatted);
}</pre>
|
|
|
|
|
void GetFormattedData( PVOID pBuf, DWORD dwOffset, CString &szFormatted )
{
BYTE *SETBUFF = ((BYTE*)(pBuf)) + dwOffset ;
szFormatted.Format(_T("%08d: %.2X %.2X "), dwOffset, SETBUFF[0], SETBUFF[1]);
}
for(int i = Start; i <= End; i++)
{
GetFormattedData(m_lpData, (i + m_nVScrollBarPos )* m_cyChar, szFormatted);
m_pDC.TextOut((1 - m_nHScrollBarPos) * m_cxChar, i * m_cyChar, szFormatted);
}
A bit unclear description.
sarfaraznawaz wrote: how i had display the text see ..............
Do you want to know how to display ellipsis at the end of the string if it's too long? You could use CDC::DrawText()[^] with DT_END_ELLIPSIS formatting instead of TextOut() .
sarfaraznawaz wrote: I am trying to select the text of client area which i had paint by using the textout().
If, on the other hand, you want to be able to select portions of the text, you would be better off using an edit control. You can style them to look like you need them too (mostly true), removing frames and such.
If you want to let the user only select the entire text, you could respond to WM_LBUTTONDOWN events within your text rectangle, and redraw the text with a different background color set in the DC.
|
|
|
|
|
thanks
i am very new to MFC. trying to select the particular text of the client area.i have use
OnLButtonDown and OnLButtonup had two points .i am not able change background color of particular text.provid me some example .....
|
|
|
|
|
You use CDC::SetBkColor()[^] to set the background color.
You will have to draw the text in more than one go to make parts of it appear selected. Have a look at CDC::SetTextAlign()[^] using the TA_UPDATECP flag to make multiple calls to TextOut() create one line of text.
I still think using a CEdit might me a lot easier.
Use CDC::GetTextExtent()[^] to calculate width of characters in your string.
|
|
|
|
|
thanks
i tried but i am not able select text please help me out this..
this is how i had written the code.... where and how to use the textout() method
void CMainFrame::OnMouseMove(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
CRect rct;
CPaintDC pdc(this);
currentpoint = point;
GetClientRect(&rct);
rct.SetRect(m_ptFrom,m_ptTo);
if (bLBtnpressed)
{
pdc.SetBkColor(RGB(0,0,192));
}
CFrameWnd::OnMouseMove(nFlags, point);
}
|
|
|
|
|
You should move your painting code to OnPaint if you use a CDialog, or to OnDraw if you use a doc/view architecture.
Keep a selection range as a member variable, as well as the text printed.
Maybe something like this in your header file
struct SelectionRange
{
SelectionRange(int f, int e) : first(f), end(e) {}
int first;
int end;
bool empty() const { return first < 0 || end < first; }
size_t size() const { return end - first; }
};
SelectionRange range;
const TCHAR* text; In constructor:
range(2, 4);
text = _T("Hello world!"); In OnPaint() or OnDraw():
int oldBM = dc.SetBkMode(TRANSPARENT);
if (range.empty())
{
dc.TextOut(30, 30, text); }
else
{
dc.MoveTo(30, 30);
UINT ta = dc.GetTextAlign();
UINT oldTA = dc.SetTextAlign(ta | TA_UPDATECP);
dc.TextOut(0, 0, text, range.first);
dc.SetBkMode(oldBM);
COLORREF oldTC = dc.SetTextColor(RGB(255, 255, 255));
COLORREF oldBC = dc.SetBkColor(RGB(0, 0, 255));
dc.TextOut(0, 0, &text[range.first], range.size());
dc.SetBkMode(TRANSPARENT);
dc.SetTextColor(oldTC);
dc.SetBkColor(oldBC);
dc.TextOutA(0, 0, &text[range.end]);
dc.SetTextAlign(oldTA);
}
dc.SetBkColor(oldBM);
This will draw the text with characters text[range.first] to text[range.last-1] as selected.
You will have to calculate the range variable in your WM_LBUTTONDOWN / WM_MOUSEMOVE handlers, and add some logic to support negative ranges (last < first), or just turn them into positive ranges if that is sufficient your needs.
|
|
|
|
|
thanks ....
but i am not using any one CDialog, OnDraw and doc/view architecture.
i am using app class & mainframe in SD i removed all other classes and what ever text is there i had display in paint only CMainFrame::OnPaint().............
trying to develop the editor kind of application without using editview ..
i have drawn the rectangle mouse event i want change the color what ever text comes under the rectangle should not hide text that is my problem .....
|
|
|
|