|
Kuniva wrote:
Can anyone help me on this?
No, that's cheating !
BTW, I don't know how to do this, so if anyone can tell us !
Max.
|
|
|
|
|
Try using DebugActiveProcess to atach to the process.
After this call your application will be like a debugger and will be able to stop execution and inspect it's virtual memory.
There is a complete section in the platform SDK dedicated to the debugging API in windows.
Cheers
|
|
|
|
|
How do you catch a connection error in CSocket?? It doesn't seem possible..
CSocket sSocket;
sSocket.Create();
int iCon = sSocket.Connect("some.dns.com", 21);
if(iCon != 0)
MessageBox("Error Connecting");
or
if(iCon == SOCKET_ERROR)
MessageBox("Error Connecting");
Even if the address doesn't exist it will allways return a 0. (success)
I derived my own CSocket class and and over rode OnConnect(int nErrorCode) so that if it returns a error I post the message and if it doesn't error run a function.. it never returns anything..
The only reason I am using CSocket is because I need to use CSocketFile and CArchive..
Any ideas?? Or is this how it's supposed to work?
|
|
|
|
|
Here is internal MFC code executed by the Create() call :
BOOL CAsyncSocket::Create(UINT nSocketPort, int nSocketType,
long lEvent, LPCTSTR lpszSocketAddress)
{
if (Socket(nSocketType, lEvent))
{
if (Bind(nSocketPort,lpszSocketAddress))
return TRUE;
int nResult = GetLastError();
Close();
WSASetLastError(nResult);
}
return FALSE;
}
And you still wonder why it always returns 0. Come on....
From this code, it's also clear you can call either ::GetLastError() or ::WSAGetLastError() to get the actual error.
How low can you go ? (MS retrofuck)
|
|
|
|
|
Thanks! Worked like a champ.
|
|
|
|
|
Hi,
My name is Rui, and i'm developing an MFC application with VC.NET.
I would like to change, by code, the back color of a certain line or item.
I read some articles on the subject, but i still can't, i found some solution very dificult...
Thank you for your time
Rui
|
|
|
|
|
Are here any API function to get serial numbers
or IDs of hardware in computer. (VGA, Memory, HD and so on)
Thank you
Viliam
|
|
|
|
|
Hi All,
I'm trying to implement a message window, like the one in Visual Studio, without the tabs, though. I've got a CDialogBar member in my main frame class, with an embedded rich edit control. How do I send text to a rich edt control programmatically? I was using a list control, but didn't like the way this worked, since it didn't give many formatting options. I thought about using a regular edit control, but then I couldn't do fancy formatting either.
Thanks
Aaron
|
|
|
|
|
AFAIK, you can call SetWindowText on the rich edit control, but this is probably inefficient. Try looking up the CRichEditCtrl member StreamIn, or the windows message EM_STREAMIN.
Chris Richardson
|
|
|
|
|
StreamIn seems to work OK. Thanks
|
|
|
|
|
I'm working on a little security program to ensure that invalid CD's do not get inserted into our SOE machines, and to enable this I'm building a little program to manage adding a link to the users start menu.
What I need to know is there an easy way to detect if there is a CD ROM Inserted.
I've been playing with CreateFile for the purpose which is fine, to ascertain that the actual CD that is currently in the Drive is invalid, BUT if there is no disk at all, then a No Disk in CD warning is displayed by the operating system.
Is there a way to disable the Warning(temporarily) or a better way to check for the prescence of a disk?
Thanks for any help.
|
|
|
|
|
Try to call SetErrorMode with SEM_FAILCRITICALERRORS flag. It works with floppies, probably will with CD drive as well.
Tomasz Sowinski -- http://www.shooltz.com
*** Purgamentum init, exit purgamentum ***
|
|
|
|
|
thanks so much... this is perfect..
and to make it normal again after my check I just call
SetErrorMode(0);
|
|
|
|
|
Not exactly. SetErrorMode(0) returns the current error mode - I don't know why that behavior has been removed from MSDN. So the correct way is:
UINT uOldMode = SetErrorMode(0);
SetErrorMode ( uOldMode | SEM_FAILCRITICALERRORS );
SetErrorMode ( uOldMode ); And no I don't know why they didn't just provide a GetErrorMode() API.
--Mike--
"I'd rather you just give me a fish today, because even if you teach me how to fish, I won't do it. I'm lazy." -- Nish
Just released - 1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
Mike. Your knowledge always astounds me. No wonder your a MVP.
Regards,
Brian Dela
|
|
|
|
|
Thanks, Brian, but I don't think that was me on the awards list. I don't exactly have a unique name, and no one's ever contacted me in email about it.
--Mike--
"I'd rather you just give me a fish today, because even if you teach me how to fish, I won't do it. I'm lazy." -- Nish
Just released - 1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
Michael Dunn wrote:
but I don't think that was me on the awards list.
Well it should have been you. Is there anyway you could find out if it was?
Regards,
Brian Dela
|
|
|
|
|
does someone know a good Unicode Resource Editor ?
Thanks
Olivier
|
|
|
|
|
ummmmm huh?
for text? u mean foreign languages? or what?
"... and so i said to him ... if it don't dance (or code) and you can't eat it either f**k it or throw it away" biz stuff about me
|
|
|
|
|
well I have Translated a rc file into japanese.
The problem is that the width of some resource is too small. So I have to resize it and I would like to do it "graphically" with an editor and not directly into the rc file by changing it, compiling it and then to see it in my software ....
|
|
|
|
|
AFAIK, the resource editor works in code page, and is not in UNICODE;meaning, you have to be in the japanese code page to be able to edit the japanese resources.
go to the regional settings, and change to japanese ( don't remember which one it is ).
Max.
|
|
|
|
|
When the app first starts and you right click the area, the popup menu shows up. However if you start the app, do some other operations and then right click in the area , theres no popup menu!
Appreciate your help,
ns
|
|
|
|
|
Put the breakpoint in the right-click handler, check if menu loads correctly from resources 2nd time.
IMHO, this is just another symptom of the bug you've described below.
Tomasz Sowinski -- http://www.shooltz.com
*** Purgamentum init, exit purgamentum ***
|
|
|
|
|
Hello,
Does anybody know if it is possible to generate a header file from a .lib file?
The header file will contain the actual procedure with a call to GetProcAddress.
It should be really cool if I can specify just a set of procedures I need.
The reason why I ask this is the following:
I'm writing a program which connects to an Oracle database. Oracle delivers a .lib file.
The problem is that Oracle like to change the names of the client dll file from version to version.
So if I link the .lib file, the program will complain about missing dll's if I run the program with another version of the Oracle client than the one I compiled my program with.
All the procedures however are the same.
So it would be nice that I have a header file that translates some functions to their respective GetProcAddresses, and I should need to write the LoadLibrary part.
Thank in advance
Wim
|
|
|
|
|
It'll be quite hard, since .lib may have no information on function arguments/return type. And even if it has, it'll be name-mangled.
Tomasz Sowinski -- http://www.shooltz.com
*** Purgamentum init, exit purgamentum ***
|
|
|
|