|
rishabhs wrote:
1) my app is a very simple dlg based mfc app. i'm unable to terminate the dialog by pressing the cross button in the top right corner..even Alt+F4 can't terminate my mighty dialog.
Have you done something to OnCancel() or OnClose() ?
rishabhs wrote:
...the string comparision fails.
What is the value of sDir at the point of comparison?
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
1) haven't even touched OnCancel or OnClose()
2) value of sDir is "M"
any clues!!
rIsHaBh
|
|
|
|
|
If you create a dialog-based application, don't change anything, and run it, does the "X" (close) button behave as expected?
Have you stepped into the CompareNoCase() code to see why it is failing? What if you changed the code to:
char s[] = "M";
if (sDir.CompareNoCase(s) != 0)
{
...
} Does that make a difference?
|
|
|
|
|
I have the following case:
There's a Window, let's call it window A.
Window A contains a nested class which implements a COM-Interface.
the code behind window A is simple:
<br />
CWindowA* wndA = new CWindowA;<br />
wndA->DoModal();<br />
delete wndA;<br />
This code appears in the middle of an application, it has lots of stuff before and after it.
The thing is, that Window-A gives 'someone' a pointer to it's COM-Interface. This someone proceeds to make COM calls which are executed inside Window-A's nested class.
The design issue is this, Window-A decides it's time to die (call EndDialog, and thus get out of the DoModal() loop and get desturcted) in response to a COM call from mr. 'someone'.
So, if 'someone' makes this final COM-call, Window-A in response starts to destroy itself, and actually gets to it, without having 'someone' release the refcount it has on Window-A's COM-Object. This causes a mess/Assertion by MFC on the fact that references to this object still exist.
Is there a nice and clean way to solve this situation ?
It is assured that once this final call is made, the reference-count will be released and no COM-calls will be made to this object.
I've thought of posting a message that would cause a destruction and other numerous solutions, but none of them can assure that the ref-count is actually released...
Thank you
|
|
|
|
|
I've found this : void CCmdTarget::ExternalDisconnect()
the comment in the code states :
// ExternalDisconnect is used to remove RPC connections in destructors. This
// insures that no RPC calls will go to the object after it has been
// deleted.
This looks like a great solution. The only thing I'd like to final-check is that it would be ok to make this call in-response, or during the last COM-Call ?
thanks
|
|
|
|
|
hi,
This problem is specific to a third party code which uses DIRECTX to render a 3-D image on the screen. I do not have acces to the third party software which does this job. My intention is to somehow do the same job but instead of calling the DIRECTX code written in the third party software the client needs to go thru my code for doing the same job. For this I will need to identify the interfaces(directx interfaces) that are being called by the program to render the image on the screen. Is there any way of finding out the interfaces that are being invoked.
As per my knowledge the GUID's of the interfaces are present in the registry. Can we find out the sequence of interfaces being called by the client and then replace the rspective entries in the registries with our interface GUID's so that the screen coordinates( for the image to be rendered on the screen) are available to my program and I need to store it for further processing.
1) How do i implement the concept mentioned above
2) is there any other way of doing it???
Please reply soon
Thanks
|
|
|
|
|
Have you taken a look at D3DSpy, which ships with the DirectX 9 SDK? It may provide the information you're looking for.
- Mike
|
|
|
|
|
Dear Techies,
Please give me the differences between the member functions prefixed with Afx and without Afx.
For Example, AfxMessageBox() and MessageBox();
What's the additional features and capapbilities does the AfxMessageBox() has over MessageBox().
Thanking you,
Neelesh K J Jain.
|
|
|
|
|
one is api, and the other is mfc.
one is global, and the other is local.
little suggestions.
Hello World!
|
|
|
|
|
I want a book that's as thorough as Prosise's Programming Windows with MFC, only that it's MFC centric in the latest (7.0 or 7.1) versions of MFC. Is there such an animal? A search of the internet yields nada. There is a gaping hole here that needs to be filled. What's the hold up?
Ed
|
|
|
|
|
I need to write a small program that will run in the background and trap whatever is typed at the keyboard with whatever program that's running. Then save those keystrokes to a file. Is there an easy way to do this?
Thanks,
Fred
It's all magic.
|
|
|
|
|
Yes, but it's a rude thing to do.
--
-Blake (com/bcdev/blake)
|
|
|
|
|
Hm... may I ask you why you want to do this?
Rickard Andersson
Here is my card, contact me later!
UIN: 50302279
Sonork: 37318
Interests: C++, ADO, SQL, Winsock, 0s and 1s
|
|
|
|
|
Rickard Andersson18 wrote:
Hm... may I ask you why you want to do this?
hmm... maybe he wants to create a keylogger so that he can install it onto everyone's pc and get all their passwords?! ;)
"It was when I found out I could make mistakes that I knew I was on to something."
-Ornette Coleman
|
|
|
|
|
Sure true, then I won't help.
Rickard Andersson
Here is my card, contact me later!
UIN: 50302279
Sonork: 37318
Interests: C++, ADO, SQL, Winsock, 0s and 1s
|
|
|
|
|
The part under the (if aorh == 0) works great . The part in the else{} brackets dosn't and causes a fatal error in my program when I run it as well as a WSAEPROTONOSUPPORT error I don't understand. I must be doing something screwy.
void CSSPingDlg::Ping(LPCSTR pstrHost, int aorh)
{
SOCKET rawSocket;
LPHOSTENT lpHost;
rawSocket = socket(AF_INET, SOCK_RAW, IPPROTO_ICMP);
if (rawSocket == SOCKET_ERROR)
{
AfxMessageBox("Raw socket initialization failed.",MB_OK);
return;
}
if (aorh == 0)
{
lpHost = gethostbyname(pstrHost);
saDest.sin_addr.s_addr = *((u_long FAR *) (lpHost->h_addr));
saDest.sin_family = AF_INET;
saDest.sin_port = 0;
}
else
{
lpHost = gethostbyaddr(pstrHost,4,AF_INET);
saDest.sin_addr.s_addr = *((u_long FAR *) (lpHost->h_addr));
saDest.sin_family = AF_INET;
saDest.sin_port = 0;
}
|
|
|
|
|
the 'aorh' is your flag to go with gethostbyaddr but it doesn´t work. So you should check if your are allowed to use gethostbyaddr in this context/parameters. The error is poiting that you haven´t started the WSA properly to do this.
Try this @ home. (B&B)
|
|
|
|
|
KarstenK wrote:
The error is poiting that you haven´t started the WSA properly to do this.
Which is what WSANOTINITIALISED is used for.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
It also can be that the startup wasn´t with the correct version, because on the other "if" side it worked.
Try this @ home. (B&B)
|
|
|
|
|
This should work just fine:
ULONG ulAddr = inet_addr("192.168.200.100");
if (INADDR_NONE != ulAddr)
{
LPHOSTENT hostinfo = gethostbyaddr((char *) &ulAddr, sizeof(ulAddr), AF_INET);
if (NULL != hostinfo)
{
....
}
}
I'm not sure what your code is doing after assigning values to the saDest structure, but have you ruled out that as a potential problem? In other words, do you really want port 0, or should you be using a port in the range 1024–49151? You can also use 49152–65535, but no services are registered on them, which you may not even care about.
What is lpHost->h_addr ? Shouldn't that be lpHost->h_addr_list ?
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Several hours overtime at work and I am rewarded
with this little gem from VS 6.0
<br />
Compiling...<br />
StdAfx.cpp<br />
Compiling...<br />
TestMatrixTemplate.cpp<br />
c:\documents and settings\windows user\my documents\john's work folder\testmatrixtemplate\generalmatrixclass.h(60) : fatal error C1001: INTERNAL COMPILER ERROR<br />
(compiler file 'msc1.cpp', line 1786) <br />
Please choose the Technical Support command on the Visual C++ <br />
Help menu, or open the Technical Support help file for more information<br />
Command line warning D4028 : minimal rebuild failure, reverting to normal build<br />
Error executing cl.exe.<br />
<br />
TestMatrixTemplate.exe - 1 error(s), 1 warning(s)<br />
Can anyone provide any insight as to what the problem
REALLY is? The generalmatrixclass.h file is a
template for a proprietary matrix class. Could there be
something wrong with the implementation in the .h that
would cause this?
John Theal
Physicist/Mathematical Programmer
Digital Immersion Software Corporation
Got CAD?
http://www.presenter3d.com[^]
http://www.merlin3d.com[^]
|
|
|
|
|
I've got this a number of times when trying to use template functionality that isn't supported in VC6.0. In particular, whenever i've used a member function template, if i implemented it outside of the class definition (in a .inl file for eg) i would always get this problem - that one was resolved by moving the implementation into class itself.
If you post the code, i might be able to help further, otherwise i would suggest selectively commenting stuff out until it compiles
Dave
http://www.cloudsofheaven.org
|
|
|
|
|
You qualified most of your methods using CMatrix:: even though they are defined within the class definition. This is illegal (although VC should give a real error message). If you remove all of these it works - well, it shows you the real compile errors of which there are a couple, but those are easy to fix as it actually tells you what is wrong.
Dave
http://www.cloudsofheaven.org
|
|
|
|
|
Oh my I'm tired. Thanks for pointing that out.
Argh. I think I should take a break and go home
now. You know you've had enough when silly mistakes
like that start going unnoticed.
Thank you.
John Theal
Physicist/Mathematical Programmer
Digital Immersion Software Corporation
Got CAD?
http://www.presenter3d.com[^]
http://www.merlin3d.com[^]
|
|
|
|
|
for files that are self contained, you might try downloading gcc and giveing them a run through that. GCC tends to be slighty (to alot) more informative about whats wrong, particularly with template stuff. I have found a number of things that VC6 just completely lets slide through that are actually incorrect/invalid C++.
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
|
|
|
|