|
Christian Graus wrote:
The ASSERTs are telling you something, you should listen to them
Uh huh Some of my friends complain when I sprinkle my code liberally with ASSERT and ASSERT_KINDOF but I almost never have problems with NULL pointers or pointers to objects of the wrong kind. Even the act of writing the assertion gets the background threads thinking about whether I'm calling something with the correct (and validated) pointers
Rob Manderson
http://www.mindprobes.net
Paul Watson wrote:What sense would you most dislike loosing?
Ian Darling replied.
Telepathy
Then I'd no longer be able to find out everyones dirty little secrets The Lounge, December 4 2003
|
|
|
|
|
Most ASSERT macros (I'm assuming you're using some Microsoft version of them) are enabled in debug compilations and then nullified for release versions. In other words, an ASSERT macro might be defined like this:
#ifdef _DEBUG
#define ASSERT(expr) ...some assert code...
#else
#define ASSERT(expr)
#endif
Notice how the second ASSERT defition has nothing after it. That's because in non-debug builds, you don't want assertions to do anything. So, to possibly answer your question, you should probably dig up where your ASSERT is being defined and do #undef _DEBUG (to undefine debug build). Unfortunately, that turns off most debug features since many things test against _DEBUG being defined. Either do that, or compile as release, or create your own ASSERT macro based on other example code.
HTH
|
|
|
|
|
ummmmm
how about fixing the cause of the ASSERT's?
just a wild stupid idea i know but im old fashioned like that
"there is no spoon" biz stuff about me
|
|
|
|
|
I already told him to do that in the previous post but he says he has no time to do that(that was 3-4 days back), if he had taken some time off to fix the problem then his prob would have been solved.
I Touched Osama Bin Ladens Bushy Beard
|
|
|
|
|
Thnks,
I finally fixed the ASSERT.
|
|
|
|
|
Hello old chaps (and chapettes)
We have an extension DLL inside of which are a number of classes.
One or two of the classes are trying to use some of the other classes we export
However, it would seem that as the classes are marked for export and the compiler won't let us make use of the classes inside the dll.
is there a solution for this (other than having 1 dll per class and importing that)
can we keep all the classes in the one dll and make use of some of them internally?
regards
Bryce
---
Publitor, making Pubmed easy.
http://www.sohocode.com/publitor
|
|
|
|
|
|
are you using _declspec(dllexport) macro or the DEF file to export your classes? Could u pls send me a sample line showing, how u try to export them?
Regards,
Buddhike de Silva
|
|
|
|
|
In VC6.0,when I debug my program Test that depends on a DLL,a message box always pops up with "Unhandled exception in Test.exe[MSCTF.DLL]:0XC0000005:Access Violation".But when executing it,the undesired thing doesn't emerge.Why???
Please help me!!!
Rap off for you,for me,for our human.
|
|
|
|
|
hi,
i just get frustrated about the problem,
i m trying to connect with the Server using Winsock
and then successfully able to send the packet usinf send() function but will not be able to receive the packet from server using recv() function.
just look at my code snippet.......
WSADATA wsaData;
long Error;
int iResult = WSAStartup(MAKEWORD(2,2), &wsaData);
if (iResult != NO_ERROR)
printf("Error at WSAStartup()\n");
// Create a SOCKET for connecting to server
SOCKET ConnectSocket;
ConnectSocket = socket(AF_INET, SOCK_STREAM, 0);
if (ConnectSocket == INVALID_SOCKET)
{
printf("Error at socket(): %ld\n", WSAGetLastError());
WSACleanup();
return;
}
// The sockaddr_in structure specifies the address family,
// IP address, and port of the server to be connected to.
char* localIP;
hostent* localHost;
int portNumber = 443;
localHost = gethostbyname("hostname");
localIP = inet_ntoa (*(struct in_addr *)*localHost->h_addr_list);
sockaddr_in clientService;
clientService.sin_family = AF_INET;
clientService.sin_addr.s_addr = inet_addr(localIP);
clientService.sin_port = htons(portNumber);
// Connect to server.
if ( connect(ConnectSocket,(SOCKADDR*)&clientService,sizeof(clientService)) == SOCKET_ERROR)
{
printf( "Failed to connect.\n" );
Error = WSAGetLastError();
printf("\n %ld \n",Error);
WSACleanup();
return;
}
// strcpy(sendbuf,"a400\ws.asp");
bytesSent = send(ConnectSocket,sendbuf,strlen(sendbuf),0);
printf("Bytes Sent: %ld\n", bytesSent );
bytesRecv = recv(ConnectSocket,recvbuf,bytesSent,0);
if (bytesRecv <= 0)
printf("\n Error : %d",WSAGetLastError());
WSACleanup();
|
|
|
|
|
Hi,
i think so u need to use the particular port for that pop3 port is 110 like that. try it.
Have A Nice Day
Murali.M
|
|
|
|
|
I have a program with 3 class (actually 4, but the last one will work if i can get the other 3 to work), let's call them A, B, and C. A uses both B and C as private data members, and B and C each use A as a private data member. Apparently i can't simply use include directives, since circular inclusions like that are prohibited. so i tried using foreward declarations, but that did nothing. then i tried using include directives for A, but foreward declarations for B and C. If i do that, then A works, but B and C each have a lot of errors. they don't register A as a declared class. any idea how i can fix this?
|
|
|
|
|
How do forward declarations 'not work' for you ?
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
Anonymous wrote:
A uses both B and C as private data members, and B and C each use A as a private data member.
You can't do this. This basically creates a class that has an infinite size since A includes B which includes A which includes B etc. The way to do this is to include a pointer to A inside B and C, and then a forward declaration of A in the include files for B and C will work nicely.
Hope this helps,
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
probably should have said this earlier, but that's what it is. the code itself is fine; the professor gave it to us to organize into separate files. in one file it compiles fine. it's just when i try to put them in separate files when the problems arise.
as for what i meant by 'not work', i should have said 'has errors'. pardon the confusion.
|
|
|
|
|
You are probably using forward declarations
but not using member pointers or references to those classes
class A;<br />
<br />
class B( {<br />
A* m_a;<br />
};<br />
<br />
class A {<br />
friend class B;<br />
...<br />
};
|
|
|
|
|
Hi, i have a SDI App(generated with app wizard) with a file menu bar that envokes another dialog class..
my prob is trying to get a pointer from the dialog class that is envoked from the menu bar back to the original main dialog class created by the app wizard.
that way i can access the main dialog windows data
Thanks
|
|
|
|
|
try this:
CMyMainDlg::ShowOtherDialog()
{
COtherDlg myOtherDlg;
myOtherDlg.DoModal();
my_var = myOtherDlg.some_variable;
}
type of thing
"there is no spoon" biz stuff about me
|
|
|
|
|
If I understand right, you should simply declare the dialog class as a member of CMainFrame . In menu item handler you call only DoModal() .
|
|
|
|
|
Can sombody help me?
I`ve read all postings but I can`t find something it helps me!
Why different the result of PdhGetFormattedCounterValue function(ex - "\\Process(process_name)\\% Processor Time") and Windows Task Manager?
O/S : Windows 2000 Server.
CPU : Dual-CPU
single CPU, Windows 2000 professional is no problem.
help me!!!
|
|
|
|
|
i know to use setupcomm() to set the size of i/o com buffers.
but how can i get its default size?
Thank u very much!
Hello World!
|
|
|
|
|
Hi all,
Firstly, how do I create a group box programmatically?
Secondly, I want the following to work:
m_MyGroupBox is my group box (CStatic). Surprise...
m_MyGroupBox->ShowWindow(SW_HIDE).
How can I make the controls "inside" the group box to also disappear?
By simply saying that m_MyGroupBox is the parent when creating the inner ctrls?
Thx,
/Tommy
|
|
|
|
|
You'll have to manually hide each of the controls. Setting the parent to the group box will break MFC's handling of dialog box controls, so I don't recommend doing it.
Hope this helps,
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Hi, how can i force my CEdit control to react to Ctrl +v and Ctrl+c. It doesnt do it automaticaly.
I tried the following but it doesnt work out :
dirive OnKeyDown in my class CEditEx
if ((::GetKeyState (VK_CONTROL)<0)&&(nChar == 0x63))
{
// do something
}
doesnt work with GetAsyncKeyState too.
Any sugestion why? Or there is other method to do this stuff?
Thanks
|
|
|
|
|
Hello
i have been asked to look at a dll "issue"
and i cant see why its acting up.
However, when the dll builds the linker throws a headcase and spews out a bunch of errors
<br />
<br />
ClientState.obj : error LNK2005: "char const * * RPD_APP_FILE_EXT" (?RPD_APP_FILE_EXT@@3PAPBDA) already defined in ClientControl.obj<br />
DisplayControl.obj : error LNK2005: "char const * * RPD_APP_FILE_EXT" (?RPD_APP_FILE_EXT@@3PAPBDA) already defined in ClientControl.obj<br />
EquipmentID.obj : error LNK2005: "char const * * RPD_APP_FILE_EXT" (?RPD_APP_FILE_EXT@@3PAPBDA) already defined in ClientControl.obj<br />
FaultData.obj : error LNK2005: "char const * * RPD_APP_FILE_EXT" (?RPD_APP_FILE_EXT@@3PAPBDA) already defined in ClientControl.obj<br />
MSCIntraInterface.obj : error LNK2005: "char const * * RPD_APP_FILE_EXT" (?RPD_APP_FILE_EXT@@3PAPBDA) already defined in ClientControl.obj<br />
MsgQueue.obj : error LNK2005: "char const * * RPD_APP_FILE_EXT" (?RPD_APP_FILE_EXT@@3PAPBDA) already defined in ClientControl.obj<br />
TcpListener.obj : error LNK2005: "char const * * RPD_APP_FILE_EXT" (?RPD_APP_FILE_EXT@@3PAPBDA) already defined in ClientControl.obj<br />
Sort of thing
The RPD_APP_EXT is defined in "globaldefines.h" which uses
<br />
#ifndef GlobalDefines_h<br />
#define GlobalDefines_h<br />
<br />
const char * RPD_APP_FILE_EXT[] = {".RPD", ".RVR", ".UDO", ".RDO", ".ZRP"};<br />
<br />
etc etc<br />
<br />
#endif<br />
<br />
And as well as that the header files for every class all correctly use
#ifndef < sometag >
#define < some tag >
.
(.class definitions etc)
#endif
also,The compiler settings are set with the multithreaded /md option
I was wondering if anyone had any suggestions as to what one might do to fix this issue?
regards
Bryce
---
Publitor, making Pubmed easy.
http://www.sohocode.com/publitor
|
|
|
|