|
I cant find the implementation of say CMemoryException so I can pattern my class after it. THe .cpp files that came up in search of the MFC src folder didnt seem to have this class definition as far as I could see...
Thanks,
ns
|
|
|
|
|
It's in mfc\include - afx.h and afx.inl.
Tomasz Sowinski -- http://www.shooltz.com
*** Vodka. Connecting people. ***
|
|
|
|
|
How do you open an inl file? Doesnt open in Vstudio...
afx.h has the class definition, definitely useful. Now i need to find the body of the class...maybe its in the inl?
Thanks,
ns
|
|
|
|
|
ns wrote:
How do you open an inl file? Doesnt open in Vstudio...
Geez - did you parachuted from VB recently?
Just drag'n'drop the file or use File|Open.
Tomasz Sowinski -- http://www.shooltz.com
*** Vodka. Connecting people. ***
|
|
|
|
|
Thanks - but I stil didnt find the body of the functions.
and no, I am not too familiar with either VB or VC, (but want to be)
Thanks,
ns
|
|
|
|
|
Try to use Find in Files. Search in mfc\include and use CMemoryException:: (with two semicolons) as search string.
Tomasz Sowinski -- http://www.shooltz.com
*** Vodka. Connecting people. ***
|
|
|
|
|
derive from it and add ur own custom data if u want
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
I use VC++'s online help for summary information about classes and APIs. However, if you want to ensure you have the latest and greatest docs (my installed online help is pretty old), see this MSDN link[^].
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
hi,
if i start my mdi vc++ programm, the mdi is not as big as it could. is there a possibility how my mdi programm could be as big as it could, anytime when i start the programm?
sunny
|
|
|
|
|
In the OnInitInstance method of your application,
replace
m_pMainWnd->ShowWindow(m_nCmdShow);
by
m_pMainWnd->ShowWindow(SW_SHOWMAXIMIZED);
HTH,
So I came to find
To end up this way
Feeling like I'm God
Feeling there's no way
KoRn, "No Way"
|
|
|
|
|
Good for p0rn sites.
if you start putting in too manay features, it no longer remains useful for beginners
quote in a CP article comment, shiraz baig
|
|
|
|
|
ShowWindow ( SW_MAXIMIZE );
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Replace m_nCmdShow with SW_SHOWMAXIMIZED in the call to ShowWindow inside CYourApp::InitInstance.
Tomasz Sowinski -- http://www.shooltz.com
*** Vodka. Connecting people. ***
|
|
|
|
|
I developed a COM project in VC++ 6.0 and it runs successfully. But now when i try to compile it on VC++ 7.0, the compiler is giving me strange error. Where ever there is a statement like a=22 or name = "abc", the error is reported that the symbol "=" is ambiguous. Can any one tell me whats the problem
|
|
|
|
|
i think it means that "=" has 2 functions in vc7. i only use vc6 so cant test it, but ambiguous means "two meanings" so my theory is that "=" can do 2 things and the compiler isnt sure what you want it to do...i wouls suggest looking it up in msdn if you have it, or if not, its at www.msdn.microsoft.com and get to the msdn libray from there to look it up.
Hope this helps,
Sas
|
|
|
|
|
try to typecast the value you want to assign. Sometimes a number can be of several types (int/long/...) and all those are overloaded. So you have to explicit tell the compiler which conversion to use.
e.g. if your variable a has an overloaded operator= which takes a right hand
type of int and another which takes a long, then you would have to write either a=(int)22; or a=(long)22;
Sure, it won't complain about ints and longs (internal conversion), but other types may need explicit type conversion (strings e.g. can be of many different types: unicode, utf8, chars, BSTR, ...)
|
|
|
|
|
I've only used CFormView so far, and draw the controls directly on the form. Is it possible to put a control on a CView? Theres no place to draw the controls. Or does this have to be done by code like this or something. My question really is do we have to go through the hard work of code, or is it possible to use the ToolBox somehow with the readymade controls?
CButton myButton;
myButton.Create (..);
myButton.MoveWindow(..)
Thanks,
ns
|
|
|
|
|
ns wrote:
My question really is do we have to go through the hard work of code, or is it possible to use the ToolBox somehow with the readymade controls?
If you want to use toolbox, then CFormView is your only option.
Tomasz Sowinski -- http://www.shooltz.com
*** Vodka. Connecting people. ***
|
|
|
|
|
Who defines _DEBUG? When there is code that says
catch{
#ifndef _DEBUG
{
DoStuff();
}
#endif
}
does this mean DoStuff() will run only at runtime? Does the _DEBUG definition automatically vanish at runtime? Like if I had DoDebugStuff() within a #ifdef _DEBUG statement , it would run when the code is in debug mode?
Side Question: Does debug mode mean we are working with the project configuration set to Debug?
Thanks,
ns
|
|
|
|
|
ns wrote:
Who defines _DEBUG?
Usually it's in project settings for debug build. #if and friends are used to conditionally *compile* code, so if you don't have _DEBUG defined in your example, there will be no DoStuff call in code at all. It's not checked at runtime.
Tomasz Sowinski -- http://www.shooltz.com
*** Vodka. Connecting people. ***
|
|
|
|
|
So in my release build, #ifdef _DEBUG is ignored and an #ifndef _DEBUG will run ? Or is there something like
_RUN or something that makes code run at runtime thats within #ifdef _RUN execute?
Thanks,
ns
|
|
|
|
|
New to this so this is what I'm thinking it is:
In general CException will catch the errors; to go with 'new' CMemoryException will catch the errors. So if I have code as follows, do I have the right idea?
CAn I go through my code and put a try at the start of all my functions, and catches at the end?
What kind of error would CreateDispatch throw?
Where can you get information on the types of errors that various operations can produce?
_com_error : I havent found this in MSDN. If my MAkeDB function is a VB dll doing database stuff and something goes wrong in it, does the calling VC code get a _com_error?
try
{
CString dataBaseName0 = "C:\\ImagesSep25.mdb";
CString strFile0 = "C:\\Trainer\\final1.pma";
CString imgFolder0 = "C:\\mines4";
char* dataBaseName = new char[dataBaseName0.GetLength() +1];
strcpy(dataBaseName, dataBaseName0);
char* imgFolder = new char[imgFolder0.GetLength() +1];
strcpy(imgFolder, imgFolder0);
char* strFile = new char[strFile0.GetLength() +1];
strcpy(strFile, strFile0);
USES_CONVERSION;
_bstr_t b_dataBaseName = A2W( dataBaseName );
_bstr_t b_strFile = A2W(strFile);
_bstr_t b_imgFolder = A2W(imgFolder);
_CBCreator4 p;
p.CreateDispatch("DBCreator4.Class1");
p.MakeDB(b_strFile,b_dataBaseName,b_imgFolder,CMHandle
delete[] etc
}
catch(CException &e)
{
CString ErrorStr;
_bstr_t bstrSource(e.Source());
_bstr_t bstrDescription(e.Description());
ErrorStr.Format( " Error\n\tCode = %08lx\n\tCode meaning = %s\n\tSource = %s\n\tDescription = %s\n",
e.Error(), e.ErrorMessage(), (LPCSTR)bstrSource, (LPCSTR)bstrDescription );
#ifdef _DEBUG
AfxMessageBox( ErrorStr, MB_OK | MB_ICONERROR );
#endif
}
catch (CMemoryException &e)
{
CString ErrorStr;
_bstr_t bstrSource(e.Source());
_bstr_t bstrDescription(e.Description());
ErrorStr.Format( " Error\n\tCode = %08lx\n\tCode meaning = %s\n\tSource = %s\n\tDescription = %s\n",
e.Error(), e.ErrorMessage(), (LPCSTR)bstrSource, (LPCSTR)bstrDescription );
#ifdef _DEBUG
AfxMessageBox( ErrorStr, MB_OK | MB_ICONERROR );
#endif
})
Also I see that they have a MessageBox when errors happen when in Debug mode. In runtime mode, can I put in code in my catch block that does operations with the variables defined in the class or locally defined in the function the catch belongs to? , or do I have to pass them in? Like :
catch (_com_error &e)
{
/#ifndef _DEBUG
<code> m_db.Close(); </code>
#endif
return;
}
Thanks,
ns
|
|
|
|
|
i wrote a FTP application o download file from an ftp folder
Many pupls can upload files in to that FTP folder,and my aplication downloads them in a sepecific interval...
my problem is ,my app try to download the files , even if they are not completly transfered...
How can i determine a particular file is on the Uploading status ie, not uploaded completly in that time...
regards
renjith
---------------------------------------------------------
A Programmer Never Dies..***
|
|
|
|
|
AFAIK this is something your FTP server has to handle. I think mine dont show/offer a file until it's completly uploaded, but I'm not sure on this.
|
|
|
|
|
but here...
when the time of downloading ,the uploaded content at the prensent time will be downloaded...
i tested that with many files with various size...
is there any solution..??
_____________________________________________
A Programmer Never Dies..***
|
|
|
|