|
Heh, some nasty trick is actually the thing I was expecting to solve this problem.
I'm already creating a remote thread to register UnhandledExceptionFilter and some other dark-side stuff, and they help to solve some other similar issues. But even these methods are helpless with the runtime errors.
|
|
|
|
|
As from your earlier information what i understood is that, when you are trying to load MATLAB runtime library(example case you specified) in service account, it is popping the error, if so hook the DLL loading function( if it is LoadLibrary , if it is then you can refer this article API Hooking (LoadLibrary)[^] ) and stops the loading by checking the account is service account or not.
Or if you have a overview, which API invocation creates errors, then hook that API( redirect the API to ur function, where you can check the the account is service or not.)
Величие не Бога может быть недооценена.
|
|
|
|
|
Thanks for a good tip, but unfortunately the MATLAB and DLL loading was just an example among the cases. As I said, the process to be called can be almost anything. That's why I'd need some generic solution to prevent all the different runtime error popups from appearing in all the possible situations. That would probably mean hooking a lot of functions.
The execution happens in cloud-like environment (both cloud-dedicated and non-dedicated). The applications executed there should be valid and stable, but that can not be guaranteed in all the situations. Therefore all the unexpected errors should be handled without any user interaction.
|
|
|
|
|
From the last reply i am doubted whether you just want to close those error windows, without human interaction, that is the only need?
Величие не Бога может быть недооценена.
|
|
|
|
|
The best solution would be to prevent the error windows from appearing at all and make the error just return some exitcode. The other option would be to redirect the popup to a non-interactive desktop and then signal them to close. I'd like to avoid any solutions that make them appear on the interactive desktop, even if they would be closed automatically.
I'll have to see if there's any generic method in error handling I could hook. I'm just little bit worried that the handling of runtime errors may be too deep in kernel(?)
|
|
|
|
|
Exactly as know, we don't have generic solution. Usually we redirect the popups, but in some extreme cases, we have to go the low level.
Величие не Бога может быть недооценена.
|
|
|
|
|
I'm trying to develop a two port communication mfc wizard from the basic socket communication program.
Both the ports belong to a single server and the must run parallely.
The application I've made so far is able to connect to the first port.
In the second port connection, server is listening for connections, but the client is unable to connect.
http://www.easy-share.com/1907562869/Sock.rar
Please run the program once. You'll see that only first port is connecting properly, while the second one isn't.
Please provide a relevant solution.
modified on Monday, August 31, 2009 5:13 AM
|
|
|
|
|
Whether both port numbers of single server are same?
What is port number of the second port connection?
Величие не Бога может быть недооценена.
|
|
|
|
|
both the port numbers are different.
i have used 4000 and 5000. both the ports are free.
|
|
|
|
|
Please share your code, so as understand the problem
or
You just check the error you are getting.
Величие не Бога может быть недооценена.
|
|
|
|
|
You're using two socket objects to connect to two different ports or you're trying to use the same? Did the call to connect fail? Have you checked the return values (and called GetLastError() if applicable?)
Can you show us the relevant code?
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
I'm using only one pointer object but 2 different socket objects.
I tried using 2 pointers, but the second pointer is showing many errors.
main part of the errror is
CSockDlg(CWnd* pParent = NULL); // standard constructor
CSockDlg(CWnd2* pParent = NULL); // standard constructor
errors
c:\documents and settings\admin\desktop\sock\sockdlg.h(34) : error C2629: unexpected 'class CSockDlg ('
c:\documents and settings\admin\desktop\sock\sockdlg.h(34) : error C2238: unexpected token(s) preceding ';'
c:\documents and settings\admin\desktop\sock\sockdlg.h(35) : error C2629: unexpected 'class CSockDlg ('
c:\documents and settings\admin\desktop\sock\sockdlg.h(35) : error C2238: unexpected token(s) preceding ';'
|
|
|
|
|
raviteja2020 wrote: c:\documents and settings\admin\desktop\sock\sockdlg.h(34) : error C2629: unexpected 'class CSockDlg ('
Have you included the correct header file?
That aside, what does any of this have to do with not being able to establish a connection? You need to provide a relevant code snippet.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
if you writing Socket Programs in Win32 Code,
you might have to develop multithread application for creation of Socket Server.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
Hi everybody.
I want to submit a web form. Source of html page:
<html>
<body>
<form action="i.php" method="post">
Name: <input type="text" name="fname" value="MyName" />
Age: <input type="text" name="age" value="17" />
<input type="submit" />
</form>
</body>
</html>
If I submit the form in the page above, I would get:
Welcome MyName!
You are 17 years old.
And this is my code:
CInternetSession session(L"MyAgent");
CHttpConnection* httpcon=session.GetHttpConnection(L"localhost");
CHttpFile* httpfile=httpcon->OpenRequest(CHttpConnection::HTTP_VERB_POST,L"i.php");
CString headers=L"Content-Type: application/x-www-form-urlencoded";
CString data=L"fname=MyName&age=17";
httpfile->SendRequest(headers,(LPVOID)(LPCTSTR)data,data.GetLength());
CString t=L"";
UINT len=100;
char buf[100];
while(len>0){
len=httpfile->Read(buf,100);
if(len>0)t.Append(CString(buf),len);
}
AfxMessageBox(t);
httpfile->Close();
httpcon->Close();
session.Close();
Unfortunately, form is not being submitted. What I'm doing wrong?
I'm trying to do this thing 3rd time now, I don't want to give up this time
Any help would be greatly appreciated.
modified on Thursday, August 27, 2009 6:28 PM
|
|
|
|
|
check your localhost port in the class CInternetSession.
it's my pleasure to make friend with you.
|
|
|
|
|
You probably need to set the Content-Length header.
If I were you, I'd download Fiddler[^] and use it to see what the difference is between the POST sent by the browser in response to that web form and the POST sent by your program.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Thanks Stuart Dootson!
I used Fiddler and looks like my program sending data in a different encoding.
Browser is sending:
fname=MyName
age=17
My program is sending:
f[]n[]a[]m[]e[]=[]M[]y[]N[]a[]m[]e
[]a[]g[]e=[]1[]7[]
(Meaning there is a square after each char)
What should I do to send like WebBrowser does?
|
|
|
|
|
Use ASCII rather than Unicode strings, I guess?
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Thank you again Stuart Dootson!
It worked
I used CStringA instead of CString.
But, what if I want to send Unicode string? I'll be sending data in russian too.
So is there way to send Unicode too?
|
|
|
|
|
Yes - you need to tell the system what encoding you're using. As far as I can see, that means adding an HTTP header OR something in the HTML document - this Wikipedia page[^] appears to have the details.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
I used Fiddler to see what is the browser sending when I typed unicode text.
Web Browser is converting the unicode text into hex values, like
%F2%E8 =ти (russian)
Let me post new thread for this is a different problem(Unicode to Hex conversion).
My problem in this thread is solved. Stuart Dootson, thank you so much!
|
|
|
|
|
Hi,
Created the application same as Windows firewall. In Windows Firewall Under Exception tab we have the "Add Program" button. On click of which the list of program is enumerated. I want to know from where this list is populated. Any registry key under which these programs are listed. or any method to get this list?
Regards.
"A winner is not one who never fails...but the one who never quits"
modified on Thursday, August 27, 2009 2:57 AM
|
|
|
|
|
I sorted through Registry Monitor several times and came up with nothing conclusive. There does not seem to be a registry key/value dedicated to such a list (that would be too easy), but rather a series of cross-referencing from several locations.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
thanks for the information.
I looked for NetFwMgr and tried to use the interfaces provided but was not able to get any thing.
INetFwMgr
NetFwPolicy
Thanks
"A winner is not one who never fails...but the one who never quits"
|
|
|
|