|
How create a .lib from a .cpp & its .h ?
And that's in order to use some functions which are defined in.
|
|
|
|
|
if you are using Visual Studio, just try something bellow:
1. Select File -> New -> Projects -> Win32 Static Library
2. Specify Project Name and Location
3. Add all your files into project with command: Project -> Add to project -> Files
4. Make any setting that you need and build
In order to re-use library function:
1. Include headers which declare functions into file where you plan to use that functions
2. In project setting, at Link tab -> Object/ Library modules, type the path points to your lib file
3. Build
There is an easier way to re-use library function from lib file if you add that library project to your current project and set the dependency between them correctly (Project -> Dependencies)
Have fun.
|
|
|
|
|
Thank's it works well
And very easy to run...
|
|
|
|
|
Hi everybdoy!
I developed a program under Mfc and VisualC++, SP5. After installing the program and all the components (i. e. controls) under Win98 (not SE), I get a black screen. When I click around and hit a control, it appears back, the rest stays black.
Under Win2000 it works fine without any problems.
Now I need your help:
Where could the problem be located?
How can I resolve this problem?
Thank you very much for your help
Brennivin
|
|
|
|
|
what do you mean by black screen? does the program or the os not react anymore?
Don't try it, just do it!
|
|
|
|
|
No, there is just no picture! If you finish the program, it appears back and you can work on without any problems. And if you click left on a control, you see just this control, the rest is black.
Greets
Brennivin
|
|
|
|
|
Hi Friends,
Can anyone tell me what is the alternative of CreateRemoteThread in Win98 . How can i create a thread in Remote Process in Win98 operating system.
Thanx in advance !
Kuldeep
|
|
|
|
|
|
there are a couple of articles here at cp that show a ballon help one is CPPTooltip and another is by shog.
calculate the coordinates of ur tray icon (easier said than done )
and show the ballon help
i can't even remember what my point is now, but anyway, i'm correct
Barring unforeseen acts of God and Adminstrators, my server will be up tomorrow. I'm more worried about the Adminstrators.
|
|
|
|
|
|
Michael Dunn wrote:
On XP, use the IUserNotification interface provided by the shell. On earlier OSes, you'll need to handle adding/removing the icon yourself.
Thanx for the advice, but my software is targeted for varity of OS's so i cant use it even if i want to.
But i figured out that NIF_INFO in NOTIFYICONDATA by using Shell_NotifyIcon does the samething.
But i havent test it yet but seems like that what i am looking for.
I'll write a suicide note on a hundred dollar bill - Dire Straits
|
|
|
|
|
I have the following snippet of code:
for(int i=nIndex; i>=0; i--){
if(csBuff[i]==chDelim || csBuff[i]==LF) break;
}
I thought it would decrement i until a deliminator was found or until i == 0 in which case it would not execute anything inside the loop, nor would it decrement i anymore either...
to my surprise i is -1 and it's driving me nutts...
someone tell me this is normal or indicate the bug in my code....
Should I just test after the loop and make sure -1 becomes ZERO...like I thought it would and all post code assumes as well...?
Thanks
Cheer s
How do I print my voice mail?
|
|
|
|
|
Hockey wrote:
I thought it would decrement i ... until i == 0
No, the loop runs as long as the condition i>=0 is true. When i is 0, the test becomes 0>=0 which is true, so the loop runs. If you want to stop when i is 0, the test should be i>0
--Mike--
Personal stuff:: Ericahist | Homepage
Shareware stuff:: 1ClickPicGrabber | RightClick-Encrypt
CP stuff:: CP SearchBar v2.0.2 | C++ Forum FAQ
----
There is a saying in statistics that a million monkeys pounding on typewriters would eventually create a work of Shakespeare. Thanks to the Internet, we now know that this is not true.
|
|
|
|
|
I understand true would cause the loop to iterate again, but I still can't get the code working...
I'm trying to extract a word given an offset into a buffer using space as delimiters, this is what I have so far and it doesn't work...and I have no idea why...
for(int i=nIndex; i>0; i++){
if(csBuff[i]==chDelim || csBuff[i]==LF) break;
}
for(int j=i; j<csBuff.GetLength(); j++){
if(csBuff[j]==chDelim || csBuff[i]==CR) break;
csWord += csBuff[j];
}
Any idea?
Thank again
How do I print my voice mail?
|
|
|
|
|
Hockey wrote:
for(int i=nIndex; i>0; i++){
Are you sure that i++ is intentional? That, coupled with the i>0 condition, means that this is potentially a "forever" loop. The only thing that would cause the loop to exit, besides i becoming negative after about 231, would be if either of the conditions in the if statement were true.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
May be he typeoed coz his original post has i--;
I'll write a suicide note on a hundred dollar bill - Dire Straits
|
|
|
|
|
Yes, that notion was considered.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
It is normal.
Remember that the syntax of for statement is defined as:
for(init_statement ; condition ; expression) exp_2;
The expression (in the case, i--) will continue to work (decrement) till the condition becomes false, then the execution leaves the for loop. In the case, i>=0 is still true while i is zero at that time, thus the expression (i--) will be executed once more to expect the condition to become false.
If you hope it exit the for loop at the time i = 0, you may write this way:
for(int i = nIndex; ; i--)
{
if(csBuff[i] == chDelim || csBuff[i] == LF)
break;
if(0 == i)
break;
}
Maxwell Chen
|
|
|
|
|
How do i show a balloon window with my trayicon to show some events accoring.
The balloon window similar to what you get when a new hardware is detected by windows.
Regards.
I'll write a suicide note on a hundred dollar bill - Dire Straits
|
|
|
|
|
hi, guys
i need to use a CTypedPtrList templet structure in my program.
here is my code: (CFreqStandard is a class which i derived from CObject and it's basically used to store some data)
class CSDIgDoc : public CDocument
{
protected: // create from serialization only
CSDIgDoc();
DECLARE_DYNCREATE(CSDIgDoc)
protected:
//CTypedPtrList<coblist,cfreqstandard*> FreqList;
//CString StandardName;
CString StandardName;
CTypedPtrList<coblist,cfreqstandard> m_FreqList;/////////////////////
// Attributes
public:
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CSDIgDoc)
public:
virtual BOOL OnNewDocument();
virtual void Serialize(CArchive& ar);
//}}AFX_VIRTUAL
// Implementation
public:
virtual ~CSDIgDoc();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
protected:
// Generated message map functions
protected:
//{{AFX_MSG(CSDIgDoc)
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
but when i compile i always get an error in the line
CTypedPtrList<coblist,cfreqstandard> m_FreqList;
it shows that "'CTypedPtrList' : missing storage-class or type specifiers"
what is the problem in this case?
Thank you very much in advance
|
|
|
|
|
You never defined the types to use for the template, like this for example:
typedef CTypedPtrList<CObList, CMyObject*> m_FreqList;
Have a look to this article[^] of MSDN for a sample.
HTH,
K.
Mais donnez-moi aussi
Le courage et la force et la foi
Car vous êtes le seul à donner
Ce que l'on ne peut obtenir que de soi.
|
|
|
|
|
Hi Friends,
How can i programmatically cancel a message box that popped during a startup of a application
thanx,
John
|
|
|
|
|
Seems like writing a loader, or removing a nag screen
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
I declear a CTime valiable and set it's value before 1970-1-1, it will cause a assertion failed error(timecore.cpp), I realized that 1970-1-1 is the defaule value for CTime, anybody encounter this problem before? please help me out, thanks a lot.
|
|
|
|
|
CTime objects can contain times from 1970-1-1 to somewhere in 2038. (you should check the validity of the input yourself)
if you want to have dates outside that period you can use the COleDateTime class.
Regards,
Davy
|
|
|
|