|
DeclareCStatic myStatic; in class not in a function
whitesky
|
|
|
|
|
Its working wen i tried with the same code.
But
Declared this as a member of class.
CStatic myStatic;
Dream bigger... Do bigger...Expect smaller
aji
|
|
|
|
|
jadhav123 wrote: Static myStatic;
myStatic.Create(_T("my static"), WS_CHILD|WS_VISIBLE|SS_CENTER,
CRect(15,15,150,50), this);
it is not created because, as soon as OnInitDialog function Exit, scope of MyStatic variable will end which inturn destory the object..
Now if you want to see Your Dynamically created Static Box you have to decalre CStatic variable as global or as classmember, so ity lifetime is that of program
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
Hi,
I create MFC extension DLL and wrote couple of functions adding one class i.e.CNoteMgr
in the DLL workspace.
In the class header of CNoteMgr,
there are two functions whose signature is given as below :
BOOL CNoteMgr::drawLine(HDC,HPEN,POINT,HWND);
BOOL CNoteMgr::drawCurve(HDC,POINT,HWND);
The implementation has been done in different way for line drawing and drawing curve.
But while compiling the DLL, i am getting the following errors as below :
****************************************************************************************
Compiling...
Notebook.cpp
D:\FancyViewer\Notebook\Notebook.cpp(78) : warning C4101: 'msg' : unreferenced local variable
NoteMgr.cpp
D:\FancyViewer\Notebook\NoteMgr.cpp(632) : error C2511: 'drawLine' : overloaded member function 'int (struct HDC__ *,struct HPEN__ *,struct tagPOINT [],struct HWND__ *)' not found in 'CNoteMgr'
d:\fancyviewer\notebook\notemgr.h(29) : see declaration of 'CNoteMgr'
D:\FancyViewer\Notebook\NoteMgr.cpp(665) : error C2511: 'drawCurve' : overloaded member function 'int (struct HDC__ *,struct tagPOINT [],struct HWND__ *)' not found in 'CNoteMgr'
d:\fancyviewer\notebook\notemgr.h(29) : see declaration of 'CNoteMgr'
D:\FancyViewer\Notebook\NoteMgr.cpp(838) : warning C4800: 'unsigned char' : forcing value to bool 'true' or 'false' (performance warning)
Generating Code...
Error executing cl.exe...
****************************************************************************************
PLEASE NOTE that the error id is "C2511".
I do not know where the point of overloading comes as the method names are different.
I found from MSDN regarding the error C2511 and tried all possibilities but still
the problem persists.
=========================================================================================
MSDN says that for the error C2511
'identifier' : overloaded member function not found in 'class'
No version of the function is declared with the specified parameters.
Possible causes :
(1)Wrong parameters passed to function.
(2)Parameters passed in wrong order.
(3)Incorrect spelling of parameter names.
The following sample generates C2511:
Example ->
// C2511.cpp
class C {
int c_2;
int Func(char *, char *);
};
int C::Func(char *, char *, int i) { // C2511
// try ...
// int C::Func(char *, char *) {
return 0;
}=========================================================================================
Can anyone help me out please ??
|
|
|
|
|
Changed as the folowing:
<br />
BOOL CNoteMgr::drawLine(HDC,HPEN,POINT*,HWND);<br />
BOOL CNoteMgr::drawCurve(HDC,POINT*,HWND);<br />
Because of your implementation is POINT[]
|
|
|
|
|
My app requires to update software from the internet.
I need to know the number of days from last update day to current day.
one solution is using GetSystemTime().
GetSystemTime() obtains year, month and day, but how to transfer SYSTEMTIME to absolute days, so number of days between the period can be calculated easily.
|
|
|
|
|
store the values in regisry and check while updating
"A winner is not one who never fails...but the one who never quits"
|
|
|
|
|
|
hi,
I wan't to play a movie clip in an application using Visual C++.
I think it is possible. Any body can give me an idea abt this.
Dream bigger... Do bigger...Expect smaller
aji
|
|
|
|
|
|
the easiest way is to insert a mediaplayer activex into ur project and call its funtions....
nave
|
|
|
|
|
Thats i already did.
Now i want to do it without using any Active X controls.
I know there is some way to do it.
Dream bigger... Do bigger...Expect smaller
aji
|
|
|
|
|
Insert Animation Control on dialog .
Add variable from it (m_AVICtrl);
add avi source to your project (IDR_AVI1);
call Open of variable :---> m_AVICtrl.Open(IDR_AVI1) ;
call Play function ---> m_AVICtrl.Play() ;
|
|
|
|
|
|
See mci functions
whitesky
|
|
|
|
|
Can you please tel some thing about the mci function...or any links????
Dream bigger... Do bigger...Expect smaller
aji
|
|
|
|
|
|
Hey all,
I need to do this operation
float x;
int y;
int z;
x= (float)((y-z)/60);
if(x % (int)x)!= 0)
{x = (int)x +1;
}
how do i do a mod of float and int. If x is an int then, I can use % operator. But in my case I need to find out if x = 2.1 then I need to round it to 3 ; also if x= 2.6, i need to round it to 3.
How can I do this? Can anyone help? Iam using VC++6.0
Thanks in advance.
|
|
|
|
|
<br />
x= (float)((y-z)/60);<br />
x=ceil(x);<br />
if(x % (int)x)!= 0)<br />
{<br />
x = (int)x +1;<br />
}<br />
|
|
|
|
|
hey what happens to
ceil(x);
if x =2.0, then will it be 2.0 or 3.0?
|
|
|
|
|
try this
float x = 2.1;
int n= x;
if( n < x )
{
n++;
x = n;// x will contain 3 now
}
nave
|
|
|
|
|
thanks for that.
how do i print a double value? i mean the type specifier?
|
|
|
|
|
|
Hi all . could any one show me how to use [B]Microsoft HTML Object Library [/B] in visual c++ 6 to extract data from html and populate it in listview. I have done this in visual basic 6 and i posted the code below . I be happy if an expert help me convert it to visual c++ 6 since i need it for a project that has to be done in visual c++ 6. My current visual c++ code retrives html of url and all now i need to be able to do extract the data i wanted from html and populate the listview with that data. I shown a picture of output in the pic.Thanks
code that retrives the html for me in visual c++ 6:
<br />
void CFindUserDlg::OnButton4() <br />
{<br />
<br />
HINTERNET hNet = ::InternetOpen("MSDN SurfBear",PRE_CONFIG_INTERNET_ACCESS,NULL,INTERNET_INVALID_PORT_NUMBER,0) ;<br />
HINTERNET hUrlFile = ::InternetOpenUrl(hNet,"http://www.mysite.com/Display.php",NULL,0,INTERNET_FLAG_RELOAD,0) ;<br />
<br />
char buffer[10*1024] ;<br />
<br />
DWORD dwBytesRead = 0;<br />
BOOL bRead = ::InternetReadFile(hUrlFile,buffer,sizeof(buffer),&dwBytesRead);<br />
<br />
SetDlgItemText(IDC_EDIT2,buffer);<br />
<br />
::InternetCloseHandle(hUrlFile) ;<br />
::InternetCloseHandle(hNet) ;<br />
<br />
<br />
<br />
}
visual basic 6 code:
<br />
<br />
Private Sub Command3_Click()<br />
'this function places data into listview<br />
' requires that you add a reference to the Microsoft HTML Object Library<br />
Dim mydoc As HTMLDocument<br />
Dim wombat As IHTMLElementCollection<br />
Dim lp As Long<br />
<br />
Set mydoc = New HTMLDocument<br />
<br />
'mydoc.body.innerHTML = "<html><head><p><ul><table border=1 cellpadding=4> " & _<br />
' "<tr><th>Name</th> > <th> color </th> </tr> " & _<br />
' "<tr><td>tony</td> <td>33023</td> " & _<br />
' "<tr><td>cindy</td> <td>16711935</td> " & _<br />
' "<tr><td>sarah</td> <td>3434343</td> " & _<br />
' "</table> </body></html>"<br />
<br />
mydoc.body.innerHTML = RichTextBox1.Text<br />
<br />
Set wombat = mydoc.getElementsByTagName("TR") ' Get the rows<br />
For lp = 1 To wombat.length - 1 ' Ignore first row<br />
Set LI = ListView1.ListItems.Add(lp, , wombat.Item(lp).All.Item(0).innerText)<br />
ListView1.ListItems(lp).ForeColor = wombat.Item(lp).All.Item(1).innerText<br />
LI.ListSubItems.Add , , wombat.Item(lp).All.Item(1).innerText<br />
<br />
Next<br />
End Sub
picuture of the output:
[IMG]http://i5.photobucket.com/albums/y180/method007/ListViewPop.jpg[/IMG]
|
|
|
|
|
Why dont you use Regular Expression to extract data?
|
|
|
|