|
|
What is the error message?
|
|
|
|
|
From your code snippet, two things are missing in the serialize function. The variables "dem" and "data" do not seem to have been declared. I'm assuming based upon your naming conventions that member variable start with a "m_" so it would appear these are not member variables at first glance.
// Copy of your snippet
void CQuestionData::Serialize(CArchive &ar)
{
CObject::Serialize(ar);
if(ar.IsStoring()) {
} else {
// TODO: add loading code here
if (!ar.ReadString(data)) {
return;
}
ar.ReadString(data);
while(data != "") {
if(data == "#Q") {
m_count++;
ar.ReadString(data);
m_sQues = data;
ar.ReadString(data);
} else {
if(data == "#A") {
ar.ReadString(data);
while(data != "#Q") {
m_arrAns[dem++] = data;
ar.ReadString(data);
}
}
}
}
}
}
|
|
|
|
|
|
whale84 wrote: when my application is running, it suddenly stand by.
So why not use your debugger to step through the code to find the statement(s) that are "standing by?"
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I click on menu File=>Open Workspace then select *.dsw file that I want.
but nothing load to VC++.
Please advise me for solve this problem.
I use Visual c++ 6.
|
|
|
|
|
|
Try the following:
1. Close VC++.
2. Delete the *.opt, *.ncb, *.aps and *.clw files (don't worry - they will be recreated later).
3. Reopen the VC++ and select your *.dsw.
|
|
|
|
|
|
Can you tell me more.
What is the root cause of this problem?
|
|
|
|
|
These files are generated by VC++. They contain information about your project/workspace, for example the *.clw holds Class-Wizard information and *.ncb contain intellisense data for your project.
When VC++ loads your project, it collects data from these files (if they do not exist, they are rebuilt).
If one of these files gets corrupted (don't ask me why, but it happens , then VC++ fails to load your project/workspace. So the solution is to just delete these files and let VC++ rebuild them properly ...
|
|
|
|
|
What is the function that can be used to clear the data in the list box to display new data?
--Star
|
|
|
|
|
|
|
led mike wrote: They hide that information in the documentation[^]
Mean bastards.
Shog on learning VB6: Ah, that would have been VB6. Kicked my ass anyway. So easy to learn, just like falling down a flight of stairs...
|
|
|
|
|
|
Hi all:
I am supposed to extract the following string "cosc.exe" from a longer string "C:Program Files/Local_user/Visual Studio 2005/Project/Debugger/cosc.exe"
But I am not really sure how I am going to do it.
Can anyone help?
Thank you
|
|
|
|
|
What string class are you using ? Are you using MFC ? Are you using std::string ? Are you just using C ( that is, are you using char * to store a string ) ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi:
Thank you for your reply.
I am using std::string, C++.
|
|
|
|
|
Your slashes are backwards
"C:Program Files/Local_user/Visual Studio 2005/Project/Debugger/cosc.exe"
should be
"C:Program Files\Local_user\Visual Studio 2005\Project\Debugger\cosc.exe"
/////////////////////////
std::string sPath="C:Program Files\\Local_user\\Visual Studio 2005\\Project\\Debugger\\cosc.exe";
std::string sSearch="cosc.exe";
// If looking for the string directly
int nIndex=sPath.find(sSearch);
TRACE("Found \"%s\" at index = %d\n",sSearch.c_str(),nIndex);
/*
If you need to search out the filename
from a given path
*/
nIndex=sPath.rfind("\\");
std::string sExtract=sPath.substr(nIndex+1,sPath.length()-nIndex);
TRACE("Found '\\' at index = %d\n",nIndex);
TRACE("Filename from path is \"%s\"\n",sExtract.c_str());
|
|
|
|
|
Hi:
Thank you very much for your help. I really appreciate it.
Thank you
|
|
|
|
|
// Console.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
#include <shlwapi.h>
#pragma comment(lib, "shlwapi.lib")
int main(int arvc, char* argv[])
{
LPCTSTR pFileName = PathFindFileName("C:Program Files/Local_user/Visual Studio 2005/Project/Debugger/cosc.exe");
std::cout << pFileName << std::endl;
return 0;
}
Steve
|
|
|
|
|
i get this error :
error C2664: 'new_array' : cannot convert parameter 3 from 'double (*)[10][2]' to 'double *[][2]'
do i type the Array wrong ?
<code>
code:
void find_values( long p[] ,int nCount ,double *pmid , double *ps);
void new_array(long p[] , int nCount , double *dp[][2]);
void print_array2( double p[][2] , int fCount);
int main()
{
double dp[N][2];
new_array(pinakas ,N ,&dp);
print_array2( dp , N);
}
void find_values(long p[] ,int nCount , double *pmid , double *ps)
{
double mid , s;
mid =0;
s = 0;
for ( int i =0 ; i < nCount ; i++ )
{
mid = mid + p[i];
}
mid = (mid/nCount);
for (int z = 0 ; z < nCount ; z++)
{
s = s + (p[z] - mid)*(p[z] -mid);
}
s = pow((s/(nCount -1)) , (1/2));
*pmid = mid;
*ps = s;
}
void new_array(long p[] , int nCount , double *dp[][2])
{
double min , s;
find_values( p,nCount ,&min , &s);
for (int i = 0 ; i < nCount ; i++)
{
*dp[i][1] = p[i];
if ( p[i] > min )
{
if ( p[i]*0.85 > min)
{
*dp[i][2] = p[i]*0.85 ;
}
else
{
*dp[i][2] = p[i];
}
}
else
{
if (p[i]*1.15 <min)
{
*dp[i][2] = p[i]*1.15;
}
else
{
*dp[i][2] = p[i];
}
}
}
} </code>
-- modified at 5:48 Sunday 20th May, 2007
|
|
|
|
|
how i put my code in the site like quote ? (so it can take the tabs that has in Visual studio Eviroment)
if( x == y )
{
y = x ;//used spaces
}
and not
if ( x ==y)
{
y=x;
}
or you only can do it with hiting space many times
|
|
|
|
|
Immunity18 wrote: how i put my code in the site like quote ? (so it can take the tabs that has in Visual studio Eviroment)
check the "Ignore HTML tags in this message (good for code snippets)" checkbox before submitting code snippets.
|
|
|
|