|
includeh10 wrote:
by the way, i am sure it is strong related to visual c++.
Only if the disc contains pirated copies of Visual C++ :P
--
Please state the nature of your medical emergency.
|
|
|
|
|
file_length = (int) src_topic_file->GetLength();
total_topics = file_length / TOPIC_SIZE;
TopicVector.SetSize(total_topics);
for (int i=0; i<total_topics; i++)
{
src_topic_file->Seek(TOPIC_SIZE*i,0);
dwRead = src_topic_file->Read(buffer, TOPIC_SIZE);
topic.SetTopicData((TOPIC*)buffer);
TopicVector.Add(topic);
}</code> TopicVector is CArray<CTopicItem,CTopicItem>
topic is CTopicItem as well (derived from CObject)
I have a Compile Error on the .Add line with
Cannot Convert Parameter 1 from CTopicItem to CTopicItem
am I doing something wrong?
Ryan Baillargeon
Software Specialist
Fuel Cell Technologies Inc.
|
|
|
|
|
Did you make CTopicItem copy c'tor protected or private? CArray::Add uses 2nd template argument as data type of its parameter, so basically you're passing CTopicItem by value, which involves copying.
Tomasz Sowinski -- http://www.shooltz.com
*** Si fractum non sit, noli id reficere. ***
|
|
|
|
|
Thank you.
(for making me revel in my own stupidity).
The class didnt have the = or copy constructor.
Ryan Baillargeon
Software Specialist
Fuel Cell Technologies Inc.
|
|
|
|
|
You may consider changing 2nd CArray template argument to const CTopicItem & anyway. This will change the way arguments are passed to CArray::Add and few other methods.
Tomasz Sowinski -- http://www.shooltz.com
*** Si fractum non sit, noli id reficere. ***
|
|
|
|
|
Can you please show me what my operator= function should look like?
Ryan Baillargeon
Software Specialist
Fuel Cell Technologies Inc.
|
|
|
|
|
It depends on the internals of CTopicItem of course.
Tomasz Sowinski -- http://www.shooltz.com
*** Si fractum non sit, noli id reficere. ***
|
|
|
|
|
Hi,
While going through the Codeproject site I came across couple of very good demo projects which have been done in VC7 I did not find any .dsp/.dsw files in it instead there was .vcproj and .sln is there any way by which I can run the same project in VC6
thanks
- Nilesh
|
|
|
|
|
|
Thanks
- Nilesh
|
|
|
|
|
I'm trying to update a modal dialog box with the current time using win32 sdk programming.
Thanks
|
|
|
|
|
So what exactly is your problem?
Tomasz Sowinski -- http://www.shooltz.com
*** Si fractum non sit, noli id reficere. ***
|
|
|
|
|
You'll need to add a timer. Look up WM_TIMER
Michael
"I've died for a living in the movies and tv.
But the hardest thing I'll ever do is watch my leading ladies,
Kiss some other guy while I'm bandaging my knee."
-- The Unknown Stuntman
|
|
|
|
|
Hi,
How do I create a wizard template ( i.e. project template ) like what we see in visual studio.
- Nilesh
|
|
|
|
|
It wont compile:
void CEnchangeView::OnButtonisdigit()
{
CString x = "1234";
int nret = isdigit((int)x);
}
I'm trying to figure out which of my strings are numerical.
Appreciate your help,
ns
|
|
|
|
|
Get each charecter from the CString with GetAt method and check it's ascii value.
hope that would help
- Nilesh
|
|
|
|
|
Thanks for the hint. I think its fine, since its returning nonzero values (is a digit).
Appreciate your help,
ns
|
|
|
|
|
Here ya go.
bool isDigitString (CString strDigits)
{
long nValue;
bool bIsDigits = (sscanf (strDigits.GetBuffer(0). "%d", &nValue) == 1);
strDigits.ReleaseBuffer();
return (bIsDigits);
} PS: My mom says hi! Last weekend she asked me "What's Java?". Blew my mind!
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
I am rapidly accumulating a word doc of the snippets i get off CP...handy. Say hello to your mom from me too...BTW I consume mass quantities of Jello (or not so much)....
I have a peculiar system mmenu crash I posted about if you want to check it out (of course you dont have to ).
We get 59 minutes off work tomorrow - yay, but I might have to go help set up some dumb food event at the base here. I got stuck with collecting donations etc. Ugh!
Appreciate your help,
ns
|
|
|
|
|
accumulating a word doc of the snippets i get off CP
Cool!
Say hello to your mom from me
Will do!
system menu crash
Hmm, need more info. As Tomasz said, can you pinpoint where your app dies? Also, is it an ASSERT failure or something else?
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
just posted the update to the crash thread
Appreciate your help,
ns
|
|
|
|
|
Anyone know anything about Forking Emails from within a SMTP Transport Event Sink ?
Thanks,
Alex Cachia.
|
|
|
|
|
Since both concepts are to me completely foreign:
What does "Forking Emails" mean to you, and what would an "SMTP Transport Event Sink" be?
|
|
|
|
|
I have:
( Iforgot how to format the less than sign for CP...)
CString * p;
p = new CString [iArraySize];
for (int i=0;i less than iArraySize;i++)
{
p [i] = pArray[i];
}
int nIndex = InsertItem(LVIF_TEXT|LVIF_STATE, nPos, p[0],0,LVIS_SELECTED,0,0);
ASSERT(nIndex != -1);
if (nIndex < 0) return(nIndex);
for ( i = 1; i (less than) iArraySize; i++) {
SetItemText(nIndex, i, p[i]); }
From MSDN,
BOOL SetItemText( int nItem, int nSubItem, LPTSTR lpszText );
So I think its my third argument thats a problem. How do I fix it so that the two are reconciled?
Thank you and
Appreciate your help,
ns
|
|
|
|
|
Ooooohhhhh my gode!
sometimes it helps to look at the IL generated code
a MS guy on develop.com "answering" .NET issues
|
|
|
|