|
It probably works but I don't believe it accurately indicated whether a machine is connected to
the internet though....maybe on a specifically configured network...
Actally I just reread it - in the context of dialup maybe it's ok. On a LAN though, I
don't think so.
I was just sceptical, that's all
The OP's question to me is petty vague. Does he want to know if there's a network adapter, if
the cable's plugged in, is there internet access...
Cheers!
Mark
"Great job, team. Head back to base for debriefing and cocktails."
(Spottswoode "Team America")
|
|
|
|
|
You're right (to some extent).
If you're accessing internet through NAT/router, you won't get correct results.
But function works ok for direct connection... that was the question, I guess
Best regards,
Dmitry.
-------------------------
Don't worry, be happy )
|
|
|
|
|
Hi all,
I have the following class, with structure and function:
class CIniFile
{
public:
struct Record
{
string Comments;
char Commented;
string Section;
string Key;
string Value;
};
static vector<Record> GetSection(string SectionName, string FileName);
So now I call the function:
vector<CIniFile::Record> s = CIniFile::GetSection("Client Files",IniFileName);
My question is how can convert s to a string ?? Or is there another way of getting it to a string or char*.
Many Thanx
Regards,
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r My Blog: ^_^
|
|
|
|
|
Programm3r wrote: My question is how can convert s to a string ??
Can you explain a little clearer ?
Do you want to know , how to access members of Record in the class ?
|
|
|
|
|
prasad_som wrote: Do you want to know , how to access members of Record in the class ?
Yes, but I think I solved the problem thanx prasad_som....
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r My Blog: ^_^
|
|
|
|
|
Programm3r wrote: problem
|
|
|
|
|
|
|
It seems like I forgot to export the function in the other dll (in the def file), but it's working now ....
Thanx anyway
Regards,
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r My Blog: ^_^
|
|
|
|
|
Do you mean , this function is in dll and you are using it ?
You need to link its .lib in to client lib,. Have you dont this ?
|
|
|
|
|
Yes, I have already link the lib file. It's actually one dll calling another, but in the one dll I forgot to export one of the functions. When I changed the dll so that it exports the function everything seems to be working. But thanx alot for your input prasad.
Regards,
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r My Blog: ^_^
|
|
|
|
|
|
Possibley you are deleting corrupted memory. Actually, call stack should show you where it is occuring.
|
|
|
|
|
The exception occurs right before my dll terminates ... the debugger refered to assert , would this make a difference?
Debug Assertion Failed!
File: dbgheap.c
Line: 1252
Expression: _CrtIsValidHeapPointer(pUserData)
For more information see the VS C++ Documentation on assert
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r My Blog: ^_^
|
|
|
|
|
Again same, its is dues to corrupting memory. One typical example would be,
char *p = new char[10];
strcpy(p,"string greater than 10");
delete []p;
or
char *p = new char[10];
delete []p;
delete []p somewhere from program.
|
|
|
|
|
Ok, nowhere in my program am I using the delete nor ZeroMemory functions. I'll do some serious debugging, but thanx Prasad.
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r My Blog: ^_^
|
|
|
|
|
Programm3r wrote: program am I using the delete nor ZeroMemory functions.
Doesn't matter. It could be possible , that memory created on stack(array) is corrupted this way.
|
|
|
|
|
Thanx anyway Prasad ... this bug is starting to p^ss me off ... but oh well .. I'll figure it out ..
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r My Blog: ^_^
|
|
|
|
|
Hi all,
How could I clear / erase the contents of s :
class CIniFile
{
public:
struct Record
{
string Comments;
char Commented;
string Section;
string Key;
string Value;
};
vector<CIniFile::Record> s = CIniFile::GetSection("Client Files",IniFileName);
I tried the following:
s.erase(s.begin(),s.end());
Bit receive the following:
Windows has triggered a breakpoint in CompClientApp.exe.
This may be due to a corruption of the heap, and indicates a bug in CompClientApp.exe or any of the DLLs it has loaded.
The output window may have more diagnostic information
Many thanx
Regards,
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r My Blog: ^_^
|
|
|
|
|
Its object, not pointer, isn't it ?
|
|
|
|
|
|
Programm3r wrote: lpzFiles[i].szFileName = "";
How is lpzFiles is declared like ?
|
|
|
|
|
#define FILE_NAMES 10
struct
{
char* szFileName;
}lpzFiles[FILE_NAMES];
It's as if the stack of that specific portion of code gets corrupted (that is the function call)
-- modified at 9:52 Monday 5th March, 2007
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r My Blog: ^_^
|
|
|
|
|
Dear all
I write one small DLL that I need to load it only one time.
How can I protect my dll from loading twice or more at load time.
I use LoadLibrary function to load my dll in dynamic manner.
How can I load this DLL in static manner.
Thanks in advance
Mahdi
|
|
|
|
|
m_monhi wrote: How can I load this DLL in static manner.
You mean implicit linking [^] ?
-- modified at 4:01 Monday 5th March, 2007
Refer[^].
|
|
|
|