[RESOLVED] How create a personalized library?
Hi,
I'm trying to create a personalized library that I can use in any class for change the text of an Edit box in other class.
The class CVirtualView have an edit box called "edit1", control of (IDC_EDIT1) and and function called printff. What I want to do is put this function in a library that I can include in any class and these any class can acess and write the CVirtualView edit box, called edit1.
Example of function that I'll put in the library:
void CVirtualView::printff(int linha, int coluna, CString str)
{
int sel, inisel, fimsel, i;
for(i=1;i<str.GetLength();i+=2)
{
str.Insert(i,' '); // insert a " " between 2 letters
}
sel = str.GetLength();
inisel = (linha-1)*80+(coluna-1)*2;
fimsel = inisel + sel;
edit1.SetSel(inisel,fimsel);
edit1.ReplaceSel(str,false);
}
Anyone can help me?
Thank's...
[948 byte] By [
MBayer] at [2007-11-20 1:58:56]

# 1 Re: [RESOLVED] How create a personalized library?
Hm... And what exactly is your question / problem?
Btw, I would suggest that you adhere to MFC naming standards, especially when creating a reusable library. For example, function names should use Pascal casing (e.g. PrintFF, whatever the "FF" means...).
# 2 Re: [RESOLVED] How create a personalized library?
I'm trying to create a personalized library that I can include in any class in my program. My program have a class named CVirtualView and a class named CCLP. The class CVirtualView have a function called PrintFF that writes into a edit box. Anyway I'm trying to acess the CVirtualView::PrintFF from the CCLP class, using an function/method expecified in the library creating.
Example:
//////////////// Definition of the CCLP class //////////////////////////////
class CCLP
{
public:
CCLP();
virtual ~CCLP();
void On();
};
///// Function that called the CVirtualView::PrintFF function
void CCLP::On()
{
//Incio do programa
PrintFF(4,8,"Teste de projeto!!");
}
Anyway...and if I declare the "PrintFF" function as being global? That should work? How I declare it global?
MBayer at 2007-11-10 23:18:26 >
