|
Hi everybody!
I downloaded a project.When I compiled it, I got an error saying 'Cannot open Iphlpapi.lib'.
Then i downloaded the library file and included it in the project.
Still it shows this error!
I dono what has to be done!
Please help me!
Thanks in advance!
|
|
|
|
|
you have to tell the linker where to find the .lib file.
look in your project settings, and reach the linker "additionnal libraries" option...
|
|
|
|
|
Do you have the latest platform SDK installed.
To include a lib file you can also use...
Another option is use #pragma comment( lib, "Iphlpapi.lib" )
|
|
|
|
|
Nibu babu thomas wrote: #pragma comment( lib, "Iphlpapi.lib" )
Why is that called "comment" any relavance?
286? WOWW!
|
|
|
|
|
_8086 wrote: Why is that called "comment" any relavance
From MSDN:
#pragma comment( comment-type [, commentstring] )
Places a comment record into an object file or executable file. The comment-type is one of five predefined identifiers, described below, that specify the type of comment record. The optional commentstring is a string literal that provides additional information for some comment types. Because commentstring is a string literal, it obeys all the rules for string literals with respect to escape characters, embedded quotation marks ("), and concatenation.
lib:
Places a library-search record in the object file. This comment type must be accompanied by a commentstring parameter containing the name (and possibly the path) of the library that you want the linker to search. Since the library name precedes the default library-search records in the object file, the linker searches for this library just as if you had named it on the command line. You can place multiple library-search records in the same source file; each record appears in the object file in the same order in which it is encountered in the source file.
|
|
|
|
|
Thanks I get it now.
286? WOWW!
|
|
|
|
|
_8086 wrote: Thanks I get it now.
Really !
|
|
|
|
|
Dear,
I am trying to create a MFC program to scroll some text.
I have already used the double buffering technology, however, there is still some flicker...
I want to do one without any flicker.
Is anyone who can help me???
Thanks a lot.
Here is my code
struct News
{
CString strNews;
int pos;
int initpos;
BOOL bDecrease;
};
CList<news*,news*> m_News;
void CTextScroller::OnTimer(UINT in)
{
if(in == 0)
{
CClientDC dc(this);
CRect rectClient;
GetClientRect(&rectClient);
MoveTextToLeft(&dc, rectClient);
}
CStatic::OnTimer(in);
}
void CTextScroller::MoveTextToLeft(CDC* pDC, CRect& r)
{
int count = m_News.GetCount();
if(!count)
return;
CDC memDC;
memDC.CreateCompatibleDC(pDC);
if(m_BmpMain.m_hObject == NULL)
{
m_BmpMain.CreateCompatibleBitmap( pDC, r.Width(), r.Height() );
}
memDC.SelectObject(&m_BmpMain);
memDC.SelectObject(&m_font);
memDC.SetBkMode(TRANSPARENT);
memDC.SetTextColor(m_TextColor);
News *_news = NULL;
CSize size;
POSITION pos = m_News.GetHeadPosition();
memDC.FillSolidRect(&r,m_BkColor);
while(pos)
{
_news = m_News.GetNext(pos);
if(!_news)
return;
size = memDC.GetTextExtent(_news->strNews);
if(_news->bDecrease)
_news->pos--;
if(_news->pos < r.left - size.cx)
continue;
//memDC.DrawText(_news->strNews,CRect(_news->pos, 0, _news->pos + size.cx, size.cy),DT_LEFT);
memDC.TextOutW(_news->pos, 0, _news->strNews);
}
pDC->BitBlt(0, 0, r.Width(), r.Height(), &memDC, 0, 0, SRCCOPY);
}
|
|
|
|
|
please read this[^] and edit your message to use <pre></pre> tags when posting code
|
|
|
|
|
As toxcct mentioned, please reformat your post so we can read your code without our eyes
bleeding
You shouldn't be getting any flicker unless maybe the window you're blitting to is redrawing
its background.
You're using double buffering so there's no need to set the BkMode of the memory DC to
TRANSPARENT.
Also, a possibly simpler solution is to use ScrollWindowEx to scroll a windows contents and then
only the newly exposed portion of the window needs to be repainted. No flicker and no double
buffering required
Mark
"If you can dodge a wrench, you can dodge a ball."
|
|
|
|
|
I'm standing right here:
CString cs;
void CNotePadApp::OnFileOpen()
{
}
void CNotePadView::OnDraw(CDC* pDc)
{
CNotePadDoc* pDoc = GetDocument();
pDc->TextOutA(0,0,csText,csText.GetBufferLength());
286? WOWW!
|
|
|
|
|
Well since you are using the Doc/View architecture, the usual practice is to store the string in a member variable of your CDocument derived class (CNotePadDoc??).
This can then be easily accessed from your view.
<br />
void CNotePadApp::OnFileOpen()<br />
{<br />
CString strText = _T("Some string ");<br />
CNotPadDoc* pDoc = GetDocument();<br />
pDoc->SetMyString(strText);<br />
}<br />
<br />
..<br />
void CNotePadView::OnDraw(CDC* pDc)<br />
{<br />
CString csText;<br />
CNotePadDoc* pDoc = GetDocument();<br />
<br />
csText = pDoc->GetMyText();<br />
pDc->TextOutA(0,0,csText,csText.GetBufferLength());<br />
..<br />
I Dream of Absolute Zero
|
|
|
|
|
You open a file, using the "open" in the winapp window menu. Now you store the content in a string.. Now, how do you send it to the view. Please note, you are now away from the view class. Where is the view class's object created?
In general the question goes like this:
You are inside a class far away from the view class. How do print a string from the far away class into the view(The client window that's displays content). You get me now?
286? WOWW!
|
|
|
|
|
Thanks RChin, I'll try that.
286? WOWW!
|
|
|
|
|
|
Thanks dude!
----------------------------
286? WOWW!
|
|
|
|
|
Wow!!! Just checked very nice articles! thanks for sharing!
----------------------------
286? WOWW!
|
|
|
|
|
hi
I want write the code for :
char *strcpy(char *s1 , const char *s2 )?
char *strncpy(char *s1 , const char *s2 , int size)?
char *strcat( char *s1 , const char *s2 )?
char *strncat( char *s1 , const char *s2 , int size )?
int *strcmp( const char *s1 , const char *s2 )?
int *strncmp( const char *s1 , const char *s2 , int size)?
help me please
|
|
|
|
|
what's your question exactly ? you want to rewrite thos function ?
what for ?
moreover, if you work with C++ strings, you'd better forget those old char*. they are a legacy from the C language, kept for compatibility.
however, you should use the std::string class instead; which class proposes all the functionnality you want to redevelop here (if i get you well)
|
|
|
|
|
toxcct wrote: you want to rewrite thos function ?
yes, i think he wants to rewrite those functions.
and i also feel its part of an assignment/homework given to him.
Regards,
Vijay.
God may not give us what we 'want', but he surely gives us what we 'need'.
|
|
|
|
|
What exactly do you want ? Please be specific while posting.
Regards,
Paresh.
|
|
|
|
|
I think you should reffer to some good books on C and C++ (Ex: C and C++ Programmers Bible)
|
|
|
|
|
You shouldn't be using these low level and old fashioned string manipulations routines without a compelling reason to do so. Instead use a string class such as the standard library's std::string or MFC's CString .
Steve
|
|
|
|
|
i am retrieving a unicode field from a database table using getfieldvalue function. but due to some data loss it is displaying question marks. how can i retrieve a double byte value from database in vc++
|
|
|
|
|
Please elaborate on the question ?
Regards,
Paresh.
|
|
|
|