|
Did you try to use the debugger (F5 to start debugging and F9 to set/remove breakpoints) ? Because there you don't give us a lot of informations to help you....
|
|
|
|
|
Hi all,
Can u pls tell me how to call StoreProcedure from Oracle in VC++ using ODBC????
|
|
|
|
|
Teach yourself database programming in 21 days.
I guess it will help you. It has all the info regarding database programming in VC++
http://www.priyank.in/
|
|
|
|
|
May we access CMainFrame's members from CxxxView ?
Thanks in advance
|
|
|
|
|
You can use that:
((CMainFrame*)AfxGetMainWnd())-> ....
Hope this helps
|
|
|
|
|
May we access CxxxView's members from CMainFrame ?
Thanks in advance
|
|
|
|
|
Yes, you can use GetActiveView() like that:
CxxxView* pView = (CxxxView*)GetActiveView();
|
|
|
|
|
They appear these errors:
k:\paint\paintview.h(21) : error C2143: syntax error : missing ';' before '*'
k:\paint\paintview.h(21) : error C2501: 'CPaintDoc' : missing storage-class or type specifiers
k:\paint\paintview.h(21) : error C2501: 'GetDocument' : missing storage-class or type specifiers
Thanks in advance
|
|
|
|
|
Yesm you probably need to add #include "paintdoc.h" at the begining of your paintview.cpp file.
|
|
|
|
|
Normally, I do not need to add line 'include "PaintDoc.h"', why do we need to add this line now ?
More:
void CMainFrame::SetFColor(UINT nID)
{
CBitmap bitmap;
bitmap.LoadBitmap(nID);
HBITMAP hBitmapOld = ((CStatic*)m_wndMyDialogBar.GetDlgItem(IDC_FCOLOR))->SetBitmap(bitmap);
bitmap.Detach();
if(hBitmapOld != NULL)
DeleteObject(hBitmapOld);
CPaintView* pView;
pView = (CPaintView*)GetActiveView();
pView->m_clrBorderColor = m_clrFColor;
//SendMessage(WM_PAINT);
}
They appear an error here pView->m_clrBorderColor = m_clrFColor;
Thanks in advance
|
|
|
|
|
hcmuns wrote:
pView->m_clrBorderColor = m_clrFColor;
What is the error ?? Maybe because m_clrBorderColor is a private member of CPaintView ? It is a better principle to make all the member variables private and use Get/Set function to access the data
|
|
|
|
|
They both are public members.
I will try set and get functions.
Thanks in advance
|
|
|
|
|
They appear errors when my program is running.
Thanks in advance
|
|
|
|
|
Could you be more specific ??? It is simply impossible to help you with so few information... What are the errors, when did they happen.....
|
|
|
|
|
Please give me email, I will send the program to you.
Thanks in advance
|
|
|
|
|
hcmuns wrote:
Please give me email, I will send the program to you
Nope because:
1) I don't have visual studio installed here so I will need to dig into your code to find the errors without being able to compile it.
2) I don't have the time to correct the project for you. I can help you a little bit but don't ask me to do the job for you
3) You will never become a good programmer if whenever you have a problem you ask the other to do the job for you.
Some guidelines to help you:
Try to use the debugger which is a really powerfull tool and help you to see variables values and see where the program crashes.
Try to formulate correctly the problem. In general, some problems can simply be solved just by a good description of the problem (it becomes much clearer).
If you still have problems I suggest you to start a new thread in the forum (because it is no more related to the first subject) with a good descritption of the problem and eventually some source code (minimalistic otherwise nobody will read it)
|
|
|
|
|
Thank you for your help
|
|
|
|
|
My email : hcmuns@gmail.com
Thanks in advance
|
|
|
|
|
how to crop an image in an application based on dialog? with thanks!
qqworm
|
|
|
|
|
|
(Cropping images)there is an image,which is 696*344,I want to put a box(200*150) on it, then i move the box to the right position with the mouse , at last,i can get a new image which is 200*150. Now I can't complete this , for help,With thanks.
qqworm
|
|
|
|
|
i have two questions:
•say i have a class 'xyz' for example!and i create dynamically the objects!now to create this object,there must be information abt the class in the code!,so where does this code reside?
•is 'delete this' a valid statement?if so,where all is it valid and where all does it become invalid!
"faith, hope, love remain, these three.....; but the greatest of these is love" -1 Corinthians 13:13
|
|
|
|
|
Don't use delete this.
If you write code for the class xyz:
<br />
class xyz<br />
{<br />
xyz(){<br />
_a = 5;<br />
}<br />
<br />
public int someFunction(){<br />
return _a;<br />
}<br />
<br />
private int _a;<br />
};<br />
when you say dynamically create I assume you write "xyz variable = new xyz();"
Then you acess it "int retVal = variable.someFunction();"
Then you delete the dynamically created object "delete variable;"
This is very basic stuff you need to google.
Take a look at some of these[^]
|
|
|
|
|
I can't understand your first question. When you do new XYZ(); , the compiler emits code to allocate enough memory for XYZ(sizeof(XYZ)) and to call XYZ's constructor. When you run the program, that code executes and you get back a pointer to a dynamically allocated instance of XYZ.
delete this is valid, but is not recommended (except for special situations, like COM reference counting implementation..). Just make sure that you don't reference any member variables after you call delete this ;
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Just make sure that you don't reference any member variables after you call delete this;
yes.....does that go with all the variables in that AFTER the 'delete this' in that function/class or does that go with ALL THE VARIABLES after the 'delete this' even for other classes and functions of the the program?
by the way,the first question is not how the new /delete operators work(that was just to quote!),i guess i didnt make that clear enough.....
what i meant is that:
if i need to create an instance,be it dynamic/static,where does it actaually reside before it is called/created?
that is.....say for example.....
class xyz
{
int a;
}
void main()
{
.....
.....
.....
if(some condition becomes true only the do the following loop)
{
xyz r;
}
}
if the above condition becomes true, only then the variable is created!if not(since static)does the compiler anyway allocate the space in the stack even before checking the condition?coz if it doesnt,doesnt that mean itz almost equivalent to saying that it is dynamically creating the object(though the object isnt created dynamicaly)!
what i mean is ,where is the class actually stored?is it along with the code?
ps:dumb doubtz though.....but i would like em cleared!
"faith, hope, love remain, these three.....; but the greatest of these is love" -1 Corinthians 13:13
|
|
|
|