|
thanks !
I google is before,but still have no solution.
|
|
|
|
|
I got this error few days back (because of code base is complied from mapped network drive)
Once network was OK, Rebuilt and done.
.
HTH
Abhi
|
|
|
|
|
No prob, I just thought you might have not.
http://support.microsoft.com/kb/195738[^]
This was just the first hit that I got and I thought it might help.
Cheers
You have the thought that modern physics just relay on assumptions, that somehow depends on a smile of a cat, which isn’t there.( Albert Einstein)
|
|
|
|
|
Remember facing this before, but can't recall how did it got resolved . Can you try cleaning up the temp files/folder using CCleaner?
-Suhredayan
|
|
|
|
|
I tried ,but failed too...
If I update the Platform SDK Windows Server 2003 R2 ,isn't again ?
|
|
|
|
|
Hi to All,
I have 4 rows of data has to be saved in a binary file system . I haven't use it before, Can anyone please help me with this
EG:
struct A
{
int a1;
int a2;
}
struct B
{
int b1;
int b2;
}
struct C
{
int c1;
int c2;
}
How do I write and read this values from the file system??
-----------------------------
I am a beginner
|
|
|
|
|
You may simply store the struct s as row, binary data. For instance (error checking left to the reader):
struct A
{
int a1;
int a2;
};
A a;
FILE * fp = fopen("data.raw", "wb");
fwrite(&a, sizeof(a), 1, fp);
fclose(fp);
For an object oriented approach see Object Serialization [^](for instance MFC framework supports it).
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
thanks for your reply.
But my problem is I have more then 2 structure and I need to search or write at runtime.
-----------------------------
I am a beginner
|
|
|
|
|
You may do a step toward serialization, storing type info just before actual data, for instance:
enum SER_TYPES
{
eTypeI,
eTypeD,
};
struct I
{
int i1, i2;
};
struct D
{
double d1, d2, d3;
};
void store(FILE *fp, I * pi)
{
int t = eTypeI;
fwrite( &t, sizeof(int), 1, fp);
fwrite( pi, sizeof(*pi), fp);
}
void store(FILE *fp, D * pd)
{
int t = eTypeD;
fwrite( &t, sizeof(int), 1, fp);
fwrite( pd, sizeof(*pd), fp);
}
int main()
{
FILE * fp = fopen("data.raw", "wb");
I i,j;
D d,f;
store(fp,i);
store(fp,d);
store(fp,j);
}
On reading, you've to first read the type of the stored data and then, according to the type, read the actual data.
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
thanks ,
that's the exact one i was looking for...In fact I dont have knowledge on serialization, But i have also reached t that point..Now I am having problem on reading...
just for ur information.....my incomplete code is given below
I have used class instead of struct
class tableSructureUnknown
{
};
class tableSructure1: public tableSructureUnknown
{
public:
int x;
int y;
};
class tableSructure2: public tableSructureUnknown
{
public:
int x2;
int y2;
};
class listTable
{
public:
int id;
int size;
char tName[20];
};
listTable ArrTableInfo[]=
{
{TFX_TABLE1,sizeof(tableSructure1), "first"},
{TFX_TABLE2,sizeof(tableSructure2),"Second"},
{TFX_UNKNOWN,0,"Unknown"}
};
FILE *ptr_myfile;
int writeToFileTable(int tableId,tableSructureUnknown *lpbaseTableClass)
{
ptr_myfile=fopen("test.bin","w");
if (!ptr_myfile)
{
printf("Unable to open file!");
return 1;
}
for(int i = 0; (ArrTableInfo[i].id != TFX_UNKNOWN) || (ArrTableInfo[i].id != tableId) ;i++)
{
fwrite(&ArrTableInfo[i], sizeof(listTable), 1, ptr_myfile);
ptr_myfile=fopen("test.bin","w");
if (!ptr_myfile)
{
printf("Unable to open file!");
return 0;
}
fwrite(&lpbaseTableClass, ArrTableInfo[i].size , 1, ptr_myfile);
break;
}
fclose(ptr_myfile);
return 1;
}
tableSructureUnknown* ReadFromFileTable(int tableId)
{
for(int i = 0; (ArrTableInfo[i].id != TFX_UNKNOWN) || (ArrTableInfo[i].id != tableId) ;i++)
{
}
tableSructureUnknown* temp = NULL;
return temp;
}
int main(int argc, char* argv[])
{
tableSructure1 Mytable1;
Mytable1.x = 1;
Mytable1.y = 11;
tableSructureUnknown *lpbaseTableClass = &Mytable1;
writeToFileTable(TFX_TABLE1,lpbaseTableClass);
tableSructure2 Mytable2;
Mytable2.x2 = 2;
Mytable2.y2 = 22;
lpbaseTableClass = &Mytable2;
writeToFileTable(TFX_TABLE1,lpbaseTableClass);
-----------------------------
I am a beginner
|
|
|
|
|
I have 2 classes.
Class A:
void CDbModReactor::objectModified(const AcDbDatabase* pDb,
const AcDbObject* pDbObj)
{
AcAxDocLock docLock(pDbObj->ownerId(), AcAxDocLock::kNormal);
if(docLock.lockStatus() != Acad::eOk)
return;
else
gpDlg->OnCopy2Excell("modified", pDbObj);
}
Class B:
void CSampDialog::function1()
{
FILE * pFile;
pFile = fopen ("C:myfile.csv","a");
if (pFile!=NULL)
{
CString x2 = Cent_X+","+Cent_Y+"\n";
fwrite(x2, x2.GetLength(), 1, pFile);
fclose (pFile);
}
}
Now i have to call the function void CDbModReactor::objectModified(const AcDbDatabase* pDb, const AcDbObject* pDbObj) from void CSampDialog::function1()
How can i call...
Please help me...
G.Paulraj
|
|
|
|
|
Paulraj G wrote: How can i call..
Create an instance of the CDbModReactor class and call the function as required. This is basic C++, and if you do not understand how to do it you may need to go back to your learning materials.
|
|
|
|
|
Hi...
Thanks for your reply.
This is the basic thing that i know.
but i don't have variable to pass from here.
if i call the function like
CDbModReactor cdbmod;
cdbmod.objectModified();
that shows error. also i have tried like
CDbModReactor cdbmod;
cdbmod.objectModified(pDb, pDbObj);
i don't have variables. that is the problem.
with out variables how can i call the function?
G.Paulraj
|
|
|
|
|
You cannot call the function without variables.
Wout Louwers
|
|
|
|
|
|
Like I said before, I think you need to go back to learning the basics of classes and objects. Your call to cdbmod.objectModified() needs to pass the parameters required by that method.
|
|
|
|
|
In your own code...
gpDlg->OnCopy2Excell("modified", pDbObj);
That seems to me as a external call from your class "CDBModReactor" to the class pointed by "gpDlg" containing the function "OnCopy2Excell", so... if this is like that... you have answered your question by yourself. (Supposing you have written the code)
Regards.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
Rating helpfull answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
Hi to All,
Could anyone please help me choosing the best STL container to Hold a table (DB table)...
Thanks in advance,
-----------------------------
I am a beginner
|
|
|
|
|
That depends on your need
well my suggestions are:-
I think stl map [^] will be very well suited, if you have a lot searching operations.
Since it is DB table, i think it may be need to have a lot of searching.
But if you have add a lot element and no need for searching then list will be better [^].
Величие не Бога может быть недооценена.
|
|
|
|
|
thanks,
Now, after reading from database I need to put the data of a small table in a file system...please provide some hints to do that...
-----------------------------
I am a beginner
|
|
|
|
|
I'm sure it's not the answer you wanted, but It depends upon your data. It also depends upon how you want to use that data. Start by having a look at something that describes the STL Container types and see if it gives any clues. Is there a reason why you want to put the data in a container?
|
|
|
|
|
I got my answer, depending on the need i guess i will go for map
thanks,
Now, after reading from database I need to put the data of a small table in a file system...please provide some hints to do that...
-----------------------------
I am a beginner
|
|
|
|
|
It really depends on how you want to access table items.
Yuo may, for instance use a vector of struct , where each struct contains one row.
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Often you will have to combine multiple containers as per your requirements. For example to create a 2D array you can use a vector or vectors
vector< vector<int> > a;
|
|
|
|
|
Hi all,
I have a problem with sockets inside a thread: it seems the socket object is not working inside the thread.
I'm using a Socket library found on the net and the "socket.h" library from windows.
This code works:
<br />
SocketClient s(ServerAdress, ServerPort);<br />
s.SendLine("aaa");<br />
while (1) <br />
{<br />
string l = s.ReceiveLine();<br />
if (l.empty()) break;<br />
cout << l;<br />
cout.flush();<br />
}<br />
Now I'm trying to do the same thing in a thread... I have a function:
<br />
void Answer(void* param) <br />
{ <br />
SocketClient* ps = (SocketClient*)param;<br />
ps->SendLine("GET / HTTP/1.0");<br />
ps->SendLine("Host: www.google.com");<br />
ps->SendLine("");<br />
<br />
while (1) <br />
{<br />
string l = ps->ReceiveLine();<br />
if (l.empty()) break;<br />
cout << l;<br />
cout.flush();<br />
}<br />
delete ps;<br />
} <br />
And I call it in this way:
<br />
_beginthread(Answer, 0, &s);<br />
All is compiling fine, but then the Socket inside the thread seems to be useless, it doesn't do nothing.
Can anyone explain me how to pass object between threads?
Is there a possibility to pass them without pointers?
I'm quite new in C++ and I found nothing on the net so far.
Thanks!
gianca
|
|
|
|
|