|
I have a problem with ExitWindowsEx. AFAIK, using EWX_SHUTDOWN with that API function causes the system to shut down, right? Well, what happens is that the system logs off!!!!!!!!
My computer shuts down normally when I choose shut down from the start menu and restarted normally by setup programs.
What is going on???
Thanx
|
|
|
|
|
I was able to solve my own problem. Thanx anyway.
*Obsolete*
I'm creating a multithreaded server application using winsock. So far everything works well except when i try to send data to the client. I get a WSAEINVAL(10022) error on the Send() function. Here's the code:
UINT PASCAL CLJFileServer::ListenProc(LPVOID *pParam)
{
CLJFileServer *pThis;
pThis = (CLJFileServer*)pParam;
if (!pThis)
return 1;
CTimeoutSocket* pClient = NULL;
CTimeoutSocket* pListen = new CTimeoutSocket();
int nLoopCount;
while (!pListen->Create(pThis->m_uPort))
{
Sleep(LJFS_TIMEOUT);
nLoopCount++;
if (nLoopCount > LJFS_SOCKET_RETRY)
{
pThis->m_hListen = NULL;
pThis->StartListening();
return 1;
}
}
pListen->Listen();
while(pThis->m_bStop != true)
{
if (pClient)
delete pClient;
pClient = new CTimeoutSocket;
pListen->SetTimeout(LJFS_TIMEOUT);
int bAccepted = pListen->Accept(*pClient);
if (bAccepted)
{
pThis->SendAck(pClient);
if (pThis->m_uServerType == LJFS_LISTEN)
pThis->Login(pClient);
else
pThis->ForwardConnection(pClient);
}
}
if (pClient)
delete pClient;
pListen->Close();
delete pListen;
pThis->m_hListen = NULL;
return 0;
}
void CLJFileServer::SendAck(CTimeoutSocket *pClient)
{
//pClient->Bind(LJ_FSPORT);
TRACE("Error No: %d", GetLastError());
if(m_uServerType = LJFS_LISTEN)
{
pClient->Send((void*)LJ_LOGINACK,sizeof(LJ_LOGINACK));
TRACE("Error No: %d", GetLastError());
}
else
pClient->Send((void*)LJ_METASERVER,sizeof(int));
}
Thanx for your help in advance.
Stephen Caldwell
Desick Information Technologies
|
|
|
|
|
Bonjour! when i try to define a CArray as a static class member i get a link error. what's the problem, and how can i solve it? thx
derhackler
|
|
|
|
|
Please provide error description (or source of your class) to give us the idea of your problem.
Best regards,
-----------
Igor Soukhov (Brainbench/Tekmetrics ID:50759)
igor_soukhov@yahoo.com | ICQ:57404554 | http://siv.da.ru
|
|
|
|
|
this is the code of the header file:
#include <afxtempl.h>
class CPropertyList
{
public:
CPropertyList();
virtual ~CPropertyList();
public:
static CString fnGetADsProperty(int intArg);
static CString fnGetADsProperty(CString cstrArg);
static int fnGetIntProperty(CString cstrArg);
static CString fnGetProperty(int intArg);
static CString fnGetProperty(CString cstrArg);
//Statische members
static CArray<cstring,cstring&> cstraProperty;
static CArray<cstring,cstring&> cstraADsProperty;
static CArray<int,int> intaProperty;
};
this ist the error i get (for each CArray)
PropertyList.obj : error LNK2001: Nichtaufgeloestes externes Symbol "public: static class CArray<class cstring,class="" cstring="" &=""> CPropertyList::cstraProperty" (?cstraProperty@CPropertyList@@2V?$CArray@VCString@@AAV1@@@A)
any ideas?
derhackler
es ist wie es ist und es ist und es ist fürchterlich
|
|
|
|
|
CArray is the template class - so you need to provide template parameters!
Like that:
class CPropertyList
{
...
static CArray<cyourclass, cyourclass&=""> cstraProperty;
static CArray<cyourclass, cyourclass&=""> cstraADsProperty;
static CArray<cyourclass, cyourclass&=""> intaProperty;
};
and your always must define static variables (the code above is the declaration only!):
this code your should place out of class declaration! (most of us placing this in CPP file :
CArray<cyourclass, cyourclass&=""> CPropertyList::cstraProperty;
.. the same for others static members.
Hope it'll help.
#include
class CPropertyList
{
public:
CPropertyList();
virtual ~CPropertyList();
public:
static CString fnGetADsProperty(int intArg);
static CString fnGetADsProperty(CString cstrArg);
static int fnGetIntProperty(CString cstrArg);
static CString fnGetProperty(int intArg);
static CString fnGetProperty(CString cstrArg);
//Statische members
static CArray cstraProperty;
static CArray cstraADsProperty;
static CArray intaProperty;
};
this ist the error i get (for each CArray)
PropertyList.obj : error LNK2001: Nichtaufgeloestes externes Symbol "public: static class CArray CPropertyList::cstraProperty" (?cstraProperty@CPropertyList@@2V?$CArray@VCString@@AAV1@@@A)
any ideas?
derhackler
Best regards,
-----------
Igor Soukhov (Brainbench/Tekmetrics ID:50759)
igor_soukhov@yahoo.com | ICQ:57404554 | http://siv.da.ru
|
|
|
|
|
CArray is the template class - so you need to provide template parameters!
Like that:
class CPropertyList
{
...
static CArray<cyourclass, cyourclass&=""> cstraProperty;
static CArray<cyourclass, cyourclass&=""> cstraADsProperty;
static CArray<cyourclass, cyourclass&=""> intaProperty;
};
and your always must define static variables (the code above is the declaration only!):
this code your should place out of class declaration! (most of us placing this in CPP file :
CArray<cyourclass, cyourclass&=""> CPropertyList::cstraProperty;
.. the same for others static members.
Hope it'll help.
ps: just've seen your post on codeguru
#include
class CPropertyList
{
public:
CPropertyList();
virtual ~CPropertyList();
public:
static CString fnGetADsProperty(int intArg);
static CString fnGetADsProperty(CString cstrArg);
static int fnGetIntProperty(CString cstrArg);
static CString fnGetProperty(int intArg);
static CString fnGetProperty(CString cstrArg);
//Statische members
static CArray cstraProperty;
static CArray cstraADsProperty;
static CArray intaProperty;
};
this ist the error i get (for each CArray)
PropertyList.obj : error LNK2001: Nichtaufgeloestes externes Symbol "public: static class CArray CPropertyList::cstraProperty" (?cstraProperty@CPropertyList@@2V?$CArray@VCString@@AAV1@@@A)
any ideas?
derhackler
Best regards,
-----------
Igor Soukhov (Brainbench/Tekmetrics ID:50759)
igor_soukhov@yahoo.com | ICQ:57404554 | http://siv.da.ru
|
|
|
|
|
CArray is the template class - so you need to provide template parameters!
Like that:
class CPropertyList
{
...
static CArray<cyourclass, cyourclass&=""> cstraProperty;
static CArray<cyourclass, cyourclass&=""> cstraADsProperty;
static CArray<cyourclass, cyourclass&=""> intaProperty;
};
and your always must define static variables (the code above is the declaration only!):
this code your should place out of class declaration! (most of us placing this in CPP file :
CArray<cyourclass, cyourclass&=""> CPropertyList::cstraProperty;
.. the same for others static members.
Hope it'll help.
ps: just've seen your post on codeguru
#include
class CPropertyList
{
public:
CPropertyList();
virtual ~CPropertyList();
public:
static CString fnGetADsProperty(int intArg);
static CString fnGetADsProperty(CString cstrArg);
static int fnGetIntProperty(CString cstrArg);
static CString fnGetProperty(int intArg);
static CString fnGetProperty(CString cstrArg);
//Statische members
static CArray cstraProperty;
static CArray cstraADsProperty;
static CArray intaProperty;
};
this ist the error i get (for each CArray)
PropertyList.obj : error LNK2001: Nichtaufgeloestes externes Symbol "public: static class CArray CPropertyList::cstraProperty" (?cstraProperty@CPropertyList@@2V?$CArray@VCString@@AAV1@@@A)
any ideas?
derhackler
Best regards,
-----------
Igor Soukhov (Brainbench/Tekmetrics ID:50759)
igor_soukhov@yahoo.com | ICQ:57404554 | http://siv.da.ru
|
|
|
|
|
Hell, the system eats brackets
Best regards,
-----------
Igor Soukhov (Brainbench/Tekmetrics ID:50759)
igor_soukhov@yahoo.com | ICQ:57404554 | http://siv.da.ru
|
|
|
|
|
i've seen it.
|
|
|
|
|
ups. ther's something wrong with the forum code. it ignores the template parameters! but i've specified the parameters like CArray[CString,CString&] (i use other brakets). so something else must be wrong.
|
|
|
|
|
define the static members as I did in previouse post (some minuts ago - it should help. Yes - I see the templates problem - is not a reason !
Best regards,
-----------
Igor Soukhov (Brainbench/Tekmetrics ID:50759)
igor_soukhov@yahoo.com | ICQ:57404554 | http://siv.da.ru
|
|
|
|
|
ah!!! i see the problem. initializing the arrays is not a want - it's a must!! now my code compiles. thank you!!!
es ist wie es ist und es ist fürchterlich!
|
|
|
|
|
Hi everybody, I don't remeber if I ask this question before but I will try to take a chance to ask it again.
If there anybody know how to Link a ClistCtrl with a CTreeView like Windows Explorer when you click on a tree item the list show always different items ?
Can you tell me where I Can find reference on that or source code, tutorials or can you explain it to me in details ?
TIA
BLaZe
ICQ # 110244345
email : mpblaze@iquebec.com
|
|
|
|
|
G'day,
How about implementing a vertical splitter window and putting a tree control view in one pane and a list control view in the other?
Then handle item selections in the tree and notifying the list view so that it's contents are synchronized with the tree.
There may be a better way of handling this, but that's the best I can come up with for the moment.
Hope this helps,
Steve
|
|
|
|
|
Yes thank you
but do you know where I can find Source or do you have a little BASIC
program (exemple) for demonstrate this because I'm not very familiar with
the Handle of a Tree
TIA
BLaZe
BLaZe
ICQ # 110244345
email : mpblaze@iquebec.com
|
|
|
|
|
make a new project ... choose an sdi app ... choose a windows explorer style app ... change the right view base class to be clistview ... compile ... voila
---
"every year we invent better idiot proof systems and every year they invent better idiots"
|
|
|
|
|
Yes thank you
but do you know where I can find Source or do you have a little BASIC
program (exemple) for demonstrate how to change the ListView
TIA
BLaZe
BLaZe
ICQ # 110244345
email : mpblaze@iquebec.com
|
|
|
|
|
how to change the listview? you mean update it on an event? thats all in the docs and is very straightforward ... as for a basic example program with code ... thats what the app wizard gives you ... look thru the code it generates to at least see what is going on
---
"every year we invent better idiot proof systems and every year they invent better idiots"
|
|
|
|
|
Hi,
I need to write a large amount of data into a file, but the limitation of a file under windows is 4G. How can I handle this situation safely?
Thanks.
|
|
|
|
|
write the file into a sequence of numbered sub-files (i would include a file header of my own design that kept the name of the file sequence and the sequence number safe inside)
the sub-file size would depend on how you have to read it back in but i would consider maybe 20mb to 50mb blocks ... its still going to be a real bore for the folks waiting to load even a portion of the overall file but its better than waiting for the whole thing to arrive in memory
you do of course have a machine with vast amounts of ram and virtual memory i assume or loading in is a real no-no
---
"every year we invent better idiot proof systems and every year they invent better idiots"
|
|
|
|
|
When I execute program under debugger I receive message:
HEAP[aaa.exe]: Invalid Address specified to RtlFreeHeap( 1c50000, 1608938 )
But visual problems with pointers doesn't exist.
Can you advice me something.
|
|
|
|
|
in my experience this usually means you have allocated some memory blocks and either over or underwritten the allocated space ... check you don't exceed the amount of memory you allocated
---
"every year we invent better idiot proof systems and every year they invent better idiots"
|
|
|
|
|
You may want to verify mixed libraries in your linkage - debug and release builds. The memory allocated in debug builds has some additional space that does not exist in release mode (see for ex, help _calloc_dbg in MSDN). The solution then is to link only the same builds of your libs (either debug or release).
|
|
|
|
|
I have developed a regular DLL which contains dialog
resource, having ActiveX control along with other windows controls. I
have exported a function which calls DoModal function on that dialog.
But when I call this function in another application ( using explict
linking - LoadLibrary..) it does not display the dialog box and returns
-1 . It works fine when there is no ActiveX control.
Please let me know the solution for
Capizzi Filippo
|
|
|
|