|
I dont have any access to private member of the class that i inheritor from.
I inheritor from class CObject because i need to use Serialize.
This is my cpp fine code ( the h file code i add already )
#include "stdAfx.h"<br />
#include "MyFile.h"<br />
<br />
IMPLEMENT_SERIAL(CMyFile, CObject, 1);<br />
<br />
CMyFile::CMyFile(void)<br />
{<br />
}<br />
<br />
CMyFile::~CMyFile(void)<br />
{<br />
}<br />
<br />
void CMyFile::operator=(CMyFile& MyFile)<br />
{<br />
m_sData = MyFile.GetData();<br />
m_sPath = MyFile.GetPath();<br />
}<br />
<br />
void CMyFile::Serialize(CArchive &ar)<br />
{<br />
CObject::Serialize(ar);<br />
<br />
if(ar.IsStoring())<br />
{<br />
ar << m_sPath << m_sData;<br />
}<br />
else<br />
{<br />
ar >> m_sPath >> m_sData;<br />
}<br />
}
|
|
|
|
|
At which line exactly , it is showing error ?
|
|
|
|
|
In the last line of the h file.
|
|
|
|
|
Strange !
Can you mail me your dummy application having this error.
|
|
|
|
|
How can i send it ?
What your mail ?
|
|
|
|
|
prasad_s#mail_com
(replace '_' with '.' and '#' with '@'.)
|
|
|
|
|
I have one function to which I want to pass a pointer to a VARIANT:
THE FUNCTION
long CDlg::Add(int i, VARIANT *varVal)<br />
{<br />
varVal->bstrVal = m_cslist[i].AllocSysString();<br />
return m_Object.function(m_cslist[i], &varVal);<br />
}
FROM WHERE I CALL IT
VARIANT varVal;<br />
varVal.vt = VT_BSTR;<br />
for (int i := 0; i < 100; i++)<br />
{<br />
lErr = Add(i, &varVal);<br />
}
Well, doing this makes this to happen:
'function' : cannot convert parameter 2 from 'struct tagVARIANT ** ' to 'const struct tagVARIANT &'
I'd like to do it in this way, I'm using always the same variant as an auxiliary value, and some parameters are predefined (varVal.vt = VT_BSTR; ) for all the times I want to use it.
I believe that passing the entire value for several calls will slow down the entire process...
Thank you in advance.
|
|
|
|
|
Are you calling Add from within CDlg ?
(1) If the answer is YES, then the compiler cannot complain!
(2) If the answer is NO, then you're doing the wrong call (and the compiler, again cannot show the error posted).
Hence, sure that have you got that error?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
Yes, I have the error, the solution is on the next answer.
Thank you for your feedback!
|
|
|
|
|
OK, I was a bit blind last evening....
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
Try changing this line:
return m_Object.function(m_cslist[i], &varVal);
so it looks like this:
return m_Object.function(m_cslist[i], *varVal);
Steve
|
|
|
|
|
Great!
Seems so stupid to ask that...
|
|
|
|
|
ergarding to the question you sent about if the code was correct or not... I've misspelled that, I'm using other languages and I've not pasted the code directly so I've not written it correctly.
Thank you again.
|
|
|
|
|
hi guys ... Im having a problem installing Visual C++ 2005 Express. I've tried every trick i know but it's not working. I really need to work on this edition. I'm getting an error message after i extracting the files.
P/S: I've tried installing it with .net frame work 2 installed and removed. It did not work as well.
I've searched microsoft documentation and nothing in result.
winxp sp2
Any helps will be appreciated. thanks !!
|
|
|
|
|
I've tried real hard, but I can't for the life of me guess what the error message was...
|
|
|
|
|
Are your batteries low? Come on, Mark, THINK!
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
aha... what was it?
guys help......I hate Microsoft and its useless tech support.......
|
|
|
|
|
Nawar_nrr wrote: I hate Microsoft and its useless tech support.......
Well, if you describe the error you get the same as you did it here, I hardly see how they can help you.
Now, if you really want us to help you, don't you think that you should at least provide a clear explanation of your problem ? Simply saying that it doesn't work won't help us to narrow the problem
|
|
|
|
|
while loading installation components I have this error:
Suite Integration Toolkit Executable has encountered a problem and needs to close.
AppName: setup.exe AppVer: 8.0.50727.42 ModName: vsscenario.dll
ModVer: 8.0.50727.42 Offset: 0003a490
|
|
|
|
|
|
How to disable query timeout in CRecordset class connecting (using odbc) to a sql server 2005 database?
Please give me a hint, if you can. I tested a lot of settings in sql server, but did not succeed
//This is not a signature
while (I'm_alive) {
cout<<"I Love Programming";
}
|
|
|
|
|
Look at SQLSetStmtAttr with an opcode of SQL_ATTR_QUERY_TIMEOUT using the m_hstmt member of your CRecordSet as the SQLHSTMT param.
onwards and upwards...
|
|
|
|
|
Thank you. It's working in home, I hope it will in office
//This is not a signature
while (I'm_alive) {
cout<<"I Love Programming";
}
|
|
|
|
|
It's not a CDatabase, it's a CRecordset.
Anyway, thanks.
//This is not a signature
while (I'm_alive) {
cout<<"I Love Programming";
}
|
|
|
|
|